Create Silent Exec Custom Action #230

Merged
merged 8 commits into from Apr 13, 2015

Projects

None yet

3 participants

@firegiantco

QuietExec outputs both the command and the standard output to the log, which is problematic if you are passing in a password or similar. The new SilentExec custom action allows one to run an executable without outputting the command or the standard output of the program.

Also, provide a new, more consistent name for quiet exec functionality (WixQuietExec instead of CAQuietExec). It behaves no different than the old name, and the old name still works.

Mike Carlson and others added some commits Mar 19, 2015
Mike Carlson Implement a new WixSilentExec custom action, which allows users to en…
…sure input and output of the executable are never logged, intended for security / privacy scenarios. Also create a new custom action which matches the behavior of CAQuietExec, but has a new name, WixQuietExec.
ec05420
Mike Carlson Document the new WixSilentExec custom action, and also update documen…
…tation to use the new WixQuietExec name
174e793
Mike Carlson Address code review feedback a998cbe
@barnson barnson Make sure output is read even if it won't be logged. 5c00271
@barnson barnson Rename LogOutput as it no longer always logs output per Mike's feedback. 81ff26c
@barnson barnson Add comment. 7149f7a
@firegiantco firegiantco changed the title from Silent exec pull to Create Silent Exec Custom Action Apr 9, 2015
@heaths heaths commented on an outdated diff Apr 10, 2015
src/ext/ca/wixca/dll/qtexecca.cpp
{
- hr = WcaGetProperty( L"QtExecCmdTimeout", &pwzData);
- ExitOnFailure(hr, "failed to get QtExecCmdTimeout");
+ hr = WcaGetProperty(wzPropertyName, &pwzData);
+ ExitOnFailure1(hr, "failed to get %ls", wzPropertyName);
@heaths
heaths Apr 10, 2015 Contributor

Should use the variadic macros now (just drop the "1" in the macro - they will be removed eventually).

@heaths heaths commented on an outdated diff Apr 10, 2015
src/ext/ca/wixca/dll/qtexecca.cpp
+}
+
+// 2nd deprecated custom action name, superseded by WixQuietExec64
+extern "C" UINT __stdcall CAQuietExec64(
+ __in MSIHANDLE hInstall
+ )
+{
+ Assert(hInstall);
+ HRESULT hr = S_OK;
+ UINT er = ERROR_SUCCESS;
+
+ hr = WcaInitialize(hInstall, "CAQuietExec64");
+ ExitOnFailure(hr, "failed to initialize");
+
+ hr = ExecCommon64(CAQUIET64_ARGUMENTS_PROPERTY, CAQUIET_TIMEOUT_PROPERTY, TRUE, TRUE);
+ ExitOnFailure(hr, "Failed in method");
@heaths
heaths Apr 10, 2015 Contributor

Missing method name.

@heaths heaths commented on an outdated diff Apr 10, 2015
src/libs/wcautil/qtexec.cpp
{
- ++pEnd;
+ hr = StrAllocConcat(&szLog, (LPCWSTR)pBuffer, 0);
+ ExitOnFailure(hr, "failed to concatenate output strings");
+ }
+ else
+ {
+ hr = StrAllocStringAnsi(&szTemp, (LPCSTR)pBuffer, 0, CP_OEMCP);
+ ExitOnFailure(hr, "failed to allocate output string");
@heaths
heaths Apr 10, 2015 Contributor

Since you're fixing up the code, may as well capitalize "failed" as new code does.

Mike Carlson added some commits Apr 10, 2015
Mike Carlson Address code review comments from Heath. a474028
Mike Carlson Address code review comments in qtexec.cpp as well (fix error message…
…s to capitalize "Failed" for consistency with new code)
409fc54
@firegiantco

Thanks for the comments, Heath. Commits were added to resolve them.

@barnson barnson merged commit 1cae6e8 into wixtoolset:develop Apr 13, 2015
@Mike-GC Mike-GC deleted the firegiant:silent-exec-pull branch Jul 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment