Skip to content

Instantly share code, notes, and snippets.

@igorzi
Created December 10, 2011 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorzi/1454149 to your computer and use it in GitHub Desktop.
Save igorzi/1454149 to your computer and use it in GitHub Desktop.
From d8d2c5706286012c9ed5a5f5c68ca62729707827 Mon Sep 17 00:00:00 2001
From: Igor Zinkovsky <igorzi@microsoft.com>
Date: Fri, 9 Dec 2011 16:42:15 -0800
Subject: [PATCH] Fix MSI generation on VC Express
---
tools/msvs/msi/nodemsi.wixproj | 32 ++++++++++++++++++++++----------
vcbuild.bat | 4 +---
2 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/tools/msvs/msi/nodemsi.wixproj b/tools/msvs/msi/nodemsi.wixproj
index 96813d3..d7a3b62 100644
--- a/tools/msvs/msi/nodemsi.wixproj
+++ b/tools/msvs/msi/nodemsi.wixproj
@@ -16,12 +16,12 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>..\..\..\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
- <DefineConstants>Debug;ProductVersion=$(NodeVersion);ProductId=$(NodeProductId);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
+ <DefineConstants>Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>..\..\..\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
- <DefineConstants>Debug;ProductVersion=$(NodeVersion);ProductId=$(NodeProductId);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
+ <DefineConstants>Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="product.wxs" />
@@ -33,13 +33,25 @@
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
+ <UsingTask TaskName="GenerateProductId" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
+ <ParameterGroup>
+ <ProductId ParameterType="System.String" Output="true" />
+ </ParameterGroup>
+ <Task>
+ <Code Type="Fragment" Language="cs">
+ <![CDATA[
+ this.ProductId = System.Guid.NewGuid().ToString().ToUpper();
+ ]]>
+ </Code>
+ </Task>
+ </UsingTask>
<Import Project="$(WixTargetsPath)" />
- <!--
- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Wix.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
+ <Target Name="BeforeBuild">
+ <GenerateProductId>
+ <Output PropertyName="NodeProductId" TaskParameter="ProductId"/>
+ </GenerateProductId>
+ <CreateProperty Value="$(DefineConstants);ProductId=$(NodeProductId)">
+ <Output TaskParameter="Value" PropertyName="DefineConstants" />
+ </CreateProperty>
+ </Target>
</Project>
diff --git a/vcbuild.bat b/vcbuild.bat
index 290e523..38a1951 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -89,9 +89,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
-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
+msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /t:Clean,Build /p:Configuration=%config% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit
if defined nosign goto run
--
1.7.4.msysgit.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment