diff --git a/history/5171.md b/history/5171.md new file mode 100644 index 00000000..ef98e4f7 --- /dev/null +++ b/history/5171.md @@ -0,0 +1,2 @@ +* @barnson: Write VersionMajor/VersionMinor Uninstall values. + * Partial fix for wixtoolset/issues#5171. (Does not write InstallLocation.) diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp index 1eebdeea..3c5cb57e 100644 --- a/src/burn/engine/registration.cpp +++ b/src/burn/engine/registration.cpp @@ -40,6 +40,8 @@ const LPCWSTR REGISTRY_BUNDLE_SYSTEM_COMPONENT = L"SystemComponent"; const LPCWSTR REGISTRY_BUNDLE_QUIET_UNINSTALL_STRING = L"QuietUninstallString"; const LPCWSTR REGISTRY_BUNDLE_UNINSTALL_STRING = L"UninstallString"; const LPCWSTR REGISTRY_BUNDLE_RESUME_COMMAND_LINE = L"BundleResumeCommandLine"; +const LPCWSTR REGISTRY_BUNDLE_VERSION_MAJOR = L"VersionMajor"; +const LPCWSTR REGISTRY_BUNDLE_VERSION_MINOR = L"VersionMinor"; const LPCWSTR SWIDTAG_FOLDER = L"swidtag"; @@ -642,9 +644,17 @@ extern "C" HRESULT RegistrationSessionBegin( hr = RegWriteStringArray(hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_PATCH_CODE, pRegistration->rgsczPatchCodes, pRegistration->cPatchCodes); ExitOnFailure(hr, "Failed to write %ls value.", BURN_REGISTRATION_REGISTRY_BUNDLE_PATCH_CODE); - hr = RegWriteStringFormatted(hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, L"%hu.%hu.%hu.%hu", (WORD)(pRegistration->qwVersion >> 48), (WORD)(pRegistration->qwVersion >> 32), (WORD)(pRegistration->qwVersion >> 16), (WORD)(pRegistration->qwVersion)); + hr = RegWriteStringFormatted(hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, L"%hu.%hu.%hu.%hu", + static_cast(pRegistration->qwVersion >> 48), static_cast(pRegistration->qwVersion >> 32), + static_cast(pRegistration->qwVersion >> 16), static_cast(pRegistration->qwVersion)); ExitOnFailure(hr, "Failed to write %ls value.", BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION); + hr = RegWriteNumber(hkRegistration, REGISTRY_BUNDLE_VERSION_MAJOR, static_cast(pRegistration->qwVersion >> 48)); + ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_VERSION_MAJOR); + + hr = RegWriteNumber(hkRegistration, REGISTRY_BUNDLE_VERSION_MINOR, static_cast(pRegistration->qwVersion >> 32)); + ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_VERSION_MINOR); + if (pRegistration->sczProviderKey) { hr = RegWriteString(hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY, pRegistration->sczProviderKey);