From 9fe39ede9f014a0e5a8f3d85d5373743188cea81 Mon Sep 17 00:00:00 2001 From: Matt Gollob Date: Thu, 31 May 2012 22:44:10 -0400 Subject: [PATCH] windows: don't install x64 version into the 'program files (x86)' folder * Update nodemsi.sln and .wixproj to include support for x64 platform - Add ProgramFilesFolderId to the DefineConstants property for each configuration/platform's property group with the appropriate value (ProgramFilesFolder for x86 builds, ProgramFiles64Folder for x64 builds) * Update product.wxs: - update the Id value for the "Program Files" Directory element to use a preprocessor constant. - remove hard-coded platform from the Package element. MSI platform will be automatically detected based on MSBuild's Platform property. (This was already supported in the Wix MSBuild targets, we just weren't taking advantage of it.) * Update vcbuild.bat to set MSBuild's Platform property appropriately, defaulting to x86 if not explicitly supplied by the user. Note that creating an x64 build requires that vcbuild.bat be run from a VS 64-bit command prompt. Closes #3312 Closes #3356 --- tools/msvs/msi/nodemsi.sln | 6 ++++++ tools/msvs/msi/nodemsi.wixproj | 14 ++++++++++++-- tools/msvs/msi/product.wxs | 4 ++-- vcbuild.bat | 6 ++++-- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/tools/msvs/msi/nodemsi.sln b/tools/msvs/msi/nodemsi.sln index 1392bb285a..f95b00f879 100644 --- a/tools/msvs/msi/nodemsi.sln +++ b/tools/msvs/msi/nodemsi.sln @@ -5,12 +5,18 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "nodemsi", "nodemsi.wixproj" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Debug|x64.ActiveCfg = Debug|x64 + {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Debug|x64.Build.0 = Debug|x64 {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Debug|x86.ActiveCfg = Debug|x86 {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Debug|x86.Build.0 = Debug|x86 + {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Release|x64.ActiveCfg = Release|x64 + {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 EndGlobalSection diff --git a/tools/msvs/msi/nodemsi.wixproj b/tools/msvs/msi/nodemsi.wixproj index d7a3b62dd5..50411aaa06 100644 --- a/tools/msvs/msi/nodemsi.wixproj +++ b/tools/msvs/msi/nodemsi.wixproj @@ -16,12 +16,22 @@ ..\..\..\$(Configuration)\ obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\ + Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFilesFolder ..\..\..\$(Configuration)\ obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\ + Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFilesFolder + + + ..\..\..\$(Configuration)\ + obj\$(Configuration)\ + Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFiles64Folder + + + ..\..\..\$(Configuration)\ + obj\$(Configuration)\ + Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFiles64Folder diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index 1448c928f4..d21ca46440 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -11,7 +11,7 @@ Manufacturer="Joyent, Inc" UpgradeCode="1d60944c-b9ce-4a71-a7c0-0384eb884baa"> - + @@ -19,7 +19,7 @@ DowngradeErrorMessage="A later version of node.js is already installed. Setup will now exit." /> - + diff --git a/vcbuild.bat b/vcbuild.bat index 92eef6feb6..b417f680f1 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -13,6 +13,7 @@ if /i "%1"=="/?" goto help @rem Process arguments. set config=Release +set msiplatform=x86 set target=Build set target_arch=ia32 set debug_arg= @@ -62,6 +63,7 @@ if defined upload goto upload if defined jslint goto jslint if "%config%"=="Debug" set debug_arg=--debug +if "%target_arch%"=="x64" set msiplatform=x64 if defined nosnapshot set nosnapshot_arg=--without-snapshot :project-gen @@ -115,7 +117,7 @@ python "%~dp0tools\getnodeversion.py" > "%temp%\node_version.txt" if not errorlevel 0 echo Cannot determine current version of node.js & goto exit for /F "tokens=*" %%i in (%temp%\node_version.txt) do set NODE_VERSION=%%i heat dir deps\npm -var var.NPMSourceDir -dr NodeModulesFolder -cg NPMFiles -gg -template fragment -nologo -out npm.wxs -msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:Configuration=%config% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo +msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:Configuration=%config% /p:Platform=%msiplatform% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo if errorlevel 1 goto exit if defined nosign goto run @@ -166,7 +168,7 @@ python tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --noj goto exit :help -echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [nobuild] [nosign] +echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [nobuild] [nosign] [x86/x64] echo Examples: echo vcbuild.bat : builds release build echo vcbuild.bat debug : builds debug build