Skip to content

Commit

Permalink
ExecOn: Allow obfuscating stdout/stderr text in the log file
Browse files Browse the repository at this point in the history
  • Loading branch information
nirbar committed May 29, 2024
1 parent 930a271 commit 82d4777
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 29 deletions.
71 changes: 51 additions & 20 deletions src/PanelSwCustomActions/ExecOnComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ enum Flags
};

extern HMODULE g_hInstCADLL;
static HRESULT ScheduleExecution(LPCWSTR szId, const CWixString& szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, CExecOnComponent::ExitCodeMap *pExitCodeMap, std::vector<ConsoleOuputRemap> *pConsoleOuput, CExecOnComponent::EnvironmentMap *pEnv, int nFlags, int errorHandling, CExecOnComponent* pBeforeStop, CExecOnComponent* pAfterStop, CExecOnComponent* pBeforeStart, CExecOnComponent* pAfterStart);
static HRESULT ScheduleExecution(LPCWSTR szId, const CWixString& szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, CExecOnComponent::ExitCodeMap *pExitCodeMap, std::vector<ConsoleOuputRemap> *pConsoleOuput, CExecOnComponent::EnvironmentMap *pEnv, int nFlags, int errorHandling, CExecOnComponent* pBeforeStop, CExecOnComponent* pAfterStop, CExecOnComponent* pBeforeStart, CExecOnComponent* pAfterStart, LPCWSTR szObfuscateLog);

extern "C" UINT __stdcall ExecuteCommand(MSIHANDLE hInstall)
{
Expand Down Expand Up @@ -134,7 +134,7 @@ extern "C" UINT __stdcall ExecuteCommand(MSIHANDLE hInstall)
ExitOnFailure(hr, "Failed to msi-format working folder");
}

hr = cad.AddExec(szCommand, (LPCWSTR)szWorkingFolder, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, flags, errorHandling);
hr = cad.AddExec(szCommand, (LPCWSTR)szWorkingFolder, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, flags, errorHandling, nullptr);
ExitOnFailure(hr, "Failed to create command");

hr = cad.SetCustomActionData((LPCWSTR)szId);
Expand Down Expand Up @@ -179,7 +179,7 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall)
ExitOnNull((hr == S_OK), hr, E_FAIL, "Table does not exist 'PSW_ExecOn_ConsoleOutput'. Have you authored 'PanelSw:ExecOn' entries in WiX code?");

// Execute view
hr = WcaOpenExecuteView(L"SELECT `Id`, `Component_`, `Binary_`, `Command`, `WorkingDirectory`, `Flags`, `ErrorHandling`, `User_` FROM `PSW_ExecOnComponent` ORDER BY `Order`", &hView);
hr = WcaOpenExecuteView(L"SELECT `Id`, `Component_`, `Binary_`, `Command`, `WorkingDirectory`, `Flags`, `ErrorHandling`, `User_`, `ObfuscateLog` FROM `PSW_ExecOnComponent` ORDER BY `Order`", &hView);
ExitOnFailure(hr, "Failed to execute SQL query.");

// Iterate records
Expand All @@ -194,6 +194,7 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall)
CWixString userId, domain, user, password;
CWixString szSubQuery;
CWixString szTempFile;
CWixString szObfuscateLog;
int nFlags = 0;
int errorHandling = ErrorHandling::fail;
WCA_TODO compAction = WCA_TODO_UNKNOWN;
Expand All @@ -217,6 +218,8 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall)
ExitOnFailure(hr, "Failed to get ErrorHandling.");
hr = WcaGetRecordString(hRecord, 8, (LPWSTR*)userId);
ExitOnFailure(hr, "Failed to get User_.");
hr = WcaGetRecordFormattedString(hRecord, 9, (LPWSTR*)szObfuscateLog);
ExitOnFailure(hr, "Failed to get ObfuscateLog.");

