Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Enable upgrades in MSI.
Browse files Browse the repository at this point in the history
Fixes #2228.
  • Loading branch information
Igor Zinkovsky committed Dec 8, 2011
1 parent 871194d commit b24cdb3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/msvs/msi/nodemsi.wixproj
Expand Up @@ -16,12 +16,12 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>..\..\..\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
<DefineConstants>Debug;ProductVersion=$(NodeVersion);ProductId=$(NodeProductId);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>..\..\..\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
<DefineConstants>Debug;ProductVersion=$(NodeVersion);ProductId=$(NodeProductId);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="product.wxs" />
Expand Down
5 changes: 4 additions & 1 deletion tools/msvs/msi/product.wxs
Expand Up @@ -4,7 +4,7 @@
<?define repoDir="$(var.ProjectDir)..\..\..\" ?>
<?define sourcedir="$(var.repoDir)\$(var.Configuration)\" ?>

<Product Id="cc6c176e-e26c-48ec-8970-f58bd1d046cf"
<Product Id="$(var.ProductId)"
Name="node.js"
Language="1033"
Version="$(var.ProductVersion)"
Expand All @@ -14,6 +14,9 @@
<Package InstallerVersion="200" Compressed="yes" Platform="x86" />

<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

<MajorUpgrade AllowSameVersionUpgrades="yes"
DowngradeErrorMessage="A later version of node.js is already installed. Setup will now exit." />

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
Expand Down
4 changes: 3 additions & 1 deletion vcbuild.bat
Expand Up @@ -89,7 +89,9 @@ 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" /t:Clean,Build /p:Configuration=%config% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
uuidgen > "%temp%\node_product_id.txt"
set /p NODE_PRODUCT_ID=<"%temp%\node_product_id.txt"
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /t:Clean,Build /p:Configuration=%config% /p:NodeVersion=%NODE_VERSION% /p:NodeProductId=%NODE_PRODUCT_ID% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit

if defined nosign goto run
Expand Down

0 comments on commit b24cdb3

Please sign in to comment.