win: fix custom actions for WiX older than 3.9
authorJoão Reis <reis@janeasystems.com>
Tue, 21 Jul 2015 20:39:15 +0000 (21:39 +0100)
committerJoão Reis <reis@janeasystems.com>
Mon, 24 Aug 2015 11:06:15 +0000 (12:06 +0100)
This is a port of joyent/node@e192f61514cd1500de895cb10128d412f842d7d0 .

Original commit message:

  Older WiX versions included a header with extern "C" declaration,
  hence the custom action source must be C++.

Reviewed-By: João Reis <reis@janeasystems.com>
  PR-URL: https://github.com/joyent/node/pull/25569

PR-URL: https://github.com/nodejs/node/pull/2365
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
tools/msvs/msi/custom_actions.cc [moved from tools/msvs/msi/custom_actions.c with 83% similarity]
tools/msvs/msi/custom_actions.vcxproj

similarity index 83%
rename from tools/msvs/msi/custom_actions.c
rename to tools/msvs/msi/custom_actions.cc
index 5e7d617..9a23d55 100644 (file)
@@ -6,7 +6,7 @@
 #include <wcautil.h>
 
 
-UINT WINAPI BroadcastEnvironmentUpdate(MSIHANDLE hInstall) {
+extern "C" UINT WINAPI BroadcastEnvironmentUpdate(MSIHANDLE hInstall) {
   HRESULT hr = S_OK;
   UINT er = ERROR_SUCCESS;
 
@@ -27,7 +27,7 @@ LExit:
 }
 
 
-BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, VOID* dummy) {
+extern "C" BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, VOID* dummy) {
   switch (ulReason) {
     case DLL_PROCESS_ATTACH:
       WcaGlobalInitialize(hInst);
index ae82905..3716f07 100644 (file)
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="custom_actions.c">
+    <ClCompile Include="custom_actions.cc">
     </ClCompile>
   </ItemGroup>
   <ItemGroup>