// Execute from binary
if (!szBinary.IsNullOrEmpty())
Expand Down Expand Up @@ -398,38 +401,38 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall)
case WCA_TODO::WCA_TODO_INSTALL:
if (nFlags & Flags::OnInstall)
{
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart);
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart, (LPCWSTR)szObfuscateLog);
ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId);
}
if (nFlags & Flags::OnInstallRollback)
{
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart);
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart, (LPCWSTR)szObfuscateLog);
ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId);
}
break;

case WCA_TODO::WCA_TODO_REINSTALL:
if (nFlags & Flags::OnReinstall)
{
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart);
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart, (LPCWSTR)szObfuscateLog);
ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId);
}
if (nFlags & Flags::OnReinstallRollback)
{
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart);
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart, (LPCWSTR)szObfuscateLog);
ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId);
}
break;

case WCA_TODO::WCA_TODO_UNINSTALL:
if (nFlags & Flags::OnRemove)
{
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart);
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oDeferredBeforeStop, &oDeferredAfterStop, &oDeferredBeforeStart, &oDeferredAfterStart, (LPCWSTR)szObfuscateLog);
ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId);
}
if (nFlags & Flags::OnRemoveRollback)
{
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart);
hr = ScheduleExecution(szId, szCommand, workDir, domain, user, password, &exitCodeMap, &consoleOutput, &environment, nFlags, errorHandling, &oRollbackBeforeStop, &oRollbackAfterStop, &oRollbackBeforeStart, &oRollbackAfterStart, (LPCWSTR)szObfuscateLog);
ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId);
}
break;
Expand Down Expand Up @@ -484,32 +487,32 @@ extern "C" UINT __stdcall ExecOnComponent(MSIHANDLE hInstall)
return WcaFinalize(er);
}

HRESULT ScheduleExecution(LPCWSTR szId, const CWixString &szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, CExecOnComponent::ExitCodeMap* pExitCodeMap, std::vector<ConsoleOuputRemap>* pConsoleOuput, CExecOnComponent::EnvironmentMap* pEnv, int nFlags, int errorHandling, CExecOnComponent* pBeforeStop, CExecOnComponent* pAfterStop, CExecOnComponent* pBeforeStart, CExecOnComponent* pAfterStart)
HRESULT ScheduleExecution(LPCWSTR szId, const CWixString& szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, CExecOnComponent::ExitCodeMap* pExitCodeMap, std::vector<ConsoleOuputRemap>* pConsoleOuput, CExecOnComponent::EnvironmentMap* pEnv, int nFlags, int errorHandling, CExecOnComponent* pBeforeStop, CExecOnComponent* pAfterStop, CExecOnComponent* pBeforeStart, CExecOnComponent* pAfterStart, LPCWSTR szObfuscateLog)
{
HRESULT hr = S_OK;

if (nFlags & Flags::BeforeStopServices)
{
CDeferredActionBase::LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, false, L"Will execute command '%ls' before StopServices", szCommand.Obfuscated());
hr = pBeforeStop->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling);
hr = pBeforeStop->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling, szObfuscateLog);
ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId);
}
if (nFlags & Flags::AfterStopServices)
{
CDeferredActionBase::LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, false, L"Will execute command '%ls' after StopServices", szCommand.Obfuscated());
hr = pAfterStop->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling);
hr = pAfterStop->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling, szObfuscateLog);
ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId);
}
if (nFlags & Flags::BeforeStartServices)
{
CDeferredActionBase::LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, false, L"Will execute command '%ls' before StartServices", szCommand.Obfuscated());
hr = pBeforeStart->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling);
hr = pBeforeStart->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling, szObfuscateLog);
ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId);
}
if (nFlags & Flags::AfterStartServices)
{
CDeferredActionBase::LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, false, L"Will execute command '%ls' after StartServices", szCommand.Obfuscated());
hr = pAfterStart->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling);
hr = pAfterStart->AddExec(szCommand, szWorkingDirectory, szDomain, szUser, szPassword, pExitCodeMap, pConsoleOuput, pEnv, nFlags, (ErrorHandling)errorHandling, szObfuscateLog);
ExitOnFailure(hr, "Failed scheduling '%ls'", (LPCWSTR)szId);
}

