From e192f61514cd1500de895cb10128d412f842d7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Tue, 21 Jul 2015 21:39:15 +0100 Subject: win: fix custom actions for WiX older than 3.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Older WiX versions included a header with extern "C" declaration, hence the custom action source must be C++. Reviewed-By: João Reis PR-URL: https://github.com/joyent/node/pull/25569 --- tools/msvs/msi/custom_actions.c | 42 ----------------------------------- tools/msvs/msi/custom_actions.cc | 42 +++++++++++++++++++++++++++++++++++ tools/msvs/msi/custom_actions.vcxproj | 2 +- 3 files changed, 43 insertions(+), 43 deletions(-) delete mode 100644 tools/msvs/msi/custom_actions.c create mode 100644 tools/msvs/msi/custom_actions.cc diff --git a/tools/msvs/msi/custom_actions.c b/tools/msvs/msi/custom_actions.c deleted file mode 100644 index 5e7d617f3..000000000 --- a/tools/msvs/msi/custom_actions.c +++ /dev/null @@ -1,42 +0,0 @@ - -#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"); - - SendMessageTimeoutW(HWND_BROADCAST, - WM_SETTINGCHANGE, - 0, - (LPARAM) L"Environment", - SMTO_ABORTIFHUNG, - 5000, - NULL); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - - -BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, VOID* dummy) { - switch (ulReason) { - case DLL_PROCESS_ATTACH: - WcaGlobalInitialize(hInst); - break; - - case DLL_PROCESS_DETACH: - WcaGlobalFinalize(); - break; - } - - return TRUE; -} diff --git a/tools/msvs/msi/custom_actions.cc b/tools/msvs/msi/custom_actions.cc new file mode 100644 index 000000000..9a23d5574 --- /dev/null +++ b/tools/msvs/msi/custom_actions.cc @@ -0,0 +1,42 @@ + +#define WIN32_LEAN_AND_MEAN + +#include +#include +#include + + +extern "C" UINT WINAPI BroadcastEnvironmentUpdate(MSIHANDLE hInstall) { + HRESULT hr = S_OK; + UINT er = ERROR_SUCCESS; + + hr = WcaInitialize(hInstall, "BroadcastEnvironmentUpdate"); + ExitOnFailure(hr, "Failed to initialize"); + + SendMessageTimeoutW(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, VOID* dummy) { + switch (ulReason) { + case DLL_PROCESS_ATTACH: + WcaGlobalInitialize(hInst); + break; + + case DLL_PROCESS_DETACH: + WcaGlobalFinalize(); + break; + } + + return TRUE; +} diff --git a/tools/msvs/msi/custom_actions.vcxproj b/tools/msvs/msi/custom_actions.vcxproj index ae82905cd..3716f07ff 100644 --- a/tools/msvs/msi/custom_actions.vcxproj +++ b/tools/msvs/msi/custom_actions.vcxproj @@ -169,7 +169,7 @@ - + -- cgit v1.2.1