From 58abd6993afba08b39e37b0e76b1790161df9231 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sun, 18 Jul 2021 20:51:15 -0400 Subject: [PATCH 01/19] Drop XP support for v3.14 => v4 transition. --- history/6469.md | 1 + src/burn/engine/engine.cpp | 3 ++ src/burn/engine/variable.cpp | 3 ++ src/ext/ca/serverca/scasched/precomp.h | 1 + src/ext/ca/serverca/scasched/scamanifest.cpp | 20 +++--------- src/ext/ca/wixca/dll/OsInfo.cpp | 3 ++ src/libs/dutil/osutil.cpp | 4 +++ src/libs/libs_multitarget.proj | 32 ++++++++++---------- src/tools/WixTasks/wix.nativeca.targets | 4 --- src/tools/winterop/winterop.cpp | 3 ++ tools/WixBuild.vcxproj.props | 16 +++++----- 11 files changed, 46 insertions(+), 44 deletions(-) create mode 100644 history/6469.md diff --git a/history/6469.md b/history/6469.md new file mode 100644 index 000000000..43261913c --- /dev/null +++ b/history/6469.md @@ -0,0 +1 @@ +* BobArnso: WIXFEAT:6469 - Drop XP support for v3.14 => v4 transition. diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp index 228f46211..68745c5a7 100644 --- a/src/burn/engine/engine.cpp +++ b/src/burn/engine/engine.cpp @@ -144,7 +144,10 @@ extern "C" HRESULT EngineRun( fXmlInitialized = TRUE; ovix.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW); +#pragma warning(push) +#pragma warning(disable:4996) if (!::GetVersionExW((LPOSVERSIONINFOW)&ovix)) +#pragma warning(pop) { ExitWithLastError(hr, "Failed to get OS info."); } diff --git a/src/burn/engine/variable.cpp b/src/burn/engine/variable.cpp index 62f77a5ba..301cc0f76 100644 --- a/src/burn/engine/variable.cpp +++ b/src/burn/engine/variable.cpp @@ -1703,7 +1703,10 @@ static HRESULT InitializeVariableOsInfo( BURN_VARIANT value = { }; ovix.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW); +#pragma warning(push) +#pragma warning(disable:4996) if (!::GetVersionExW((LPOSVERSIONINFOW)&ovix)) +#pragma warning(pop) { ExitWithLastError(hr, "Failed to get OS info."); } diff --git a/src/ext/ca/serverca/scasched/precomp.h b/src/ext/ca/serverca/scasched/precomp.h index 4187a5505..d0b0e5e51 100644 --- a/src/ext/ca/serverca/scasched/precomp.h +++ b/src/ext/ca/serverca/scasched/precomp.h @@ -21,6 +21,7 @@ #include #include #include +#include #include // PerfMon counter header file. #include // PerfMon counter header file. diff --git a/src/ext/ca/serverca/scasched/scamanifest.cpp b/src/ext/ca/serverca/scasched/scamanifest.cpp index a22cea6fb..6fea45eb8 100644 --- a/src/ext/ca/serverca/scasched/scamanifest.cpp +++ b/src/ext/ca/serverca/scasched/scamanifest.cpp @@ -7,18 +7,6 @@ LPCWSTR vcsEventManifestQuery = L"SELECT `Component_`, `File` FROM `EventManifes enum ePerfMonManifestQuery { pfmComponent = 1, pfmFile, pfmResourceFileDir }; enum eEventManifestQuery { emComponent = 1, emFile}; -BOOL IsVistaOrAbove() -{ - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (!::GetVersionEx(&osvi)) - { - return false; - } - return osvi.dwMajorVersion >= 6; -} - /******************************************************************** ConfigurePerfmonManifestRegister - CUSTOM ACTION ENTRY POINT for scheduling @@ -39,7 +27,7 @@ extern "C" UINT __stdcall ConfigurePerfmonManifestRegister( hr = WcaInitialize(hInstall, "ConfigurePerfmonManifestReg"); ExitOnFailure(hr, "Failed to initialize"); - if (!IsVistaOrAbove()) + if (!IsWindowsVistaOrGreater()) { WcaLog(LOGMSG_VERBOSE, "Skipping ConfigurePerfmonManifestRegister() because the target system does not support perfmon manifest"); ExitFunction1(hr = S_FALSE); @@ -136,7 +124,7 @@ extern "C" UINT __stdcall ConfigurePerfmonManifestUnregister( hr = WcaInitialize(hInstall, "ConfigurePerfmonManifestUnreg"); ExitOnFailure(hr, "Failed to initialize"); - if (!IsVistaOrAbove()) + if (!IsWindowsVistaOrGreater()) { WcaLog(LOGMSG_VERBOSE, "Skipping ConfigurePerfmonManifestUnregister() because the target system does not support perfmon manifest"); ExitFunction1(hr = S_FALSE); @@ -224,7 +212,7 @@ extern "C" UINT __stdcall ConfigureEventManifestRegister( hr = WcaInitialize(hInstall, "ConfigureEventManifestReg"); ExitOnFailure(hr, "Failed to initialize"); - if (!IsVistaOrAbove()) + if (!IsWindowsVistaOrGreater()) { WcaLog(LOGMSG_VERBOSE, "Skipping ConfigureEventManifestRegister() because the target system does not support event manifest"); ExitFunction1(hr = S_FALSE); @@ -306,7 +294,7 @@ extern "C" UINT __stdcall ConfigureEventManifestUnregister( hr = WcaInitialize(hInstall, "ConfigureEventManifestUnreg"); ExitOnFailure(hr, "Failed to initialize"); - if (!IsVistaOrAbove()) + if (!IsWindowsVistaOrGreater()) { WcaLog(LOGMSG_VERBOSE, "Skipping ConfigureEventManifestUnregister() because the target system does not support event manifest"); ExitFunction1(hr = S_FALSE); diff --git a/src/ext/ca/wixca/dll/OsInfo.cpp b/src/ext/ca/wixca/dll/OsInfo.cpp index 718278a5f..79ba228ff 100644 --- a/src/ext/ca/wixca/dll/OsInfo.cpp +++ b/src/ext/ca/wixca/dll/OsInfo.cpp @@ -29,7 +29,10 @@ extern "C" UINT __stdcall WixQueryOsInfo( // identify product suites ovix.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW); +#pragma warning(push) +#pragma warning(disable:4996) ::GetVersionExW(reinterpret_cast(&ovix)); +#pragma warning(pop) if (VER_SUITE_SMALLBUSINESS == (ovix.wSuiteMask & VER_SUITE_SMALLBUSINESS)) { diff --git a/src/libs/dutil/osutil.cpp b/src/libs/dutil/osutil.cpp index d1a4dd9ae..26069a840 100644 --- a/src/libs/dutil/osutil.cpp +++ b/src/libs/dutil/osutil.cpp @@ -19,7 +19,11 @@ extern "C" void DAPI OsGetVersion( if (OS_VERSION_UNKNOWN == vOsVersion) { ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW); + +#pragma warning(push) +#pragma warning(disable:4996) ::GetVersionExW(reinterpret_cast(&ovi)); // only fails if version info size is set incorrectly. +#pragma warning(pop) vdwOsServicePack = static_cast(ovi.wServicePackMajor) << 16 | ovi.wServicePackMinor; if (4 == ovi.dwMajorVersion) diff --git a/src/libs/libs_multitarget.proj b/src/libs/libs_multitarget.proj index 9396ccf5f..51a4185cc 100644 --- a/src/libs/libs_multitarget.proj +++ b/src/libs/libs_multitarget.proj @@ -20,31 +20,31 @@ - PlatformToolset=v110_xp + PlatformToolset=v110 - PlatformToolset=v110_xp + PlatformToolset=v110 - PlatformToolset=v110_xp + PlatformToolset=v110 - PlatformToolset=v110_xp + PlatformToolset=v110 - PlatformToolset=v120_xp + PlatformToolset=v120 - PlatformToolset=v120_xp + PlatformToolset=v120 - PlatformToolset=v120_xp + PlatformToolset=v120 - PlatformToolset=v120_xp + PlatformToolset=v120 @@ -65,16 +65,16 @@ - PlatformToolset=v140_xp + PlatformToolset=v140 - PlatformToolset=v140_xp + PlatformToolset=v140 - PlatformToolset=v140_xp + PlatformToolset=v140 - PlatformToolset=v140_xp + PlatformToolset=v140 @@ -95,16 +95,16 @@ - PlatformToolset=v141_xp + PlatformToolset=v141 - PlatformToolset=v141_xp + PlatformToolset=v141 - PlatformToolset=v141_xp + PlatformToolset=v141 - PlatformToolset=v141_xp + PlatformToolset=v141 diff --git a/src/tools/WixTasks/wix.nativeca.targets b/src/tools/WixTasks/wix.nativeca.targets index d91edf519..014f4cd09 100644 --- a/src/tools/WixTasks/wix.nativeca.targets +++ b/src/tools/WixTasks/wix.nativeca.targets @@ -9,13 +9,9 @@ VS2010 VS2012 - VS2012 VS2013 - VS2013 VS2015 - VS2015 VS2017 - VS2017 VS2015 diff --git a/src/tools/winterop/winterop.cpp b/src/tools/winterop/winterop.cpp index b3730d3d0..06622abfe 100644 --- a/src/tools/winterop/winterop.cpp +++ b/src/tools/winterop/winterop.cpp @@ -32,7 +32,10 @@ HRESULT ResetAcls( OSVERSIONINFO osvi; osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); +#pragma warning(push) +#pragma warning(disable:4996) if (!::GetVersionExA(&osvi)) +#pragma warning(pop) { ExitOnLastError(hr, "failed to get OS version"); } diff --git a/tools/WixBuild.vcxproj.props b/tools/WixBuild.vcxproj.props index bc3f763a6..8a4f055bd 100644 --- a/tools/WixBuild.vcxproj.props +++ b/tools/WixBuild.vcxproj.props @@ -16,10 +16,10 @@ - v141_xp - v140_xp - v120_xp - v110_xp + v141 + v140 + v120 + v110 v100 Windows @@ -38,10 +38,10 @@ 2010 - 2012 - 2013 - 2015 - 2017 + 2012 + 2013 + 2015 + 2017 From 75699d898b47b74ad99a0be8c3d8ac3cf726aec5 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Fri, 27 Aug 2021 15:22:14 -0700 Subject: [PATCH 02/19] Add NativeMachine to Burn and WIX_NATIVE_MACHINE to UtilExtension --- src/burn/engine/variable.cpp | 25 ++++++++++++++++ .../bundle/bundle_built_in_variables.html.md | 1 + .../documents/customactions/osinfo.html.md | 16 +++++++++- .../UtilExtension/wixlib/UtilExtension.wxs | 5 ++++ .../wixlib/UtilExtension_Platform.wxi | 12 ++++++++ src/ext/ca/wixca/dll/OsInfo.cpp | 28 ++++++++++++++++++ src/ext/ca/wixca/dll/wixca.def | 1 + src/libs/dutil/inc/procutil.h | 4 +++ src/libs/dutil/procutil.cpp | 29 +++++++++++++++++-- src/tools/wix/CompilerCore.cs | 1 + .../UtilExtension/PropertyTests/product.wxs | 6 +++- test/src/UnitTests/Burn/VariableTest.cpp | 1 + .../UtilExtension.PropertyTests.cs | 7 +++++ .../Bundle.ComponentSearchTests.cs | 2 +- .../Bundle.DirectorySearchTests.cs | 2 +- .../Bundle.FileSearchTests.cs | 2 +- .../Bundle.ProductSearchTests.cs | 2 +- .../Bundle.RegistrySearchTests.cs | 2 +- .../BuildingPackages/Bundle.VariableTests.cs | 4 +-- 19 files changed, 138 insertions(+), 12 deletions(-) diff --git a/src/burn/engine/variable.cpp b/src/burn/engine/variable.cpp index 301cc0f76..352a6892d 100644 --- a/src/burn/engine/variable.cpp +++ b/src/burn/engine/variable.cpp @@ -91,6 +91,10 @@ static HRESULT InitializeVariableVersionNT( __in DWORD_PTR dwpData, __inout BURN_VARIANT* pValue ); +static HRESULT InitializeVariableNativeMachine( + __in DWORD_PTR dwpData, + __inout BURN_VARIANT* pValue + ); static HRESULT InitializeVariableOsInfo( __in DWORD_PTR dwpData, __inout BURN_VARIANT* pValue @@ -218,6 +222,7 @@ extern "C" HRESULT VariableInitialize( {L"LocalAppDataFolder", InitializeVariableCsidlFolder, CSIDL_LOCAL_APPDATA}, {VARIABLE_LOGONUSER, InitializeVariableLogonUser, 0}, {L"MyPicturesFolder", InitializeVariableCsidlFolder, CSIDL_MYPICTURES}, + {L"NativeMachine", InitializeVariableNativeMachine, 0}, {L"NTProductType", InitializeVariableOsInfo, OS_INFO_VARIABLE_NTProductType}, {L"NTSuiteBackOffice", InitializeVariableOsInfo, OS_INFO_VARIABLE_NTSuiteBackOffice}, {L"NTSuiteDataCenter", InitializeVariableOsInfo, OS_INFO_VARIABLE_NTSuiteDataCenter}, @@ -1802,6 +1807,26 @@ static HRESULT InitializeVariableSystemInfo( return hr; } +static HRESULT InitializeVariableNativeMachine( + __in DWORD_PTR dwpData, + __inout BURN_VARIANT* pValue + ) +{ + UNREFERENCED_PARAMETER(dwpData); + + HRESULT hr = S_OK; + USHORT usNativeMachine = IMAGE_FILE_MACHINE_UNKNOWN; + + hr = ProcNativeMachine(::GetCurrentProcess(), &usNativeMachine); + ExitOnFailure(hr, "Failed to get native machine value."); + + hr = BVariantSetNumeric(pValue, usNativeMachine); + ExitOnFailure(hr, "Failed to set variant value."); + +LExit: + return hr; +} + static HRESULT InitializeVariableComputerName( __in DWORD_PTR dwpData, __inout BURN_VARIANT* pValue diff --git a/src/chm/documents/bundle/bundle_built_in_variables.html.md b/src/chm/documents/bundle/bundle_built_in_variables.html.md index d74a997e4..5956fdb1a 100644 --- a/src/chm/documents/bundle/bundle_built_in_variables.html.md +++ b/src/chm/documents/bundle/bundle_built_in_variables.html.md @@ -24,6 +24,7 @@ The Burn engine offers a set of commonly-used variables so you can use them with * LocalAppDataFolder - gets the well-known folder for CSIDL\_LOCAL\_APPDATA. * LogonUser - gets the current user name. * MyPicturesFolder - gets the well-known folder for CSIDL\_MYPICTURES. +* NativeMachine - gets the [Image File Machine value](https://docs.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants) representing the native architecture of the machine. This property is only set on Windows 10, version 1511 (TH2) and higher. * NTProductType - numeric product type from OS version information. * NTSuiteBackOffice - non-zero if OS version suite is Back Office. * NTSuiteDataCenter - non-zero if OS version suite is Datacenter. diff --git a/src/chm/documents/customactions/osinfo.html.md b/src/chm/documents/customactions/osinfo.html.md index afa089fd0..08cab09c4 100644 --- a/src/chm/documents/customactions/osinfo.html.md +++ b/src/chm/documents/customactions/osinfo.html.md @@ -5,7 +5,7 @@ after: using_standard_customactions --- # OSInfo custom actions -The WixQueryOsInfo, WixQueryOsDirs, and WixQueryOsDriverInfo custom actions in wixca (part of WixUtilExtension) set properties over and above the MSI set for OS product/suite detection and standard directories. The WixQueryOsWellKnownSID custom action sets properties for the localized names of some built in Windows users and groups. +The WixQueryOsInfo, WixQueryOsDirs, WixQueryOsDriverInfo, and WixQueryNativeMachine custom actions in wixca (part of WixUtilExtension) set properties over and above the MSI set for OS product/suite detection, architecture, and standard directories. The WixQueryOsWellKnownSID custom action sets properties for the localized names of some built in Windows users and groups. To use these custom actions you simply need to add a [<PropertyRef>](~/xsd/wix/propertyref.html) to the property you want to use and then include WixUtilExtensions when linking. For example: @@ -549,3 +549,17 @@ WixUtilExtension will automatically schedule the custom actions as needed after Set to 1 if the target machine has composition enabled. This property is only set on machines running Windows Vista or higher. + +