Expand All @@ -524,7 +527,7 @@ CExecOnComponent::CExecOnComponent()
, _stdoutPrompter((DWORD)PSW_MSI_MESSAGES::PSW_MSI_MESSAGES_EXEC_ON_CONSOLE_ERROR)
{ }

HRESULT CExecOnComponent::AddExec(const CWixString &szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, ExitCodeMap* pExitCodeMap, vector<ConsoleOuputRemap>* pConsoleOuput, EnvironmentMap* pEnv, int nFlags, ErrorHandling errorHandling)
HRESULT CExecOnComponent::AddExec(const CWixString& szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, ExitCodeMap* pExitCodeMap, vector<ConsoleOuputRemap>* pConsoleOuput, EnvironmentMap* pEnv, int nFlags, ErrorHandling errorHandling, LPCWSTR szObfuscateLog)
{
HRESULT hr = S_OK;
::com::panelsw::ca::Command* pCmd = nullptr;
Expand All @@ -544,6 +547,10 @@ HRESULT CExecOnComponent::AddExec(const CWixString &szCommand, LPCWSTR szWorking
{
pDetails->set_workingdirectory(szWorkingDirectory, WSTR_BYTE_SIZE(szWorkingDirectory));
}
if (szObfuscateLog && *szObfuscateLog)
{
pDetails->set_obfuscatelog(szObfuscateLog, WSTR_BYTE_SIZE(szObfuscateLog));
}
pDetails->set_async(nFlags & Flags::ASync);
pDetails->set_impersonate(nFlags & Flags::Impersonate);
pDetails->set_errorhandling(errorHandling);
Expand Down Expand Up @@ -624,6 +631,7 @@ HRESULT CExecOnComponent::ExecuteOne(const com::panelsw::ca::ExecOnDetails& deta
LPCWSTR szDomain = nullptr;
LPCWSTR szUser = nullptr;
LPCWSTR szPassword = nullptr;
LPCWSTR szObfuscateLog = nullptr;
CWixString szLog;
HANDLE hStdOut = INVALID_HANDLE_VALUE;
HANDLE hProc = NULL;
Expand Down Expand Up @@ -651,6 +659,10 @@ HRESULT CExecOnComponent::ExecuteOne(const com::panelsw::ca::ExecOnDetails& deta
{
szPassword = (LPCWSTR)(LPVOID)details.password().data();
}
if (details.obfuscatelog().size() > 0)
{
szObfuscateLog = (LPCWSTR)(LPVOID)details.obfuscatelog().data();
}
_errorPrompter.SetErrorHandling((PSW_ERROR_HANDLING)details.errorhandling());
_alwaysPrompter.SetErrorHandling((PSW_ERROR_HANDLING)details.errorhandling());

Expand Down Expand Up @@ -681,7 +693,7 @@ HRESULT CExecOnComponent::ExecuteOne(const com::panelsw::ca::ExecOnDetails& deta

if (SUCCEEDED(hr))
{
LogProcessOutput(hProc, hStdOut, ((details.consoleouputremap_size() > 0) || (details.errorhandling() == ErrorHandling::promptAlways)) ? (LPWSTR*)szLog : nullptr);
LogProcessOutput(hProc, hStdOut, szObfuscateLog, ((details.consoleouputremap_size() > 0) || (details.errorhandling() == ErrorHandling::promptAlways)) ? (LPWSTR*)szLog : nullptr);

hr = ProcWaitForCompletion(hProc, INFINITE, &exitCode);
if (SUCCEEDED(hr))
Expand Down Expand Up @@ -740,7 +752,7 @@ HRESULT CExecOnComponent::ExecuteOne(const com::panelsw::ca::ExecOnDetails& deta
return hr;
}

HRESULT CExecOnComponent::LogProcessOutput(HANDLE hProcess, HANDLE hStdErrOut, LPWSTR* pszText /* Need to detect whether this is unicode or multibyte */)
HRESULT CExecOnComponent::LogProcessOutput(HANDLE hProcess, HANDLE hStdErrOut, LPCWSTR szObfuscateLog, LPWSTR* pszText /* Need to detect whether this is unicode or multibyte */)
{
DWORD dwBufferSize = 0;
DWORD dwBytes = 0;
Expand Down Expand Up @@ -847,7 +859,18 @@ HRESULT CExecOnComponent::LogProcessOutput(HANDLE hProcess, HANDLE hStdErrOut, L
}
while (szLogEnd && *szLogEnd)
{
LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, true, L"%.*ls", (szLogEnd - (szLog + dwLogStart)), szLog + dwLogStart);
CWixString szLogLine;

hr = szLogLine.Format(L"%.*ls", (szLogEnd - (szLog + dwLogStart)), szLog + dwLogStart);
ExitOnFailure(hr, "Failed to format log line");

if (szObfuscateLog && *szObfuscateLog && szLogLine.StrLen())
{
hr = szLogLine.ReplaceAll(szObfuscateLog, L"******");
ExitOnFailure(hr, "Failed to obfuscate log line");
}

LogUnformatted(LOGLEVEL::LOGMSG_STANDARD, true, L"%ls", (LPCWSTR)szLogLine);

// Go past \n or \r\n
if ((szLogEnd[0] == L'\r') && (szLogEnd[1] == L'\n'))
Expand Down Expand Up @@ -887,7 +910,15 @@ HRESULT CExecOnComponent::LogProcessOutput(HANDLE hProcess, HANDLE hStdErrOut, L
// Print any text that didn't end with a new line
if (szLog && (szLog[dwLogStart] != NULL))
{
LogUnformatted(LOGMSG_STANDARD, true, L"%ls", szLog + dwLogStart);
CWixString szLogLine(szLog + dwLogStart);

if (szObfuscateLog && *szObfuscateLog && szLogLine.StrLen())
{
hr = szLogLine.ReplaceAll(szObfuscateLog, L"******");
ExitOnFailure(hr, "Failed to obfuscate log line");
}

LogUnformatted(LOGMSG_STANDARD, true, L"%ls", (LPCWSTR)szLogLine);
}

// Return full log to the caller
Expand Down Expand Up @@ -1111,7 +1142,7 @@ HRESULT CExecOnComponent::LaunchProcess(IMPERSONATION_CONTEXT* pctxImpersonation
}

bRes = ::CreateProcessAsUserW(pctxImpersonation->hUserToken, nullptr, szCommand, nullptr, nullptr, TRUE, ::GetPriorityClass(::GetCurrentProcess()) | CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT, (LPVOID)rgszEnvironment, szWorkingDirectory, &si, &pi);
ExitOnNullWithLastError(bRes, hr, "Failed to create process");
ExitOnNullWithLastError(bRes, hr, "Failed to create impersonated process");
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/PanelSwCustomActions/ExecOnComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CExecOnComponent :

CExecOnComponent();

HRESULT AddExec(const CWixString &szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, ExitCodeMap *pExitCodeMap, std::vector<com::panelsw::ca::ConsoleOuputRemap> *pConsoleOuput, EnvironmentMap *pEnv, int nFlags, com::panelsw::ca::ErrorHandling errorHandling);
HRESULT AddExec(const CWixString &szCommand, LPCWSTR szWorkingDirectory, LPCWSTR szDomain, LPCWSTR szUser, LPCWSTR szPassword, ExitCodeMap *pExitCodeMap, std::vector<com::panelsw::ca::ConsoleOuputRemap> *pConsoleOuput, EnvironmentMap *pEnv, int nFlags, com::panelsw::ca::ErrorHandling errorHandling, LPCWSTR szObfuscateLog);

protected:

Expand Down Expand Up @@ -47,7 +47,7 @@ class CExecOnComponent :

HRESULT SetEnvironment(CWixString *pszEnvironmentMultiSz, const ::google::protobuf::Map<std::string, com::panelsw::ca::ObfuscatedString> &customEnv);

HRESULT LogProcessOutput(HANDLE hProc, HANDLE hStdErrOut, LPWSTR *pszText);
HRESULT LogProcessOutput(HANDLE hProc, HANDLE hStdErrOut, LPCWSTR szObfuscateLog, LPWSTR *pszText);

HRESULT LaunchProcess(IMPERSONATION_CONTEXT* pctxImpersonation, LPWSTR szCommand, LPCWSTR szWorkingDirectory, LPCWSTR rgszEnvironment, HANDLE* phProcess, HANDLE* phStdOut);

Expand Down
6 changes: 6 additions & 0 deletions src/PanelSwWixExtension/PanelSwWixCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2404,6 +2404,7 @@ private void ParseExecOnComponentElement(IntermediateSection section, XElement e
string binary = null;
string command = null;
string workDir = null;
string obfuscateLog = null;
ExecOnComponentFlags flags = ExecOnComponentFlags.None;
ErrorHandling errorHandling = ErrorHandling.fail;
int order = 1000000000 + sourceLineNumbers.LineNumber ?? 0;
Expand All @@ -2426,6 +2427,10 @@ private void ParseExecOnComponentElement(IntermediateSection section, XElement e
workDir = ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
break;

case "ObfuscateLog":
obfuscateLog = ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
break;

case "Order":
order = ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, -1000000000, 1000000000);
if (order < 0)
Expand Down Expand Up @@ -2583,6 +2588,7 @@ private void ParseExecOnComponentElement(IntermediateSection section, XElement e
row.ErrorHandling = (int)errorHandling;
row.Order = order;
row.User_ = user;
row.ObfuscateLog = obfuscateLog;
}

// ExitCode mapping
Expand Down
7 changes: 7 additions & 0 deletions src/PanelSwWixExtension/Symbols/PSW_ExecOnComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static IEnumerable<ColumnDefinition> ColumnDefinitions
new ColumnDefinition(nameof(ErrorHandling), ColumnType.Number, 2, false, false, ColumnCategory.Integer, minValue: 0, maxValue: 3),
new ColumnDefinition(nameof(Order), ColumnType.Number, 4, false, false, ColumnCategory.Integer, minValue: 0, maxValue: int.MaxValue),
new ColumnDefinition(nameof(User_), ColumnType.String, 72, false, true, ColumnCategory.Identifier, modularizeType: ColumnModularizeType.Column, keyTable: "Wix4User", keyColumn: 1),
new ColumnDefinition(nameof(ObfuscateLog), ColumnType.Localized, 0, false, true, ColumnCategory.Formatted, modularizeType: ColumnModularizeType.Property),
};
}
}
Expand Down Expand Up @@ -85,5 +86,11 @@ public string User_
get => Fields[7].AsString();
set => this.Set(7, value);
}

public string ObfuscateLog
{
get => Fields[8].AsString();
set => this.Set(8, value);
}
}
}
5 changes: 5 additions & 0 deletions src/PanelSwWixExtension/Xsd/PanelSwWixExtension.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,11 @@ Note that build-time resolution may be harmed by this process. For example, MsiA
<xs:documentation><![CDATA[Working directory for the command. This field is formatted.]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ObfuscateLog" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation><![CDATA[Process stdout or stderr text that will be obfuscated in the log file. This field is formatted.]]></xs:documentation>
</xs:annotation>
</xs:attribute>

<!-- On Component Action -->
<xs:attribute name="OnInstall" type="wix:YesNoType">
Expand Down
3 changes: 3 additions & 0 deletions src/ProtoCaLib/execOnDetails.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ message ExecOnDetails{

// Impersonate current user
bool impersonate = 12;

// Text to obfuscate in the log file
bytes obfuscateLog = 13;
}
Loading

0 comments on commit 82d4777

Please sign in to comment.