diff options
| author | Bob Arnson <bob@firegiant.com> | 2021-09-18 19:18:17 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2021-09-18 19:18:17 -0400 |
| commit | befda7bad8a90f43d7f9ca419e91f79613e0effb (patch) | |
| tree | 17e36af44fb4bd0e58c8f39359b99650758030d6 /src/ext | |
| parent | a4dc574fa13d828614058906c4e99fcb45965fe5 (diff) | |
| parent | f958aeb8eea975ef76b72e73c0e40303b3a6b0d0 (diff) | |
| download | wix-befda7bad8a90f43d7f9ca419e91f79613e0effb.tar.gz wix-befda7bad8a90f43d7f9ca419e91f79613e0effb.tar.bz2 wix-befda7bad8a90f43d7f9ca419e91f79613e0effb.zip | |
Merge branch 'ericstj-addNativeMachine' into develop
Diffstat (limited to 'src/ext')
| -rw-r--r-- | src/ext/Util/ca/OsInfo.cpp | 31 | ||||
| -rw-r--r-- | src/ext/Util/ca/utilca.def | 1 | ||||
| -rw-r--r-- | src/ext/Util/wixlib/UtilExtension_Platform.wxi | 12 |
3 files changed, 44 insertions, 0 deletions
diff --git a/src/ext/Util/ca/OsInfo.cpp b/src/ext/Util/ca/OsInfo.cpp index 4783673e..005407af 100644 --- a/src/ext/Util/ca/OsInfo.cpp +++ b/src/ext/Util/ca/OsInfo.cpp | |||
| @@ -485,3 +485,34 @@ 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 | if (S_FALSE != hr) | ||
| 510 | { | ||
| 511 | WcaSetIntProperty(L"WIX_NATIVE_MACHINE", usNativeMachine); | ||
| 512 | } | ||
| 513 | |||
| 514 | LExit: | ||
| 515 | if (FAILED(hr)) | ||
| 516 | er = ERROR_INSTALL_FAILURE; | ||
| 517 | return WcaFinalize(er); | ||
| 518 | } \ No newline at end of file | ||
diff --git a/src/ext/Util/ca/utilca.def b/src/ext/Util/ca/utilca.def index 412d86a3..3912ce56 100644 --- a/src/ext/Util/ca/utilca.def +++ b/src/ext/Util/ca/utilca.def | |||
| @@ -22,6 +22,7 @@ EXPORTS | |||
| 22 | WixQueryOsDirs | 22 | WixQueryOsDirs |
| 23 | WixQueryOsWellKnownSID | 23 | WixQueryOsWellKnownSID |
| 24 | WixQueryOsDriverInfo | 24 | WixQueryOsDriverInfo |
| 25 | WixQueryNativeMachine | ||
| 25 | ; netshortcuts.cpp | 26 | ; netshortcuts.cpp |
| 26 | WixSchedInternetShortcuts | 27 | WixSchedInternetShortcuts |
| 27 | WixCreateInternetShortcuts | 28 | WixCreateInternetShortcuts |
diff --git a/src/ext/Util/wixlib/UtilExtension_Platform.wxi b/src/ext/Util/wixlib/UtilExtension_Platform.wxi index 913c01b9..ab436adc 100644 --- a/src/ext/Util/wixlib/UtilExtension_Platform.wxi +++ b/src/ext/Util/wixlib/UtilExtension_Platform.wxi | |||
| @@ -353,6 +353,18 @@ | |||
| 353 | <Custom Action="$(var.Prefix)QueryOsDriverInfo$(var.Suffix)" After="AppSearch" Overridable="yes" Condition="VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3)" /> | 353 | <Custom Action="$(var.Prefix)QueryOsDriverInfo$(var.Suffix)" After="AppSearch" Overridable="yes" Condition="VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3)" /> |
| 354 | </InstallUISequence> | 354 | </InstallUISequence> |
| 355 | </Fragment> | 355 | </Fragment> |
| 356 | |||
| 357 | <Fragment> | ||
| 358 | <CustomAction Id="$(var.Prefix)QueryNativeMachine$(var.Suffix)" DllEntry="WixQueryNativeMachine" Execute="firstSequence" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" /> | ||
| 359 | |||
| 360 | <InstallExecuteSequence> | ||
| 361 | <Custom Action="$(var.Prefix)QueryNativeMachine$(var.Suffix)" After="AppSearch" Overridable="yes" Condition="VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3)" /> | ||
| 362 | </InstallExecuteSequence> | ||
| 363 | |||
| 364 | <InstallUISequence> | ||
| 365 | <Custom Action="$(var.Prefix)QueryNativeMachine$(var.Suffix)" After="AppSearch" Overridable="yes" Condition="VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3)" /> | ||
| 366 | </InstallUISequence> | ||
| 367 | </Fragment> | ||
| 356 | 368 | ||
| 357 | <Fragment> | 369 | <Fragment> |
| 358 | <Binary Id="$(var.Prefix)UtilCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))utilca.dll" /> | 370 | <Binary Id="$(var.Prefix)UtilCA$(var.Suffix)" SourceFile="!(bindpath.$(var.platform))utilca.dll" /> |
