diff options
| author | Eric StJohn <ericstj@microsoft.com> | 2021-08-30 15:26:42 -0700 |
|---|---|---|
| committer | Eric StJohn <ericstj@microsoft.com> | 2021-08-30 15:26:42 -0700 |
| commit | 495370ff9311d406da9c043cd208ce836a0303ff (patch) | |
| tree | ac5aa19b393dce498ad1938a0ce7410eceff93ba /src/ext/Util/ca/OsInfo.cpp | |
| parent | a4dc574fa13d828614058906c4e99fcb45965fe5 (diff) | |
| download | wix-495370ff9311d406da9c043cd208ce836a0303ff.tar.gz wix-495370ff9311d406da9c043cd208ce836a0303ff.tar.bz2 wix-495370ff9311d406da9c043cd208ce836a0303ff.zip | |
Add NativeMachine to Burn and WIX_NATIVE_MACHINE to UtilExtension
Diffstat (limited to 'src/ext/Util/ca/OsInfo.cpp')
| -rw-r--r-- | src/ext/Util/ca/OsInfo.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ext/Util/ca/OsInfo.cpp b/src/ext/Util/ca/OsInfo.cpp index 4783673e..eb76a3a0 100644 --- a/src/ext/Util/ca/OsInfo.cpp +++ b/src/ext/Util/ca/OsInfo.cpp | |||
| @@ -485,3 +485,31 @@ LExit: | |||
| 485 | } | 485 | } |
| 486 | return WcaFinalize(er); | 486 | return WcaFinalize(er); |
| 487 | } | 487 | } |
| 488 | |||
| 489 | /******************************************************************** | ||
| 490 | WixQueryNativeMachine - entry point for WixQueryNativeMachine custom action | ||
| 491 | |||
| 492 | Called as Type 1 custom action (DLL from the Binary table) from | ||
| 493 | Windows Installer to set properties that indicates the native machine architecture | ||
| 494 | ********************************************************************/ | ||
| 495 | extern "C" UINT __stdcall WixQueryNativeMachine( | ||
| 496 | __in MSIHANDLE hInstall | ||
| 497 | ) | ||
| 498 | { | ||
| 499 | HRESULT hr = S_OK; | ||
| 500 | USHORT usNativeMachine = IMAGE_FILE_MACHINE_UNKNOWN; | ||
| 501 | DWORD er = ERROR_SUCCESS; | ||
| 502 | |||
| 503 | hr = WcaInitialize(hInstall, "WixQueryNativeMachine"); | ||
| 504 | ExitOnFailure(hr, "WixQueryNativeMachine failed to initialize"); | ||
| 505 | |||
| 506 | hr = ::ProcNativeMachine(::GetCurrentProcess(), &usNativeMachine); | ||
| 507 | ExitOnFailure(hr, "Failed to get native machine value."); | ||
| 508 | |||
| 509 | WcaSetIntProperty(L"WIX_NATIVE_MACHINE", usNativeMachine); | ||
| 510 | |||
| 511 | LExit: | ||
| 512 | if (FAILED(hr)) | ||
| 513 | er = ERROR_INSTALL_FAILURE; | ||
| 514 | return WcaFinalize(er); | ||
| 515 | } \ No newline at end of file | ||
