diff options
| author | Liam Mitchell <[email protected]> | 2025-07-21 15:44:41 -0700 |
|---|---|---|
| committer | Liam Mitchell <[email protected]> | 2025-07-21 15:44:41 -0700 |
| commit | 0004a51433d8bc5e427178fe76c8a58e651870ad (patch) | |
| tree | 8c5e489b196b3b4b4315a8ebd8347c9acbb008b6 /src | |
| parent | Add --full option to service install, which will handle stop/uninstall if nec... (diff) | |
| download | zen-0004a51433d8bc5e427178fe76c8a58e651870ad.tar.xz zen-0004a51433d8bc5e427178fe76c8a58e651870ad.zip | |
Add PDBs and crashpad_handler to installed files during full service install
Diffstat (limited to 'src')
| -rw-r--r-- | src/zen/cmds/service_cmd.cpp | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/zen/cmds/service_cmd.cpp b/src/zen/cmds/service_cmd.cpp index f88e39c7f..b3f64e99f 100644 --- a/src/zen/cmds/service_cmd.cpp +++ b/src/zen/cmds/service_cmd.cpp @@ -428,7 +428,22 @@ ServiceCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) throw zen::OptionParseException("--full requires --install-path to be specified"); } - std::filesystem::path ExePath = zen::GetRunningExecutablePath(); + std::filesystem::path ExePath = zen::GetRunningExecutablePath(); + + std::filesystem::path FilesToCopy[] = { + ExePath, + m_ServerExecutable, +#if ZEN_PLATFORM_WINDOWS + ExePath.replace_extension("pdb"), + m_ServerExecutable.replace_extension("pdb"), + ExePath + .replace_filename("crashpad_handler.exe") +#endif +#if ZEN_PLATFORM_MAC + ExePath.replace_filename("crashpad_handler") +#endif + }; + std::filesystem::path DestinationExePath = m_InstallPath / ExePath.filename(); std::filesystem::path DestinationServerPath = m_InstallPath / m_ServerExecutable.filename(); @@ -438,19 +453,17 @@ ServiceCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) return 1; } - if (!CopyFile(ExePath, DestinationExePath, {})) - { - ZEN_CONSOLE("Unable to copy executable from '{}' to '{}'", ExePath, DestinationExePath); - return 1; - } - - if (!CopyFile(m_ServerExecutable, DestinationServerPath, {})) + for (const std::filesystem::path& File : FilesToCopy) { - ZEN_CONSOLE("Unable to copy server executable from '{}' to '{}'", m_ServerExecutable, DestinationServerPath); - return 1; + std::filesystem::path Destination = m_InstallPath / File.filename(); + if (!CopyFile(File, Destination, {})) + { + ZEN_CONSOLE("Failed to copy '{}' to '{}'", File, Destination); + return 1; + } } - m_ServerExecutable = DestinationServerPath; + m_ServerExecutable = m_InstallPath / m_ServerExecutable.filename(); } Ec = InstallService( |