WixQueryNativeMachine properties

+ + + + + + + +
+

WIX_NATIVE_MACHINE

+
+

Set to an [Image File Machine value](https://docs.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants) representing the native architecture of the machine. This property is only set on Windows 10, version 1511 (TH2) and higher.

+
diff --git a/src/ext/UtilExtension/wixlib/UtilExtension.wxs b/src/ext/UtilExtension/wixlib/UtilExtension.wxs index 85fab6b19..f42c7551c 100644 --- a/src/ext/UtilExtension/wixlib/UtilExtension.wxs +++ b/src/ext/UtilExtension/wixlib/UtilExtension.wxs @@ -277,6 +277,11 @@ + + + + + diff --git a/src/ext/UtilExtension/wixlib/UtilExtension_Platform.wxi b/src/ext/UtilExtension/wixlib/UtilExtension_Platform.wxi index 50f48c7dd..d2b59bc77 100644 --- a/src/ext/UtilExtension/wixlib/UtilExtension_Platform.wxi +++ b/src/ext/UtilExtension/wixlib/UtilExtension_Platform.wxi @@ -227,6 +227,18 @@ VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + + + + + + VersionNT > 602 + + + + VersionNT > 602 + + diff --git a/src/ext/ca/wixca/dll/OsInfo.cpp b/src/ext/ca/wixca/dll/OsInfo.cpp index 79ba228ff..38190f5c3 100644 --- a/src/ext/ca/wixca/dll/OsInfo.cpp +++ b/src/ext/ca/wixca/dll/OsInfo.cpp @@ -487,3 +487,31 @@ extern "C" UINT __stdcall WixQueryOsDriverInfo( } return WcaFinalize(er); } + +/******************************************************************** +WixQueryNativeMachine - entry point for WixQueryNativeMachine custom action + + Called as Type 1 custom action (DLL from the Binary table) from + Windows Installer to set properties that indicates the native machine architecture +********************************************************************/ +extern "C" UINT __stdcall WixQueryNativeMachine( + __in MSIHANDLE hInstall + ) +{ + HRESULT hr = S_OK; + USHORT usNativeMachine = IMAGE_FILE_MACHINE_UNKNOWN; + DWORD er = ERROR_SUCCESS; + + hr = WcaInitialize(hInstall, "WixQueryNativeMachine"); + ExitOnFailure(hr, "WixQueryNativeMachine failed to initialize"); + + hr = ::ProcNativeMachine(::GetCurrentProcess(), &usNativeMachine); + ExitOnFailure(hr, "Failed to get native machine value."); + + WcaSetIntProperty(L"WIX_NATIVE_MACHINE", usNativeMachine); + +LExit: + if (FAILED(hr)) + er = ERROR_INSTALL_FAILURE; + return WcaFinalize(er); +} \ No newline at end of file diff --git a/src/ext/ca/wixca/dll/wixca.def b/src/ext/ca/wixca/dll/wixca.def index 33f96afc5..1d7ed6b8e 100644 --- a/src/ext/ca/wixca/dll/wixca.def +++ b/src/ext/ca/wixca/dll/wixca.def @@ -19,6 +19,7 @@ EXPORTS WixQueryOsDirs WixQueryOsWellKnownSID WixQueryOsDriverInfo + WixQueryNativeMachine ; netshortcuts.cpp WixSchedInternetShortcuts WixCreateInternetShortcuts diff --git a/src/libs/dutil/inc/procutil.h b/src/libs/dutil/inc/procutil.h index 00f3f358c..4f49313bd 100644 --- a/src/libs/dutil/inc/procutil.h +++ b/src/libs/dutil/inc/procutil.h @@ -22,6 +22,10 @@ HRESULT DAPI ProcWow64( __in HANDLE hProcess, __out BOOL* pfWow64 ); +HRESULT DAPI ProcNativeMachine( + __in HANDLE hProcess, + __out USHORT* pusNativeMachine + ); HRESULT DAPI ProcDisableWowFileSystemRedirection( __in PROC_FILESYSTEMREDIRECTION* pfsr ); diff --git a/src/libs/dutil/procutil.cpp b/src/libs/dutil/procutil.cpp index 0de86f58c..b05a226ae 100644 --- a/src/libs/dutil/procutil.cpp +++ b/src/libs/dutil/procutil.cpp @@ -76,13 +76,13 @@ extern "C" HRESULT DAPI ProcWow64( if (pfnIsWow64Process2) { - USHORT pProcessMachine = IMAGE_FILE_MACHINE_UNKNOWN; - if (!pfnIsWow64Process2(hProcess, &pProcessMachine, nullptr)) + USHORT usProcessMachine = IMAGE_FILE_MACHINE_UNKNOWN; + if (!pfnIsWow64Process2(hProcess, &usProcessMachine, NULL)) { ExitWithLastError(hr, "Failed to check WOW64 process - IsWow64Process2."); } - if (pProcessMachine != IMAGE_FILE_MACHINE_UNKNOWN) + if (usProcessMachine != IMAGE_FILE_MACHINE_UNKNOWN) { fIsWow64 = TRUE; } @@ -107,6 +107,29 @@ extern "C" HRESULT DAPI ProcWow64( return hr; } +extern "C" HRESULT DAPI ProcNativeMachine( + __in HANDLE hProcess, + __out USHORT* pusNativeMachine + ) +{ + HRESULT hr = S_OK; + + typedef BOOL(WINAPI* LPFN_ISWOW64PROCESS2)(HANDLE, USHORT *, USHORT *); + LPFN_ISWOW64PROCESS2 pfnIsWow64Process2 = (LPFN_ISWOW64PROCESS2)::GetProcAddress(::GetModuleHandleW(L"kernel32"), "IsWow64Process2"); + + if (pfnIsWow64Process2) + { + USHORT usProcessMachineUnused = IMAGE_FILE_MACHINE_UNKNOWN; + if (!pfnIsWow64Process2(hProcess, &usProcessMachineUnused, pusNativeMachine)) + { + ExitWithLastError(hr, "Failed to check WOW64 process - IsWow64Process2."); + } + } + +LExit: + return hr; +} + extern "C" HRESULT DAPI ProcDisableWowFileSystemRedirection( __in PROC_FILESYSTEMREDIRECTION* pfsr ) diff --git a/src/tools/wix/CompilerCore.cs b/src/tools/wix/CompilerCore.cs index 4245a1223..74c2b5459 100644 --- a/src/tools/wix/CompilerCore.cs +++ b/src/tools/wix/CompilerCore.cs @@ -186,6 +186,7 @@ public sealed class CompilerCore : IMessageHandler "LocalAppDataFolder", "LogonUser", "MyPicturesFolder", + "NativeMachine", "NTProductType", "NTSuiteBackOffice", "NTSuiteDataCenter", diff --git a/test/data/Extensions/UtilExtension/PropertyTests/product.wxs b/test/data/Extensions/UtilExtension/PropertyTests/product.wxs index 7398d84b9..aeab1065a 100644 --- a/test/data/Extensions/UtilExtension/PropertyTests/product.wxs +++ b/test/data/Extensions/UtilExtension/PropertyTests/product.wxs @@ -169,7 +169,11 @@ - + + + + diff --git a/test/src/UnitTests/Burn/VariableTest.cpp b/test/src/UnitTests/Burn/VariableTest.cpp index 3a4caecfa..4ebafec79 100644 --- a/test/src/UnitTests/Burn/VariableTest.cpp +++ b/test/src/UnitTests/Burn/VariableTest.cpp @@ -420,6 +420,7 @@ namespace Bootstrapper Assert::Equal(E_INVALIDARG, hr); Assert::False(EvaluateConditionHelper(&variables, L"VersionNT = \"VAL\"")); + VariableGetNumericHelper(&variables, L"NativeMachine"); VariableGetNumericHelper(&variables, L"NTProductType"); VariableGetNumericHelper(&variables, L"NTSuiteBackOffice"); VariableGetNumericHelper(&variables, L"NTSuiteDataCenter"); diff --git a/test/src/WixTests/Extensions/UtilExtension/UtilExtension.PropertyTests.cs b/test/src/WixTests/Extensions/UtilExtension/UtilExtension.PropertyTests.cs index f59e0c6cc..dbc7fcfee 100644 --- a/test/src/WixTests/Extensions/UtilExtension/UtilExtension.PropertyTests.cs +++ b/test/src/WixTests/Extensions/UtilExtension/UtilExtension.PropertyTests.cs @@ -61,6 +61,13 @@ public void Property_Install() VerifyPropery(logFile, "WIX_ACCOUNT_USERS", UserVerifier.GetLocalUserNameFromSID(UserVerifier.SIDStrings.BUILTIN_USERS)); VerifyPropery(logFile, "WIX_ACCOUNT_GUESTS", UserVerifier.GetLocalUserNameFromSID(UserVerifier.SIDStrings.BUILTIN_GUESTS)); + if (Environment.OSVersion.Version >= new Version(10, 0, 10586, 0)) + { + Assert.True( + LogVerifier.MessageInLogFileRegex(logFile, "Property(S): WIX_NATIVE_MACHINE = [1-9]\\d*"), + String.Format("Property 'WIX_NATIVE_MACHINE' with with positive non-zero value was not found in the log file: '{0}'", logFile)); + } + MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); } diff --git a/test/src/WixTests/Integration/BuildingPackages/Bundle.ComponentSearchTests.cs b/test/src/WixTests/Integration/BuildingPackages/Bundle.ComponentSearchTests.cs index c97d1e3d3..dde1de8be 100644 --- a/test/src/WixTests/Integration/BuildingPackages/Bundle.ComponentSearchTests.cs +++ b/test/src/WixTests/Integration/BuildingPackages/Bundle.ComponentSearchTests.cs @@ -73,7 +73,7 @@ public void ComponentSearchInvalidProductCode() [Trait("Bug Link", "https://sourceforge.net/tracker/?func=detail&atid=642714&aid=2980329&group_id=105970")] public void ComponentSearchPredefinedVariable() { - string expectedErrorMessage = @"The util:ComponentSearch/@Variable attribute's value, 'ProgramFilesFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'."; + string expectedErrorMessage = @"The util:ComponentSearch/@Variable attribute's value, 'ProgramFilesFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NativeMachine', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'."; Candle candle = new Candle(); candle.SourceFiles.Add(Path.Combine(ComponentSearchTests.TestDataDirectory, @"ComponentSearchPredefinedVariable\Product.wxs")); diff --git a/test/src/WixTests/Integration/BuildingPackages/Bundle.DirectorySearchTests.cs b/test/src/WixTests/Integration/BuildingPackages/Bundle.DirectorySearchTests.cs index 271937ab6..c2e634ddc 100644 --- a/test/src/WixTests/Integration/BuildingPackages/Bundle.DirectorySearchTests.cs +++ b/test/src/WixTests/Integration/BuildingPackages/Bundle.DirectorySearchTests.cs @@ -63,7 +63,7 @@ public void DirectorySearchInvalidPath() [Trait("Bug Link", "https://sourceforge.net/tracker/?func=detail&atid=642714&aid=2980329&group_id=105970")] public void DirectorySearchPredefinedVariable() { - string expectedErrorMessage = @"The util:DirectorySearch/@Variable attribute's value, 'AdminToolsFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'."; + string expectedErrorMessage = @"The util:DirectorySearch/@Variable attribute's value, 'AdminToolsFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NativeMachine', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'."; Candle candle = new Candle(); candle.SourceFiles.Add(Path.Combine(DirectorySearchTests.TestDataDirectory, @"DirectorySearchPredefinedVariable\Product.wxs")); diff --git a/test/src/WixTests/Integration/BuildingPackages/Bundle.FileSearchTests.cs b/test/src/WixTests/Integration/BuildingPackages/Bundle.FileSearchTests.cs index 62b26a28f..7a4f99a93 100644 --- a/test/src/WixTests/Integration/BuildingPackages/Bundle.FileSearchTests.cs +++ b/test/src/WixTests/Integration/BuildingPackages/Bundle.FileSearchTests.cs @@ -63,7 +63,7 @@ public void FileSearchInvalidPath() [Trait("Bug Link", "https://sourceforge.net/tracker/?func=detail&atid=642714&aid=2980329&group_id=105970")] public void FileSearchPredefinedVariable() { - string expectedErrorMessage = @"The util:FileSearch/@Variable attribute's value, 'AdminToolsFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'."; + string expectedErrorMessage = @"The util:FileSearch/@Variable attribute's value, 'AdminToolsFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NativeMachine', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'."; Candle candle = new Candle(); candle.SourceFiles.Add(Path.Combine(FileSearchTests.TestDataDirectory, @"FileSearchPredefinedVariable\Product.wxs")); diff --git a/test/src/WixTests/Integration/BuildingPackages/Bundle.ProductSearchTests.cs b/test/src/WixTests/Integration/BuildingPackages/Bundle.ProductSearchTests.cs index 6389ff08b..d398b0476 100644 --- a/test/src/WixTests/Integration/BuildingPackages/Bundle.ProductSearchTests.cs +++ b/test/src/WixTests/Integration/BuildingPackages/Bundle.ProductSearchTests.cs @@ -60,7 +60,7 @@ public void ProductSearchInvalidGuid() [Trait("Bug Link", "https://sourceforge.net/tracker/?func=detail&atid=642714&aid=2980329&group_id=105970")] public void ProductSearchPredefinedVariable() { - string expectedErrorMessage = @"The util:ProductSearch/@Variable attribute's value, 'ProgramFilesFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'."; + string expectedErrorMessage = @"The util:ProductSearch/@Variable attribute's value, 'ProgramFilesFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NativeMachine', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'."; Candle candle = new Candle(); candle.SourceFiles.Add(Path.Combine(ProductSearchTests.TestDataDirectory, @"ProductSearchPredefinedVariable\Product.wxs")); diff --git a/test/src/WixTests/Integration/BuildingPackages/Bundle.RegistrySearchTests.cs b/test/src/WixTests/Integration/BuildingPackages/Bundle.RegistrySearchTests.cs index 402a023a2..882d9cb26 100644 --- a/test/src/WixTests/Integration/BuildingPackages/Bundle.RegistrySearchTests.cs +++ b/test/src/WixTests/Integration/BuildingPackages/Bundle.RegistrySearchTests.cs @@ -60,7 +60,7 @@ public void RegistrySearchKeyMissing() [Trait("Bug Link", "https://sourceforge.net/tracker/?func=detail&atid=642714&aid=2980329&group_id=105970")] public void RegistrySearchPredefinedVariable() { - string expectedErrorMessage = @"The util:RegistrySearch/@Variable attribute's value, 'AdminToolsFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'."; + string expectedErrorMessage = @"The util:RegistrySearch/@Variable attribute's value, 'AdminToolsFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NativeMachine', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'."; Candle candle = new Candle(); candle.SourceFiles.Add(Path.Combine(RegistrySearchTests.TestDataDirectory, @"RegistrySearchPredefinedVariable\Product.wxs")); diff --git a/test/src/WixTests/Integration/BuildingPackages/Bundle.VariableTests.cs b/test/src/WixTests/Integration/BuildingPackages/Bundle.VariableTests.cs index da9fe3756..73ab585ef 100644 --- a/test/src/WixTests/Integration/BuildingPackages/Bundle.VariableTests.cs +++ b/test/src/WixTests/Integration/BuildingPackages/Bundle.VariableTests.cs @@ -52,8 +52,8 @@ public void BuiltInVariableName() Candle candle = new Candle(); candle.SourceFiles.Add(Path.Combine(VariableTests.TestDataDirectory, @"BuiltInVariableName\Product.wxs")); candle.OutputFile = "Setup.exe"; - candle.ExpectedWixMessages.Add(new WixMessage(348, "The Variable/@Name attribute's value, 'AdminToolsFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'.", Message.MessageTypeEnum.Error)); - candle.ExpectedWixMessages.Add(new WixMessage(348, "The Variable/@Name attribute's value, 'FontsFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'.", Message.MessageTypeEnum.Error)); + candle.ExpectedWixMessages.Add(new WixMessage(348, "The Variable/@Name attribute's value, 'AdminToolsFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NativeMachine', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'.", Message.MessageTypeEnum.Error)); + candle.ExpectedWixMessages.Add(new WixMessage(348, "The Variable/@Name attribute's value, 'FontsFolder', is one of the illegal options: 'AdminToolsFolder', 'AppDataFolder', 'CommonAppDataFolder', 'CommonFilesFolder', 'CompatibilityMode', 'DesktopFolder', 'FavoritesFolder', 'FontsFolder', 'LocalAppDataFolder', 'MyPicturesFolder', 'NativeMachine', 'NTProductType', 'NTSuiteBackOffice', 'NTSuiteDataCenter', 'NTSuiteEnterprise', 'NTSuitePersonal', 'NTSuiteSmallBusiness', 'NTSuiteSmallBusinessRestricted', 'NTSuiteWebServer', 'PersonalFolder', 'Privileged', 'ProgramFilesFolder', 'ProgramMenuFolder', 'SendToFolder', 'StartMenuFolder', 'StartupFolder', 'SystemFolder', 'TempFolder', 'TemplateFolder', 'VersionMsi', 'VersionNT', 'VersionNT64', 'WindowsFolder', or 'WindowsVolume'.", Message.MessageTypeEnum.Error)); candle.ExpectedExitCode = 348; candle.Run(); } From e77c30df95d26de1d745e5ec7dd708ac369c5973 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 13 Sep 2021 13:49:05 -0700 Subject: [PATCH 03/19] Don't set NativeMachine variables when IsWow64Process2 is unavailable --- src/burn/engine/variable.cpp | 7 +++++-- src/ext/ca/wixca/dll/OsInfo.cpp | 5 ++++- src/libs/dutil/procutil.cpp | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/burn/engine/variable.cpp b/src/burn/engine/variable.cpp index 352a6892d..87403b90c 100644 --- a/src/burn/engine/variable.cpp +++ b/src/burn/engine/variable.cpp @@ -1820,8 +1820,11 @@ static HRESULT InitializeVariableNativeMachine( hr = ProcNativeMachine(::GetCurrentProcess(), &usNativeMachine); ExitOnFailure(hr, "Failed to get native machine value."); - hr = BVariantSetNumeric(pValue, usNativeMachine); - ExitOnFailure(hr, "Failed to set variant value."); + if (hr != S_FALSE) + { + hr = BVariantSetNumeric(pValue, usNativeMachine); + ExitOnFailure(hr, "Failed to set variant value."); + } LExit: return hr; diff --git a/src/ext/ca/wixca/dll/OsInfo.cpp b/src/ext/ca/wixca/dll/OsInfo.cpp index 38190f5c3..c174b0cf6 100644 --- a/src/ext/ca/wixca/dll/OsInfo.cpp +++ b/src/ext/ca/wixca/dll/OsInfo.cpp @@ -508,7 +508,10 @@ extern "C" UINT __stdcall WixQueryNativeMachine( hr = ::ProcNativeMachine(::GetCurrentProcess(), &usNativeMachine); ExitOnFailure(hr, "Failed to get native machine value."); - WcaSetIntProperty(L"WIX_NATIVE_MACHINE", usNativeMachine); + if (hr != S_FALSE) + { + WcaSetIntProperty(L"WIX_NATIVE_MACHINE", usNativeMachine); + } LExit: if (FAILED(hr)) diff --git a/src/libs/dutil/procutil.cpp b/src/libs/dutil/procutil.cpp index b05a226ae..56680e9de 100644 --- a/src/libs/dutil/procutil.cpp +++ b/src/libs/dutil/procutil.cpp @@ -112,7 +112,8 @@ extern "C" HRESULT DAPI ProcNativeMachine( __out USHORT* pusNativeMachine ) { - HRESULT hr = S_OK; + // S_FALSE will indicate that the method is not supported. + HRESULT hr = S_FALSE; typedef BOOL(WINAPI* LPFN_ISWOW64PROCESS2)(HANDLE, USHORT *, USHORT *); LPFN_ISWOW64PROCESS2 pfnIsWow64Process2 = (LPFN_ISWOW64PROCESS2)::GetProcAddress(::GetModuleHandleW(L"kernel32"), "IsWow64Process2"); @@ -124,6 +125,7 @@ extern "C" HRESULT DAPI ProcNativeMachine( { ExitWithLastError(hr, "Failed to check WOW64 process - IsWow64Process2."); } + hr = S_OK; } LExit: From 38c8293f766f2708b2ffd4983abe9d930153c8a1 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 14 Sep 2021 14:13:21 -0500 Subject: [PATCH 04/19] Update documentation that NativeMachine was added in v3.14. Also recommend NativeMachine over ProcessorArchitecture when available. Fix style nits. --- src/burn/engine/variable.cpp | 2 +- src/chm/documents/bundle/bundle_built_in_variables.html.md | 4 ++-- src/chm/documents/customactions/osinfo.html.md | 2 +- src/ext/UtilExtension/wixlib/UtilExtension_Platform.wxi | 2 +- src/ext/ca/wixca/dll/OsInfo.cpp | 7 +++++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/burn/engine/variable.cpp b/src/burn/engine/variable.cpp index 87403b90c..fa666a57b 100644 --- a/src/burn/engine/variable.cpp +++ b/src/burn/engine/variable.cpp @@ -1820,7 +1820,7 @@ static HRESULT InitializeVariableNativeMachine( hr = ProcNativeMachine(::GetCurrentProcess(), &usNativeMachine); ExitOnFailure(hr, "Failed to get native machine value."); - if (hr != S_FALSE) + if (S_FALSE != hr) { hr = BVariantSetNumeric(pValue, usNativeMachine); ExitOnFailure(hr, "Failed to set variant value."); diff --git a/src/chm/documents/bundle/bundle_built_in_variables.html.md b/src/chm/documents/bundle/bundle_built_in_variables.html.md index 5956fdb1a..9a9f93844 100644 --- a/src/chm/documents/bundle/bundle_built_in_variables.html.md +++ b/src/chm/documents/bundle/bundle_built_in_variables.html.md @@ -24,7 +24,7 @@ The Burn engine offers a set of commonly-used variables so you can use them with * LocalAppDataFolder - gets the well-known folder for CSIDL\_LOCAL\_APPDATA. * LogonUser - gets the current user name. * MyPicturesFolder - gets the well-known folder for CSIDL\_MYPICTURES. -* NativeMachine - gets the [Image File Machine value](https://docs.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants) representing the native architecture of the machine. This property is only set on Windows 10, version 1511 (TH2) and higher. +* NativeMachine - gets the [Image File Machine value](https://docs.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants) representing the native architecture of the machine. This variable was added in v3.14 and is only set on Windows 10, version 1511 (TH2) and higher. * NTProductType - numeric product type from OS version information. * NTSuiteBackOffice - non-zero if OS version suite is Back Office. * NTSuiteDataCenter - non-zero if OS version suite is Datacenter. @@ -34,7 +34,7 @@ The Burn engine offers a set of commonly-used variables so you can use them with * NTSuiteSmallBusinessRestricted - non-zero if OS version suite is Restricted Small Business. * NTSuiteWebServer - non-zero if OS version suite is Web Server. * PersonalFolder - gets the well-known folder for CSIDL\_PERSONAL. -* ProcessorArchitecture - gets the native [SYSTEM_INFO.wProcessorArchitecture](http://msdn.microsoft.com/en-us/library/windows/desktop/ms724958%28v=vs.85%29.aspx). +* ProcessorArchitecture - gets the value of [SYSTEM_INFO.wProcessorArchitecture](http://msdn.microsoft.com/en-us/library/windows/desktop/ms724958%28v=vs.85%29.aspx). If NativeMachine is available then it should be used instead because this value is not accurate when running in WOW. * Privileged - non-zero if the process could run elevated (on Vista+) or is running as an Administrator (on WinXP). * ProgramFilesFolder - gets the well-known folder for CSIDL\_PROGRAM\_FILESX86. * ProgramFiles64Folder - gets the well-known folder for CSIDL\_PROGRAM\_FILES. diff --git a/src/chm/documents/customactions/osinfo.html.md b/src/chm/documents/customactions/osinfo.html.md index 08cab09c4..d1aa06d86 100644 --- a/src/chm/documents/customactions/osinfo.html.md +++ b/src/chm/documents/customactions/osinfo.html.md @@ -559,7 +559,7 @@ WixUtilExtension will automatically schedule the custom actions as needed after -

Set to an [Image File Machine value](https://docs.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants) representing the native architecture of the machine. This property is only set on Windows 10, version 1511 (TH2) and higher.

+

Set to an [Image File Machine value](https://docs.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants) representing the native architecture of the machine. This property was added in v3.14 and is only set on Windows 10, version 1511 (TH2) and higher.

diff --git a/src/ext/UtilExtension/wixlib/UtilExtension_Platform.wxi b/src/ext/UtilExtension/wixlib/UtilExtension_Platform.wxi index d2b59bc77..2ca14208b 100644 --- a/src/ext/UtilExtension/wixlib/UtilExtension_Platform.wxi +++ b/src/ext/UtilExtension/wixlib/UtilExtension_Platform.wxi @@ -227,7 +227,7 @@ VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3)
- + diff --git a/src/ext/ca/wixca/dll/OsInfo.cpp b/src/ext/ca/wixca/dll/OsInfo.cpp index c174b0cf6..0ed92a055 100644 --- a/src/ext/ca/wixca/dll/OsInfo.cpp +++ b/src/ext/ca/wixca/dll/OsInfo.cpp @@ -505,16 +505,19 @@ extern "C" UINT __stdcall WixQueryNativeMachine( hr = WcaInitialize(hInstall, "WixQueryNativeMachine"); ExitOnFailure(hr, "WixQueryNativeMachine failed to initialize"); - hr = ::ProcNativeMachine(::GetCurrentProcess(), &usNativeMachine); + hr = ProcNativeMachine(::GetCurrentProcess(), &usNativeMachine); ExitOnFailure(hr, "Failed to get native machine value."); - if (hr != S_FALSE) + if (S_FALSE != hr) { WcaSetIntProperty(L"WIX_NATIVE_MACHINE", usNativeMachine); } LExit: if (FAILED(hr)) + { er = ERROR_INSTALL_FAILURE; + } + return WcaFinalize(er); } \ No newline at end of file From 74333b141a14ac7356b80788acf62b61da1fb287 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Sun, 25 Jul 2021 22:03:03 -0700 Subject: [PATCH 05/19] Correct sample for SetProperty/@Sequence Since the deferred custom action is scheduled only in `InstallExecuteSequence`, the `SetProperty/@Sequence` attribute must be set to "execute" since the default is "both". This leads to a LGHT0001 error about a missing `ActionRow` that can be difficult to diagnose. --- src/chm/documents/customactions/qtexec.html.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chm/documents/customactions/qtexec.html.md b/src/chm/documents/customactions/qtexec.html.md index a0e757955..37435f8a8 100644 --- a/src/chm/documents/customactions/qtexec.html.md +++ b/src/chm/documents/customactions/qtexec.html.md @@ -69,7 +69,7 @@ When the WixQuietExec (or WixSilentExec) action is run as a deferred custom acti If you need to set a command line that uses other Windows Installer properties, you must schedule an immediate custom action to set the command line property value and schedule a deferred custom action to run QtExec. The property Id used in the SetProperty custom action must match the Id value used in the deferred custom action. A common use of this pattern for QtExec custom actions is to run an executable that will be installed as a part of the setup. The following is an example of authoring a deferred QtExec custom action that relies on another property value: + Sequence="execute" Before="QtExecDeferredExampleWithProperty" /> . @@ -89,7 +89,7 @@ If you need to run a 64-bit executable, use the 64-bit aware QtExec. To use the . . + Before="QtExecDeferredExampleWithProperty" Sequence="execute" /> . From 9168791f7b2aaded9b97166498c90ee9f8e540af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilius=20=C5=A0umskas?= Date: Fri, 7 May 2021 01:50:56 +0300 Subject: [PATCH 06/19] Add Lithuanian translation for UtilExtension --- .../wixlib/UtilExtension.wixproj | 1 + src/ext/UtilExtension/wixlib/lt-lt.wxl | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/ext/UtilExtension/wixlib/lt-lt.wxl diff --git a/src/ext/UtilExtension/wixlib/UtilExtension.wixproj b/src/ext/UtilExtension/wixlib/UtilExtension.wixproj index 7f6509615..bf69485dd 100644 --- a/src/ext/UtilExtension/wixlib/UtilExtension.wixproj +++ b/src/ext/UtilExtension/wixlib/UtilExtension.wixproj @@ -21,6 +21,7 @@ + diff --git a/src/ext/UtilExtension/wixlib/lt-lt.wxl b/src/ext/UtilExtension/wixlib/lt-lt.wxl new file mode 100644 index 000000000..c0bfd37e3 --- /dev/null +++ b/src/ext/UtilExtension/wixlib/lt-lt.wxl @@ -0,0 +1,33 @@ + + + + + + Nepavyko sukurti vartotojo. ([2] [3] [4] [5]) + Vartotojo sukurti nepavyko, nes klaidingas slaptažodis. ([2] [3] [4] [5]) + Nepavyko pridėti vartotojo prie grupės. ([2] [3] [4] [5]) + Vartotojo sukurti nepavyko, nes toks vartotojas jau egzistuoja. ([2] [3] [4] [5]) + + Nepavyko sukurti tinklo prieigos resurso. ([2] [3] [4] [5]) + Nepavyko ištrinti tinklo prieigos resurso. ([2] [3] [4] [5]) + + Nepavyko užregistruoti DLL failo į PerfMon tarnybą. ([2] [3] [4] [5]) + Nepavyko išregistruoti DLL failo iš PerfMon tarnybos. ([2] [3] [4] [5]) + + Nepavyko įdiegti našumo stebėjimo skaitliukų. ([2] [3] [4] [5]) + Nepavyko išdiegti našumo stebėjimo skaitliukų. ([2] [3] [4] [5]) + + Nepavyko sukurti [3]\[4] saugos aprašo. Sistemos klaida: [2] + Nepavyko nustatyti objekto [3] saugos aprašo. Sistemos klaida: [2] + Nežinomas objekto tipas [3]. Sistemos klaida: [2] + + Klaida konfigūruojant XML failus. + Nepavyko atidaryti XML failo [3]. Sistemos klaida: [2] + XML faile [4] nepavyko rasti [3] elemento. Sistemos klaida: [2] + Nepavyko išsaugoti pakeitimų į XML failą [3]. Sistemos klaida: [2] + + Klaida konfigūruojant XML failus. + Nepavyko atidaryti XML failo [3]. Sistemos klaida: [2] + XML faile [4] nepavyko rasti [3] elemento. Sistemos klaida: [2] + Nepavyko išsaugoti pakeitimų į XML failą [3]. Sistemos klaida: [2] + From 45a94434084b5fc98e99f86b1479be848e624e20 Mon Sep 17 00:00:00 2001 From: WixBuild Date: Tue, 21 Sep 2021 08:53:28 -0700 Subject: [PATCH 07/19] WixBuild: Version 3.14.0.5721 --- History.md | 16 ++++++++++++++++ history/5575.md | 1 - history/6143.md | 3 --- history/6299.md | 1 - history/6469.md | 1 - history/netfx-packages.md | 3 --- 6 files changed, 16 insertions(+), 9 deletions(-) delete mode 100644 history/5575.md delete mode 100644 history/6143.md delete mode 100644 history/6299.md delete mode 100644 history/6469.md delete mode 100644 history/netfx-packages.md diff --git a/History.md b/History.md index c360922ac..a5502ec7d 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,19 @@ +## WixBuild: Version 3.14.0.5721 + +* BobArnso: WIXFEAT:6469 - Drop XP support for v3.14 => v4 transition. + +* BobArnson: Fix WixStdBA null-reference crash. + +* BobArnson: WIXBUG:6143 - Correct Payload/@SuppressSignatureVerification doc. + +* SeanHall: WIXBUG:6299 - Fix OverflowException in ReadUInt32. + +* SeanHall: WIXFEAT:5575 - Add .NET 4.7 and 4.7.1 MSI properties to NetFxExtension. + +* SeanHall: WIXFEAT:5575 - Add .NET 4.7.2 to NetFxExtension. + +* SeanHall: WIXFEAT:5977 - Add .NET 4.8 to NetFxExtension. + ## WixBuild: Version 3.14.0.4118 * SeanHall: WIXBUG:4342 - Fix WixStdBA hang with DisplayInternalUI when pressing the BA cancel button. diff --git a/history/5575.md b/history/5575.md deleted file mode 100644 index b2152a39b..000000000 --- a/history/5575.md +++ /dev/null @@ -1 +0,0 @@ -* SeanHall: WIXFEAT:5575 - Add .NET 4.7 and 4.7.1 MSI properties to NetFxExtension. \ No newline at end of file diff --git a/history/6143.md b/history/6143.md deleted file mode 100644 index df8423186..000000000 --- a/history/6143.md +++ /dev/null @@ -1,3 +0,0 @@ -* BobArnson: Fix WixStdBA null-reference crash. - -* BobArnson: WIXBUG:6143 - Correct Payload/@SuppressSignatureVerification doc. diff --git a/history/6299.md b/history/6299.md deleted file mode 100644 index a749994ce..000000000 --- a/history/6299.md +++ /dev/null @@ -1 +0,0 @@ -* SeanHall: WIXBUG:6299 - Fix OverflowException in ReadUInt32. \ No newline at end of file diff --git a/history/6469.md b/history/6469.md deleted file mode 100644 index 43261913c..000000000 --- a/history/6469.md +++ /dev/null @@ -1 +0,0 @@ -* BobArnso: WIXFEAT:6469 - Drop XP support for v3.14 => v4 transition. diff --git a/history/netfx-packages.md b/history/netfx-packages.md deleted file mode 100644 index 9eef6ee0f..000000000 --- a/history/netfx-packages.md +++ /dev/null @@ -1,3 +0,0 @@ -* SeanHall: WIXFEAT:5575 - Add .NET 4.7.2 to NetFxExtension. - -* SeanHall: WIXFEAT:5977 - Add .NET 4.8 to NetFxExtension. \ No newline at end of file From 03d9a66371d21906748cce2b5f40d25a0c34cd1f Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 10 Sep 2021 16:03:49 -0500 Subject: [PATCH 08/19] Update NetFx package groups for their SHA2 updates. --- .../customactions/wixnetfxextension.html.md | 64 --------- src/ext/NetFxExtension/wixlib/NetFx4.5.wxs | 74 ---------- src/ext/NetFxExtension/wixlib/NetFx4.wxs | 129 ------------------ src/ext/NetFxExtension/wixlib/NetFx451.wxs | 74 ---------- src/ext/NetFxExtension/wixlib/NetFx462.wxs | 22 +-- src/ext/NetFxExtension/wixlib/NetFx472.wxs | 16 +-- src/ext/NetFxExtension/wixlib/NetFx48.wxs | 18 +-- 7 files changed, 28 insertions(+), 369 deletions(-) diff --git a/src/chm/documents/customactions/wixnetfxextension.html.md b/src/chm/documents/customactions/wixnetfxextension.html.md index af636b9f2..5de1fd6b2 100644 --- a/src/chm/documents/customactions/wixnetfxextension.html.md +++ b/src/chm/documents/customactions/wixnetfxextension.html.md @@ -20,70 +20,6 @@ The WixNetfxExtension includes package groups that make it easier to include .NE

Description

- - -

NetFx40Web

- - -

.Net Framework 4.0 Full web setup.

- - - - -

NetFx40Redist

- - -

.Net Framework 4.0 Full standalone setup.

- - - - -

NetFx40ClientWeb

- - -

.Net Framework 4.0 Client Profile web setup.

- - - - -

NetFx40ClientRedist

- - -

.Net Framework 4.0 Client Profile standalone setup.

- - - - -

NetFx45Web

- - -

.Net Framework 4.5 web setup.

- - - - -

NetFx45Redist

- - -

.Net Framework 4.5 standalone setup.

- - - - -

NetFx451Web

- - -

.Net Framework 4.5.1 web setup.

- - - - -

NetFx451Redist

- - -

.Net Framework 4.5.1 standalone setup.

- -

NetFx452Web

diff --git a/src/ext/NetFxExtension/wixlib/NetFx4.5.wxs b/src/ext/NetFxExtension/wixlib/NetFx4.5.wxs index e3a318098..a0225ae3f 100644 --- a/src/ext/NetFxExtension/wixlib/NetFx4.5.wxs +++ b/src/ext/NetFxExtension/wixlib/NetFx4.5.wxs @@ -34,80 +34,6 @@ Value="Release" Result="value" />
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ext/NetFxExtension/wixlib/NetFx4.wxs b/src/ext/NetFxExtension/wixlib/NetFx4.wxs index e55e714bd..4b88efd97 100644 --- a/src/ext/NetFxExtension/wixlib/NetFx4.wxs +++ b/src/ext/NetFxExtension/wixlib/NetFx4.wxs @@ -36,70 +36,6 @@ Result="value" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ext/NetFxExtension/wixlib/NetFx451.wxs b/src/ext/NetFxExtension/wixlib/NetFx451.wxs index d35c63296..e27685642 100644 --- a/src/ext/NetFxExtension/wixlib/NetFx451.wxs +++ b/src/ext/NetFxExtension/wixlib/NetFx451.wxs @@ -24,78 +24,4 @@ WIXNETFX4RELEASEINSTALLED >= "#$(var.NetFx451MinRelease)" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ext/NetFxExtension/wixlib/NetFx462.wxs b/src/ext/NetFxExtension/wixlib/NetFx462.wxs index 1815ae12f..d857ff85f 100644 --- a/src/ext/NetFxExtension/wixlib/NetFx462.wxs +++ b/src/ext/NetFxExtension/wixlib/NetFx462.wxs @@ -12,9 +12,9 @@ --> - - - + + + @@ -50,12 +50,12 @@ Compressed="no" Name="!(wix.NetFx462WebPackageDirectory)NDP462-KB3151802-Web.exe"> @@ -87,12 +87,12 @@ Compressed="no" Name="!(wix.NetFx462RedistPackageDirectory)NDP462-KB3151800-x86-x64-AllOS-ENU.exe"> diff --git a/src/ext/NetFxExtension/wixlib/NetFx472.wxs b/src/ext/NetFxExtension/wixlib/NetFx472.wxs index 3ba6bd6b6..d73db189f 100644 --- a/src/ext/NetFxExtension/wixlib/NetFx472.wxs +++ b/src/ext/NetFxExtension/wixlib/NetFx472.wxs @@ -50,12 +50,12 @@ Compressed="no" Name="!(wix.NetFx472WebPackageDirectory)NDP472-KB4054531-Web.exe"> @@ -87,12 +87,12 @@ Compressed="no" Name="!(wix.NetFx472RedistPackageDirectory)NDP472-KB4054530-x86-x64-AllOS-ENU.exe"> diff --git a/src/ext/NetFxExtension/wixlib/NetFx48.wxs b/src/ext/NetFxExtension/wixlib/NetFx48.wxs index 92ad63652..af646a9b2 100644 --- a/src/ext/NetFxExtension/wixlib/NetFx48.wxs +++ b/src/ext/NetFxExtension/wixlib/NetFx48.wxs @@ -50,13 +50,13 @@ Compressed="no" Name="!(wix.NetFx48WebPackageDirectory)ndp48-web.exe"> + Size="1439328" + Version="4.8.4115.0" /> @@ -87,13 +87,13 @@ Compressed="no" Name="!(wix.NetFx48RedistPackageDirectory)ndp48-x86-x64-allos-enu.exe"> + Version="4.8.4115.0" /> From 19030abcd8e0a7fea111422a92875f7ac35d7f64 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 10 Sep 2021 15:16:42 -0500 Subject: [PATCH 09/19] Fix building bundles on FIPS-enabled machines. --- src/tools/wix/Common.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/wix/Common.cs b/src/tools/wix/Common.cs index d1f37ae0a..c9d759e21 100644 --- a/src/tools/wix/Common.cs +++ b/src/tools/wix/Common.cs @@ -458,7 +458,7 @@ private static void RecursiveFileAttributes(string path, FileAttributes fileAttr internal static string GetFileHash(FileInfo fileInfo) { byte[] hashBytes; - using (SHA1Managed managed = new SHA1Managed()) + using (SHA1 managed = new SHA1CryptoServiceProvider()) { using (FileStream stream = fileInfo.OpenRead()) { From c02e48ec301a60eba88a3b519d47e88eeaa4c978 Mon Sep 17 00:00:00 2001 From: WixBuild Date: Wed, 22 Sep 2021 09:05:36 -0700 Subject: [PATCH 10/19] WixBuild: Version 3.14.0.5722 --- History.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/History.md b/History.md index a5502ec7d..3327d95e3 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,5 @@ +## WixBuild: Version 3.14.0.5722 + ## WixBuild: Version 3.14.0.5721 * BobArnso: WIXFEAT:6469 - Drop XP support for v3.14 => v4 transition. From b496a8fdc2979c9a8e70edd3a47f2e98fc178e9e Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 18 Oct 2021 06:56:01 -0700 Subject: [PATCH 11/19] Add CLA Bot as workflow --- .github/workflows/cla.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/cla.yml diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml new file mode 100644 index 000000000..818fdcf34 --- /dev/null +++ b/.github/workflows/cla.yml @@ -0,0 +1,22 @@ +name: "CLA-Bot" +on: + issue_comment: + types: [created] + pull_request_target: + types: [ opened, closed, synchronize ] + +jobs: + CLAssistant: + runs-on: ubuntu-latest + steps: + - name: "CLA-Bot signature check" + if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' + uses: cla-assistant/github-action@v2.1.3-beta + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PERSONAL_ACCESS_TOKEN : ${{ secrets.CLA_BOT_ACCESS_TOKEN }} + with: + remote-repository-name: Home + path-to-signatures: '.github/signatures/cla.json' + path-to-document: 'https://github.com/wixtoolset/Home/blob/master/DNFCLA.md' + allowlist: wixbot From 9871b1061484ea2d8d1a0e4ea08ae6ce5f064c71 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 19 Mar 2022 20:06:30 -0400 Subject: [PATCH 12/19] VS2022 support --- .../customactions/wixvsextension.html.md | 151 +++++++++++++++++- src/ext/VSExtension/ca/vsca.cpp | 81 ++++++++++ src/ext/VSExtension/wixlib/VS2022.wxs | 143 +++++++++++++++++ .../VSExtension/wixlib/VSExtension.wixproj | 1 + 4 files changed, 375 insertions(+), 1 deletion(-) create mode 100644 src/ext/VSExtension/wixlib/VS2022.wxs diff --git a/src/chm/documents/customactions/wixvsextension.html.md b/src/chm/documents/customactions/wixvsextension.html.md index 136fec5e5..995ad2ca2 100644 --- a/src/chm/documents/customactions/wixvsextension.html.md +++ b/src/chm/documents/customactions/wixvsextension.html.md @@ -17,6 +17,7 @@ The [WixVSExtension](~/xsd/vs/index.html) includes a set of custom actions to ma * [Visual Studio 2015](#vs2015properties) * [Visual Studio 2017](#vs2017properties) * [Visual Studio 2019](#vs2019properties) + * [Visual Studio 2022](#vs2022properties) * [Custom Actions](#allcustomactions) ## Properties @@ -1237,7 +1238,7 @@ Here is a complete list of properties for the **Visua -Here is a complete list of properties for the **Visual Studio 2019** product family: +Here is a complete list of properties for the **Visual Studio 2019** product family: @@ -1370,6 +1371,138 @@ Here is a complete list of properties for the **Visua
+Here is a complete list of properties for the **Visual Studio 2022** product family: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Property name

+
+

Meaning

+
+

VS2022DEVENV

+
+

Full path to devenv.exe for Visual Studio 2022 if it is installed on the system. This property is available starting with WiX v3.14.

+
+

VS2022_EXTENSIONS_DIR

+
+

Full path to the Visual Studio 2022 extensions directory. This property is available starting with WiX v3.14.

+
+

VS2022_ITEMTEMPLATES_DIR

+
+

Full path to the Visual Studio 2022 item templates directory. This property is available starting with WiX v3.14.

+
+

VS2022_PROJECTTEMPLATES_DIR

+
+

Full path to the Visual Studio 2022 project templates directory. This property is available starting with WiX v3.14.

+
+

VS2022_SCHEMAS_DIR

+
+

Full path to the Visual Studio 2022 XML schemas directory. This property is available starting with WiX v3.14.

+
+

VS2022_ROOT_FOLDER

+
+

Full path to the Visual Studio 2022 root installation directory. This property is available starting with WiX v3.14.

+
+

VS2022_IDE_DIR

+
+

Full path to the Visual Studio 2022 directory containing devenv.exe. This property is available starting with WiX v3.14.

+
+

VS2022_IDE_VB_PROJECTSYSTEM_INSTALLED

+
+

Indicates whether Visual Studio 2022 Professional Edition or higher is installed and the Visual Basic project system is installed for it. This property is available starting with WiX v3.14.

+
+

VS2022_IDE_VC_PROJECTSYSTEM_INSTALLED

+
+

Indicates whether Visual Studio 2022 Professional Edition or higher is installed and the Visual C++ project system is installed for it. This property is available starting with WiX v3.14.

+
+

VS2022_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED

+
+

Indicates whether Visual Studio 2022 Professional Edition or higher is installed and the Visual C# project system is installed for it. This property is available starting with WiX v3.14.

+
+

VS2022_IDE_VWD_PROJECTSYSTEM_INSTALLED

+
+

Indicates whether Visual Studio 2022 Professional Edition or higher is installed and the Visual Web Developer project system is installed for it. This property is available starting with WiX v3.14.

+
+

VS2022_IDE_VSTS_TESTSYSTEM_INSTALLED

+
+

Indicates whether or not the Visual Studio 2022 Team Test project system is installed on the system. This property is available starting with WiX v3.14.

+
+

VS2022_IDE_MODELING_PROJECTSYSTEM_INSTALLED

+
+

Indicates whether or not the Visual Studio 2022 Modeling project system is installed on the system. This property is available starting with WiX v3.14.

+
+

VS2022_IDE_FSHARP_PROJECTSYSTEM_INSTALLED

+
+

Indicates whether or not the Visual Studio 2022 F# project system is installed on the system. This property is available starting with WiX v3.14.

+
+

VS2022_BOOTSTRAPPER_PACKAGE_FOLDER

+
+

The location of the Visual Studio 2022 bootstrapper package folder. This property is available starting with WiX v3.14.

+
## Custom Actions Here is a complete list of custom actions: @@ -1855,6 +1988,22 @@ Here is a complete list of custom actions:

Runs devenv.exe /InstallVSTemplates if Visual Studio 2019 Community Edition or higher is found on the system. Including this custom action automatically adds the VS2019DEVENV property. This custom action is available starting with WiX v3.14.

+ + +

VS2022Setup

+ + +

Runs devenv.exe /setup if Visual Studio 2022 Community Edition or higher is found on the system. Including this custom action automatically adds the VS2022DEVENV property. This custom action is available starting with WiX v3.14.

+ + + + +

VS2022InstallVSTemplates

+ + +

Runs devenv.exe /InstallVSTemplates if Visual Studio 2022 Community Edition or higher is found on the system. Including this custom action automatically adds the VS2022DEVENV property. This custom action is available starting with WiX v3.14.

+ + ## Using WixVSExtension Properties or Custom Actions diff --git a/src/ext/VSExtension/ca/vsca.cpp b/src/ext/VSExtension/ca/vsca.cpp index 54a54a347..d246c3247 100644 --- a/src/ext/VSExtension/ca/vsca.cpp +++ b/src/ext/VSExtension/ca/vsca.cpp @@ -53,6 +53,12 @@ static HRESULT ProcessVS2019( __in BOOL fComplete ); +static HRESULT ProcessVS2022( + __in_opt ISetupInstance* pInstance, + __in DWORD64 qwVersion, + __in BOOL fComplete +); + static HRESULT SetPropertyForComponent( __in DWORD cComponents, __in VS_COMPONENT_PROPERTY* rgComponents, @@ -63,6 +69,7 @@ static VS_INSTANCE vrgInstances[] = { { FILEMAKEVERSION(15, 0, 0, 0), FILEMAKEVERSION(15, 0xffff, 0xffff, 0xffff), ProcessVS2017 }, { FILEMAKEVERSION(16, 0, 0, 0), FILEMAKEVERSION(16, 0xffff, 0xffff, 0xffff), ProcessVS2019 }, + { FILEMAKEVERSION(17, 0, 0, 0), FILEMAKEVERSION(17, 0xffff, 0xffff, 0xffff), ProcessVS2022 }, }; /****************************************************************** @@ -485,6 +492,80 @@ static HRESULT ProcessVS2019( return hr; } +static HRESULT ProcessVS2022( + __in_opt ISetupInstance* pInstance, + __in DWORD64 qwVersion, + __in BOOL fComplete +) +{ + static ISetupInstance* pLatest = NULL; + static DWORD64 qwLatest = 0; + + static LPCWSTR rgwzProducts[] = + { + L"Microsoft.VisualStudio.Product.Community", + L"Microsoft.VisualStudio.Product.Professional", + L"Microsoft.VisualStudio.Product.Enterprise", + }; + + // TODO: Consider making table-driven with these defaults per-version for easy customization. + static VS_COMPONENT_PROPERTY rgComponents[] = + { + { L"Microsoft.VisualStudio.Component.FSharp", L"VS2022_IDE_FSHARP_PROJECTSYSTEM_INSTALLED" }, + { L"Microsoft.VisualStudio.Component.Roslyn.LanguageServices", L"VS2022_IDE_VB_PROJECTSYSTEM_INSTALLED" }, + { L"Microsoft.VisualStudio.Component.Roslyn.LanguageServices", L"VS2022_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" }, + { L"Microsoft.VisualStudio.PackageGroup.TestTools.Core", L"VS2022_IDE_VSTS_TESTSYSTEM_INSTALLED" }, + { L"Microsoft.VisualStudio.Component.VC.CoreIde", L"VS2022_IDE_VC_PROJECTSYSTEM_INSTALLED" }, + { L"Microsoft.VisualStudio.Component.Web", L"VS2022_IDE_VWD_PROJECTSYSTEM_INSTALLED" }, + { L"Microsoft.VisualStudio.PackageGroup.DslRuntime", L"VS2022_IDE_MODELING_PROJECTSYSTEM_INSTALLED" }, + }; + + HRESULT hr = S_OK; + + if (fComplete) + { + if (pLatest) + { + hr = ProcessInstance(pLatest, L"VS2022_ROOT_FOLDER", countof(rgComponents), rgComponents); + ExitOnFailure(hr, "Failed to process VS2022 instance."); + } + } + else if (pInstance) + { + hr = InstanceInProducts(pInstance, countof(rgwzProducts), rgwzProducts); + ExitOnFailure(hr, "Failed to compare product IDs."); + + if (S_FALSE == hr) + { + ExitFunction(); + } + + hr = InstanceIsGreater(pLatest, qwLatest, pInstance, qwVersion); + ExitOnFailure(hr, "Failed to compare instances."); + + if (S_FALSE == hr) + { + ExitFunction(); + } + + ReleaseNullObject(pLatest); + + pLatest = pInstance; + qwLatest = qwVersion; + + // Caller will do a final Release() otherwise. + pLatest->AddRef(); + } + +LExit: + if (fComplete) + { + ReleaseObject(pLatest); + } + + return hr; +} + static HRESULT SetPropertyForComponent( __in DWORD cComponents, __in VS_COMPONENT_PROPERTY* rgComponents, diff --git a/src/ext/VSExtension/wixlib/VS2022.wxs b/src/ext/VSExtension/wixlib/VS2022.wxs new file mode 100644 index 000000000..d5c40bba5 --- /dev/null +++ b/src/ext/VSExtension/wixlib/VS2022.wxs @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VS2022DEVENV + + + + + + + + + VS2022DEVENV + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ext/VSExtension/wixlib/VSExtension.wixproj b/src/ext/VSExtension/wixlib/VSExtension.wixproj index 9615a2ec8..6d7916897 100644 --- a/src/ext/VSExtension/wixlib/VSExtension.wixproj +++ b/src/ext/VSExtension/wixlib/VSExtension.wixproj @@ -25,6 +25,7 @@ + From 2a0077bd1bfa8c0c4c60460c1b15962293aac4fd Mon Sep 17 00:00:00 2001 From: Evan Zhou Date: Tue, 16 Mar 2021 09:34:52 -0400 Subject: [PATCH 13/19] added zh-cn.wxl into WixUtilExtension.dll --- .../wixlib/UtilExtension.wixproj | 1 + src/ext/UtilExtension/wixlib/zh-cn.wxl | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/ext/UtilExtension/wixlib/zh-cn.wxl diff --git a/src/ext/UtilExtension/wixlib/UtilExtension.wixproj b/src/ext/UtilExtension/wixlib/UtilExtension.wixproj index bf69485dd..33513e6c1 100644 --- a/src/ext/UtilExtension/wixlib/UtilExtension.wixproj +++ b/src/ext/UtilExtension/wixlib/UtilExtension.wixproj @@ -25,6 +25,7 @@ + diff --git a/src/ext/UtilExtension/wixlib/zh-cn.wxl b/src/ext/UtilExtension/wixlib/zh-cn.wxl new file mode 100644 index 000000000..4926c0665 --- /dev/null +++ b/src/ext/UtilExtension/wixlib/zh-cn.wxl @@ -0,0 +1,33 @@ + + + + + + 无法创建用户。 ([2] [3] [4] [5]) + 由于密码错误无法创建用户。 ([2] [3] [4] [5]) + 无法在组中添加用户。 ([2] [3] [4] [5]) + 无法创建已经存在的用户。 ([2] [3] [4] [5]) + + 无法创建网络分享。 ([2] [3] [4] [5]) + 无法关闭网络分享。 ([2] [3] [4] [5]) + + 无法使用PerfMon注册DLL。 ([2] [3] [4] [5]) + 无法使用PerfMon删除DLL注册。 ([2] [3] [4] [5]) + + 无法安装性能计数器。 ([2] [3] [4] [5]) + 无法卸载性能计数器。 ([2] [3] [4] [5]) + + 无法为 [3]\[4] 创建安全描述符,系统错误: [2] + 无法在对象 [3] 上设置安全描述符, 系统错误: [2] + 未知对象类型 [3],系统错误: [2] + + 在读取XML文件时发生一个错误。 + 无法打开XML文件 [3],系统错误: [2] + 在XML文件 [4] 中查找结点 [3] 时发生错误,系统错误: [2] + 无法保存XML文件 [3], 系统错误: [2] + + 在配置XML文件时发生一个错误。 + 无法打开XML文件 [3],系统错误: [2] + 在XML文件 [4] 中查找结点 [3] 时发生错误,系统错误: [2] + 无法保存XML文件 [3], 系统错误: [2] + From cb516f2430b1dfe179775a88850c2549c65de7f0 Mon Sep 17 00:00:00 2001 From: Herrum Date: Mon, 4 Apr 2022 04:10:45 +0200 Subject: [PATCH 14/19] Added Dutch translation for UtilExtension. (#541) --- .../wixlib/UtilExtension.wixproj | 5 +-- src/ext/UtilExtension/wixlib/nl-nl.wxl | 33 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/ext/UtilExtension/wixlib/nl-nl.wxl diff --git a/src/ext/UtilExtension/wixlib/UtilExtension.wixproj b/src/ext/UtilExtension/wixlib/UtilExtension.wixproj index 33513e6c1..b9dcb60ed 100644 --- a/src/ext/UtilExtension/wixlib/UtilExtension.wixproj +++ b/src/ext/UtilExtension/wixlib/UtilExtension.wixproj @@ -22,10 +22,11 @@ + - - + + diff --git a/src/ext/UtilExtension/wixlib/nl-nl.wxl b/src/ext/UtilExtension/wixlib/nl-nl.wxl new file mode 100644 index 000000000..742b3717e --- /dev/null +++ b/src/ext/UtilExtension/wixlib/nl-nl.wxl @@ -0,0 +1,33 @@ + + + + + + De gebruiker kon niet worden aangemaakt. ([2] [3] [4] [5]) + De gebruiker kon niet worden aangemaakt vanwege een ongeldig wachtwoord. ([2] [3] [4] [5]) + De gebruikersgroep kon niet worden toegevoegd. ([2] [3] [4] [5]) + De gebruiker kon niet worden aangemaakt omdat hij al bestond. ([2] [3] [4] [5]) + + Netwerk delen kon niet worden aangemaakt. ([2] [3] [4] [5]) + Netwerk delen kon niet worden verwijderd. ([2] [3] [4] [5]) + + De DLL kon niet worden geregistreerd bij PerfMon. ([2] [3] [4] [5]) + De DLL kon niet worden gederegistreerd bij PerfMon. ([2] [3] [4] [5]) + + De performance tellers konden niet worden geïnstalleerd. ([2] [3] [4] [5]) + De performance tellers konden niet worden gedeïnstalleerd. ([2] [3] [4] [5]) + + De beveiligingsbeschrijver voor [3]\[4] kon niet worden gecreëerd, systeemfout: [2] + De beveiligingsbeschrijver voor object [3] kon niet worden ingesteld, systeemfout: [2] + Onbekend Objectstype [3], systeemfout: [2] + + Er trad een fout op bij het lezen van XML-bestanden. + XML-bestand [3] kon niet worden geopend, systeemfout: [2] + Node [3] kon niet worden gevonden in XML-bestand: [4], systeemfout: [2] + Bij het opslaan van veranderingen in XML-bestand [3] trad een fout op, systeemfout: [2] + + Bij het configureren van XML-bestanden trad een fout op. + XML-bestand [3] kon niet worden geopend, systeemfout: [2] + Node [3] kon niet worden gevonden in XML-bestand: [4], systeemfout: [2] + Bij het opslaan van veranderingen in XML-bestand [3] trad een fout op, systeemfout: [2] + \ No newline at end of file From 6b461364c40e6d1c487043cd0eae7c1a3d15968c Mon Sep 17 00:00:00 2001 From: WixBuild Date: Thu, 26 May 2022 08:29:17 -0700 Subject: [PATCH 15/19] WixBuild: Version 3.14.0.6526 --- History.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/History.md b/History.md index 3327d95e3..d89aa6516 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,5 @@ +## WixBuild: Version 3.14.0.6526 + ## WixBuild: Version 3.14.0.5722 ## WixBuild: Version 3.14.0.5721 From c5117b58502cace193732a6ba9204b68e2411355 Mon Sep 17 00:00:00 2001 From: Ben Walding Date: Wed, 16 Nov 2022 11:53:10 +1000 Subject: [PATCH 16/19] Update links (#548) * Update links It's an older code but it checks out. * Tweak URLs Co-authored-by: Bob Arnson --- Readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index b8e3a160b..5bc40b3e9 100644 --- a/Readme.md +++ b/Readme.md @@ -1,8 +1,8 @@ # WiX Toolset on GitHub The WiX Toolset builds Windows installation packages from XML source code. The toolset supports a command-line environment that developers may integrate into their build processes to build Windows Installer (MSI) packages and executable bundles. The WiX GitHub project hosts the WiX source code Git repositories. The following links will take you to more details: -## [Home page](http://wixtoolset.org/ "WiX Toolset home page") -## [Releases](http://wixtoolset.org/releases/ "WiX Toolset stable and weekly releases") -## [Bugs and feature requests](http://wixtoolset.org/bugs/ "Files bugs and feature requests for WiX Toolset") -## [Manual](http://wixtoolset.org/documentation/manual/ "WiX Toolset manuals and documentation links") -## [Hacking on WiX](http://wixtoolset.org/development/ "About development on the WiX Toolset") +## [Home page](https://wixtoolset.org/ "WiX Toolset home page") +## [Releases](https://wixtoolset.org/docs/wix3/ "WiX Toolset stable and weekly releases") +## [Bugs and feature requests](https://wixtoolset.org/docs/gethelp/ "Files bugs and feature requests for WiX Toolset") +## [Manual](https://wixtoolset.org/docs/v3/ "WiX Toolset manuals and documentation links") +## [Hacking on WiX](https://wixtoolset.org/docs/development/ "About development on the WiX Toolset") From 5eaf0dfdcc3648dc6b3ea407f78d75bb2c9dc52a Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 24 Jan 2024 17:38:55 -0500 Subject: [PATCH 17/19] Mitigate .local DLL redirection Windows bug. --- src/burn/stub/Stub.vcxproj | 3 ++- src/burn/stub/precomp.h | 1 + src/burn/stub/stub.cpp | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/burn/stub/Stub.vcxproj b/src/burn/stub/Stub.vcxproj index d8cc80b58..4a071384b 100644 --- a/src/burn/stub/Stub.vcxproj +++ b/src/burn/stub/Stub.vcxproj @@ -42,6 +42,7 @@ true true cabinet.dll;crypt32.dll;msi.dll;shlwapi.dll;version.dll;wininet.dll;wintrust.dll + /DEPENDENTLOADFLAG:0x800 %(AdditionalOptions) @@ -82,7 +83,7 @@ Outputs="$(OutputPath)$(NormalizedPlatform)\$(TargetName).exe"> - diff --git a/src/burn/stub/precomp.h b/src/burn/stub/precomp.h index 387d4f0fd..91e76109d 100644 --- a/src/burn/stub/precomp.h +++ b/src/burn/stub/precomp.h @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/src/burn/stub/stub.cpp b/src/burn/stub/stub.cpp index 923765d49..ba38f3ccd 100644 --- a/src/burn/stub/stub.cpp +++ b/src/burn/stub/stub.cpp @@ -2,6 +2,10 @@ #include "precomp.h" +static const HRESULT E_SUSPECTED_TAMPERING = MAKE_HRESULT(SEVERITY_ERROR, 500/*FACILITY_WIX*/, 2001); + +static void AvoidLocalDllRedirection(LPCWSTR wzPath); + int WINAPI wWinMain( __in HINSTANCE hInstance, @@ -53,6 +57,8 @@ int WINAPI wWinMain( AppInitialize(rgsczSafelyLoadSystemDlls, countof(rgsczSafelyLoadSystemDlls)); } + AvoidLocalDllRedirection(sczPath); + // call run hr = EngineRun(hInstance, hEngineFile, lpCmdLine, nCmdShow, &dwExitCode); ExitOnFailure(hr, "Failed to run application."); @@ -63,3 +69,23 @@ int WINAPI wWinMain( return FAILED(hr) ? (int)hr : (int)dwExitCode; } + +static void AvoidLocalDllRedirection(LPCWSTR wzPath) +{ + LPWSTR sczLocalPath = NULL; + HMODULE hmodComCtl = NULL; + + // Bail if there's a .exe.local directory, as it's a feature of + // DLL redirection that has no real use for a bundle and is a hole for + // DLL hijacking attacks. + + if (FAILED(StrAllocFormatted(&sczLocalPath, L"%ls.local", wzPath)) + || DirExists(sczLocalPath, NULL) + || FileExistsEx(sczLocalPath, NULL) + || FAILED(LoadSystemLibrary(L"Comctl32.dll", &hmodComCtl))) + { + ::ExitProcess((UINT)E_SUSPECTED_TAMPERING); + } + + ReleaseStr(sczLocalPath); +} From ea94ed02e4597b6a1f841f31e8e48eba12640277 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 28 Jan 2024 13:29:06 -0800 Subject: [PATCH 18/19] Modernize signing infrastructure --- tools/Dotnet.targets | 60 ---------------------------------- tools/WixBuild.Signing.targets | 40 +++++++++++------------ tools/WixBuild.Tools.targets | 8 ++--- tools/WixBuild.props | 1 - 4 files changed, 24 insertions(+), 85 deletions(-) delete mode 100644 tools/Dotnet.targets diff --git a/tools/Dotnet.targets b/tools/Dotnet.targets deleted file mode 100644 index aa378082d..000000000 --- a/tools/Dotnet.targets +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\)) - $(WixRoot)packages\tools\ - $(ProgramW6432)\dotnet\dotnet.exe - $(MSBuildProgramFiles32)\dotnet\dotnet.exe - - - - $(DotnetToolsFolder)SignClient.exe - - - - - - 1.1.7 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - diff --git a/tools/WixBuild.Signing.targets b/tools/WixBuild.Signing.targets index e008147e0..ff79b54b3 100644 --- a/tools/WixBuild.Signing.targets +++ b/tools/WixBuild.Signing.targets @@ -2,15 +2,12 @@ - - - - + - <_SigningAppSettingsPath>$(MSBuildThisFileDirectory)appsettings.json - <_SigningFilterNonePath>$(MSBuildThisFileDirectory)signing-filter.none.txt - <_SigningName>WiX Toolset - <_SigningUrl>http://wixtoolset.org + $(WIX_ROOT).tools\sign.exe + code azure-key-vault + $(MSBuildThisFileDirectory)signing-filter.none.txt + --description "WiX Toolset" --description-url "https://wixtoolset.org/" --timestamp-url "http://timestamp.digicert.com" --file-list "$(SigningFilelist)" --azure-key-vault-url $(SigningKeyVaultUri) --azure-key-vault-tenant-id $(SigningTenantId) --azure-key-vault-client-id $(SigningClientId) --azure-key-vault-client-secret $(SigningClientSecret) --azure-key-vault-certificate $(SigningCertName) @@ -19,7 +16,10 @@ - + + + - - - + - - - + - - - + - + + + - + + + diff --git a/tools/WixBuild.Tools.targets b/tools/WixBuild.Tools.targets index 99ae4b800..1c71325f0 100644 --- a/tools/WixBuild.Tools.targets +++ b/tools/WixBuild.Tools.targets @@ -125,13 +125,13 @@ + Condition=" '$(PleaseSignOutput)'!='' and !Exists('$(SigningToolExe)') " + Text="Cannot locate SigningTool. Ensure SigningTool is present at "$(SigningToolExe)"." /> + Condition=" '$(PleaseSignOutput)'!='' and ('$(SigningKeyVaultUri)'=='' or '$(SigningCertName)'=='') " + Text="Signing is requested but one or both required properites SigningKeyVaultUri and SigningCertName were not specified on the command line or as environment variables." /> - From cb776056bb82cc092f6412a6d79c80c1c7de005d Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 6 Feb 2024 12:09:39 -0800 Subject: [PATCH 19/19] Do not follow junctions when recursively deleting directories This will prevent elevated processes from accidentally following a junction from a user-writable directory to a per-machine directory and erroneously deleting the per-machine contents. --- src/libs/dutil/dirutil.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/dutil/dirutil.cpp b/src/libs/dutil/dirutil.cpp index e549d236f..47b768ac6 100644 --- a/src/libs/dutil/dirutil.cpp +++ b/src/libs/dutil/dirutil.cpp @@ -210,8 +210,8 @@ extern "C" HRESULT DAPI DirEnsureDeleteEx( } } - // If we're deleting files and/or child directories loop through the contents of the directory. - if (fDeleteFiles || fRecurse) + // If we're deleting files and/or child directories loop through the contents of the directory, but skip junctions. + if ((fDeleteFiles || fRecurse) && (0 == (dwAttrib & FILE_ATTRIBUTE_REPARSE_POINT))) { if (fScheduleDelete) {