diff --git a/.gitignore b/.gitignore index c3a9e464540fe1..2424b5fc2087b1 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ Release/ *.suo *.vcproj *.vcxproj +!CustomExtension.vcxproj *.vcxproj.user *.vcxproj.filters UpgradeLog*.XML diff --git a/tools/msvs/msi/CustomExtension.cpp b/tools/msvs/msi/CustomExtension.cpp new file mode 100644 index 00000000000000..e782283cf31f12 --- /dev/null +++ b/tools/msvs/msi/CustomExtension.cpp @@ -0,0 +1,42 @@ + +#define WIN32_LEAN_AND_MEAN + +#include +#include +#include + +UINT WINAPI BroadcastEnvironmentUpdate(MSIHANDLE hInstall) { + HRESULT hr = S_OK; + UINT er = ERROR_SUCCESS; + + hr = WcaInitialize(hInstall, "BroadcastEnvironmentUpdate"); + ExitOnFailure(hr, "Failed to initialize"); + + WcaLog(LOGMSG_STANDARD, "Initialized."); + + SendMessageTimeout(HWND_BROADCAST, + WM_SETTINGCHANGE, + 0, + (LPARAM)L"Environment", + SMTO_ABORTIFHUNG, + 5000, + NULL); + +LExit: + er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; + return WcaFinalize(er); +} + +extern "C" BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, LPVOID) { + switch (ulReason) { + case DLL_PROCESS_ATTACH: + WcaGlobalInitialize(hInst); + break; + + case DLL_PROCESS_DETACH: + WcaGlobalFinalize(); + break; + } + + return TRUE; +} diff --git a/tools/msvs/msi/CustomExtension.def b/tools/msvs/msi/CustomExtension.def new file mode 100644 index 00000000000000..b8920dcf335a4a --- /dev/null +++ b/tools/msvs/msi/CustomExtension.def @@ -0,0 +1,5 @@ +LIBRARY "CustomExtension" + +EXPORTS + +BroadcastEnvironmentUpdate diff --git a/tools/msvs/msi/CustomExtension.vcxproj b/tools/msvs/msi/CustomExtension.vcxproj new file mode 100644 index 00000000000000..3975520ea9be80 --- /dev/null +++ b/tools/msvs/msi/CustomExtension.vcxproj @@ -0,0 +1,111 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {B70585F8-DAB7-40FA-9904-13CF53A73A06} + CustomExtension + Win32Proj + CustomExtension + + + + DynamicLibrary + v120 + Unicode + true + + + DynamicLibrary + v120 + Unicode + + + + + + + + + + + + + <_ProjectFileVersion>12.0.30501.0 + + + bin\$(Configuration)\ + obj\$(Configuration)\ + true + + + bin\$(Configuration)\ + obj\$(Configuration)\ + false + + + + Disabled + $(WIX)sdk\VS2013\inc;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Use + Level3 + EditAndContinue + + + msi.lib;dutil.lib;wcautil.lib;Version.lib;%(AdditionalDependencies) + $(WIX)sdk\VS2013\lib\x86;%(AdditionalLibraryDirectories) + CustomExtension.def + true + Windows + MachineX86 + + + + + MaxSpeed + true + $(WIX)sdk\VS2013\inc;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + true + + + Level3 + ProgramDatabase + + + + msi.lib;dutil.lib;wcautil.lib;Version.lib;%(AdditionalDependencies) + $(WIX)sdk\VS2013\lib\x86;%(AdditionalLibraryDirectories) + CustomExtension.def + true + Windows + true + true + MachineX86 + false + false + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/msvs/msi/nodemsi.sln b/tools/msvs/msi/nodemsi.sln index f95b00f879cefb..037e5d4f8504e2 100644 --- a/tools/msvs/msi/nodemsi.sln +++ b/tools/msvs/msi/nodemsi.sln @@ -1,8 +1,12 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "nodemsi", "nodemsi.wixproj", "{1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CustomExtension", "CustomExtension.vcxproj", "{B70585F8-DAB7-40FA-9904-13CF53A73A06}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -19,6 +23,14 @@ Global {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Release|x64.Build.0 = Release|x64 {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Release|x86.ActiveCfg = Release|x86 {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Release|x86.Build.0 = Release|x86 + {B70585F8-DAB7-40FA-9904-13CF53A73A06}.Debug|x64.ActiveCfg = Debug|Win32 + {B70585F8-DAB7-40FA-9904-13CF53A73A06}.Debug|x64.Build.0 = Debug|Win32 + {B70585F8-DAB7-40FA-9904-13CF53A73A06}.Debug|x86.ActiveCfg = Debug|Win32 + {B70585F8-DAB7-40FA-9904-13CF53A73A06}.Debug|x86.Build.0 = Debug|Win32 + {B70585F8-DAB7-40FA-9904-13CF53A73A06}.Release|x64.ActiveCfg = Release|Win32 + {B70585F8-DAB7-40FA-9904-13CF53A73A06}.Release|x64.Build.0 = Release|Win32 + {B70585F8-DAB7-40FA-9904-13CF53A73A06}.Release|x86.ActiveCfg = Release|Win32 + {B70585F8-DAB7-40FA-9904-13CF53A73A06}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/tools/msvs/msi/nodemsi.wixproj b/tools/msvs/msi/nodemsi.wixproj index f2caa1bb91b2bd..a12dfc8b10715d 100644 --- a/tools/msvs/msi/nodemsi.wixproj +++ b/tools/msvs/msi/nodemsi.wixproj @@ -56,6 +56,16 @@ + + + CustomExtension + {b70585f8-dab7-40fa-9904-13cf53a73a06} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + + @@ -65,4 +75,4 @@ move "!(TargetPath)" "$(TargetDir)\$(TargetFileName)" move "!(TargetPdbPath)" "$(TargetDir)\$(TargetPdbName)" - + \ No newline at end of file diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index 878999f309d205..c69cc346586a94 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -269,10 +269,20 @@ Execute="deferred" Return="check" /> + + + + $NodeAlias = 3 +