diff --git a/.github/workflows/github-actions-build.yml b/.github/workflows/github-actions-build.yml index fbbbcb4..e142b1d 100644 --- a/.github/workflows/github-actions-build.yml +++ b/.github/workflows/github-actions-build.yml @@ -11,7 +11,7 @@ on: psw_wix_version: description: 'PanelSwWix4 version' required: true - default: 6.0.0-psw-wix.0268-12 + default: 6.0.0-psw-wix.0276-14 type: string jobs: @@ -37,7 +37,7 @@ jobs: Add-Content -Path ${{ github.env }} -Value "PSW_WIX_VERSION=${{ env.DEFAULT_PSW_WIX_VERSION }}" } env: - DEFAULT_PSW_WIX_VERSION: '6.0.0-psw-wix.0268-12' + DEFAULT_PSW_WIX_VERSION: '6.0.0-psw-wix.0276-14' - name: Prepare for build run: | diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 06b12a8..b2d7398 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -2,7 +2,7 @@ true 5.0.0 - 6.0.0-psw-wix.0268-12 + 6.0.0-psw-wix.0276-14 23.1.33 diff --git a/src/PanelSwCustomActions/ServiceConfig.cpp b/src/PanelSwCustomActions/ServiceConfig.cpp index b42b669..548c214 100644 --- a/src/PanelSwCustomActions/ServiceConfig.cpp +++ b/src/PanelSwCustomActions/ServiceConfig.cpp @@ -89,7 +89,7 @@ extern "C" UINT __stdcall ServiceConfig(MSIHANDLE hInstall) if (compAction != WCA_TODO::WCA_TODO_INSTALL) { // In case of no-action, we just check if the service is marked for deletion to notify reboot is reqired. - oDeferred.AddServiceConfig(szServiceName, nullptr, nullptr, nullptr, ServciceConfigDetails::ServiceStart::ServciceConfigDetails_ServiceStart_unchanged, nullptr, lstDependencies, ErrorHandling::ignore, ServciceConfigDetails_DelayStart::ServciceConfigDetails_DelayStart_unchanged1, SERVICE_NO_CHANGE); + oDeferred.AddServiceConfig(szServiceName, nullptr, nullptr, nullptr, nullptr, ServciceConfigDetails::ServiceStart::ServciceConfigDetails_ServiceStart_unchanged, nullptr, lstDependencies, ErrorHandling::ignore, ServciceConfigDetails_DelayStart::ServciceConfigDetails_DelayStart_unchanged1, SERVICE_NO_CHANGE); WcaLog(LOGLEVEL::LOGMSG_STANDARD, "Skipping configuration of service '%ls' since component is not installed", (LPCWSTR)szServiceName); continue; @@ -243,14 +243,14 @@ extern "C" UINT __stdcall ServiceConfig(MSIHANDLE hInstall) } } - hr = oRollback.AddServiceConfig((LPCWSTR)szServiceName, pServiceCfg->lpBinaryPathName, pServiceCfg->lpServiceStartName, nullptr, pServiceCfg->dwStartType, pServiceCfg->lpLoadOrderGroup, lstRlbkDependencies, ErrorHandling::ignore, rlbkDelayStart, pServiceCfg->dwServiceType); + hr = oRollback.AddServiceConfig((LPCWSTR)szServiceName, pServiceCfg->lpBinaryPathName, pServiceCfg->lpBinaryPathName, pServiceCfg->lpServiceStartName, nullptr, pServiceCfg->dwStartType, pServiceCfg->lpLoadOrderGroup, lstRlbkDependencies, ErrorHandling::ignore, rlbkDelayStart, pServiceCfg->dwServiceType); ExitOnFailure(hr, "Failed creating rollback CustomActionData"); ReleaseNullMem(pServiceCfg); ReleaseServiceHandle(hService); } - hr = oDeferred.AddServiceConfig(szServiceName, szCommand, szAccount, szPassword, start, szLoadOrderGroup, lstDependencies, (ErrorHandling)errorHandling, (ServciceConfigDetails_DelayStart)nDelayStart, dwServiceType); + hr = oDeferred.AddServiceConfig(szServiceName, (LPCWSTR)szCommand, szCommand.Obfuscated(), szAccount, szPassword, start, szLoadOrderGroup, lstDependencies, (ErrorHandling)errorHandling, (ServciceConfigDetails_DelayStart)nDelayStart, dwServiceType); ExitOnFailure(hr, "Failed creating CustomActionData"); } @@ -281,7 +281,7 @@ CServiceConfig::CServiceConfig() , _errorPrompter(PSW_MSI_MESSAGES::PSW_MSI_MESSAGES_SERVICE_CONFIG_ERROR) { } -HRESULT CServiceConfig::AddServiceConfig(LPCWSTR szServiceName, LPCWSTR szCommandLine, LPCWSTR szAccount, LPCWSTR szPassword, int start, LPCWSTR szLoadOrderGroup, const std::list &lstDependencies, ErrorHandling errorHandling, ServciceConfigDetails_DelayStart delayStart, DWORD dwServiceType) +HRESULT CServiceConfig::AddServiceConfig(LPCWSTR szServiceName, LPCWSTR szCommandLine, LPCWSTR szObfuscatedCommandLine, LPCWSTR szAccount, LPCWSTR szPassword, int start, LPCWSTR szLoadOrderGroup, const std::list& lstDependencies, ErrorHandling errorHandling, ServciceConfigDetails_DelayStart delayStart, DWORD dwServiceType) { HRESULT hr = S_OK; ::com::panelsw::ca::Command* pCmd = nullptr; @@ -306,7 +306,8 @@ HRESULT CServiceConfig::AddServiceConfig(LPCWSTR szServiceName, LPCWSTR szComman } if (szCommandLine && *szCommandLine) { - pDetails->set_commandline(szCommandLine, WSTR_BYTE_SIZE(szCommandLine)); + pDetails->mutable_commandline()->set_plain(szCommandLine, WSTR_BYTE_SIZE((LPCWSTR)szCommandLine)); + pDetails->mutable_commandline()->set_obfuscated(szObfuscatedCommandLine, WSTR_BYTE_SIZE(szObfuscatedCommandLine)); } if (szLoadOrderGroup) // May be empty { @@ -357,10 +358,10 @@ HRESULT CServiceConfig::DeferredExecute(const ::std::string& command) szPassword = (LPCWSTR)(LPVOID)details.password().data(); } } - if (details.commandline().size() > sizeof(WCHAR)) + if (details.commandline().plain().size() > sizeof(WCHAR)) { - szCommandLine = (LPCWSTR)(LPVOID)details.commandline().data(); - WcaLog(LOGLEVEL::LOGMSG_STANDARD, "Service '%ls' command line '%ls'", szServiceName, szCommandLine); + szCommandLine = (LPCWSTR)(LPVOID)details.commandline().plain().data(); + WcaLog(LOGLEVEL::LOGMSG_STANDARD, "Service '%ls' command line '%ls'", szServiceName, (LPCWSTR)(LPVOID)details.commandline().obfuscated().data()); } if (details.loadordergroup().size() > 0) // May be empty { diff --git a/src/PanelSwCustomActions/ServiceConfig.h b/src/PanelSwCustomActions/ServiceConfig.h index 1df6736..7d13622 100644 --- a/src/PanelSwCustomActions/ServiceConfig.h +++ b/src/PanelSwCustomActions/ServiceConfig.h @@ -12,7 +12,7 @@ class CServiceConfig : CServiceConfig(); - HRESULT AddServiceConfig(LPCWSTR szServiceName, LPCWSTR szCommandLine, LPCWSTR szAccount, LPCWSTR szPassword, int start, LPCWSTR szLoadOrderGroup, const std::list &lstDependencies, ::com::panelsw::ca::ErrorHandling errorHandling, ::com::panelsw::ca::ServciceConfigDetails_DelayStart delayStart, DWORD dwServiceType); + HRESULT AddServiceConfig(LPCWSTR szServiceName, LPCWSTR szCommandLine, LPCWSTR szObfuscatedCommandLine, LPCWSTR szAccount, LPCWSTR szPassword, int start, LPCWSTR szLoadOrderGroup, const std::list &lstDependencies, ::com::panelsw::ca::ErrorHandling errorHandling, ::com::panelsw::ca::ServciceConfigDetails_DelayStart delayStart, DWORD dwServiceType); protected: diff --git a/src/ProtoCaLib/servciceConfigDetails.proto b/src/ProtoCaLib/servciceConfigDetails.proto index 5428f10..e480d33 100644 --- a/src/ProtoCaLib/servciceConfigDetails.proto +++ b/src/ProtoCaLib/servciceConfigDetails.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package com.panelsw.ca; option optimize_for = LITE_RUNTIME; import "ErrorHandling.proto"; +import "obfuscatedString.proto"; message ServciceConfigDetails{ @@ -22,7 +23,7 @@ message ServciceConfigDetails{ } bytes name = 1; - bytes commandLine = 2; + ObfuscatedString commandLine = 2; bytes account = 3; bytes password = 4; ServiceStart start = 5; diff --git a/src/TidyBuild.custom.props b/src/TidyBuild.custom.props index c8ffef2..d445183 100644 --- a/src/TidyBuild.custom.props +++ b/src/TidyBuild.custom.props @@ -2,7 +2,7 @@ - 5.0.2 + 5.0.3 $(FullVersion).$(GITHUB_RUN_NUMBER) PanelSwWixExtension Panel::Software diff --git a/src/global.json b/src/global.json index 43242bf..9b1123f 100644 --- a/src/global.json +++ b/src/global.json @@ -1,7 +1,7 @@ { "msbuild-sdks": { "WixToolset.Sdk": "5.0.0", - "PanelSwWix4.Sdk": "6.0.0-psw-wix.0268-12", + "PanelSwWix4.Sdk": "6.0.0-psw-wix.0276-14", "Microsoft.Build.Traversal": "4.0.0" } }