Skip to content

Commit 8e2c014

Browse files
author
Igor Zinkovsky
committed
Fix MSI generation on VC Express
1 parent 429efdd commit 8e2c014

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

tools/msvs/msi/nodemsi.wixproj

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
1717
<OutputPath>..\..\..\$(Configuration)\</OutputPath>
1818
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
19-
<DefineConstants>Debug;ProductVersion=$(NodeVersion);ProductId=$(NodeProductId);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
19+
<DefineConstants>Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
2020
</PropertyGroup>
2121
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
2222
<OutputPath>..\..\..\$(Configuration)\</OutputPath>
2323
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
24-
<DefineConstants>Debug;ProductVersion=$(NodeVersion);ProductId=$(NodeProductId);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
24+
<DefineConstants>Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
2525
</PropertyGroup>
2626
<ItemGroup>
2727
<Compile Include="product.wxs" />
@@ -33,13 +33,25 @@
3333
<Name>WixUIExtension</Name>
3434
</WixExtension>
3535
</ItemGroup>
36+
<UsingTask TaskName="GenerateProductId" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
37+
<ParameterGroup>
38+
<ProductId ParameterType="System.String" Output="true" />
39+
</ParameterGroup>
40+
<Task>
41+
<Code Type="Fragment" Language="cs">
42+
<![CDATA[
43+
this.ProductId = System.Guid.NewGuid().ToString().ToUpper();
44+
]]>
45+
</Code>
46+
</Task>
47+
</UsingTask>
3648
<Import Project="$(WixTargetsPath)" />
37-
<!--
38-
To modify your build process, add your task inside one of the targets below and uncomment it.
39-
Other similar extension points exist, see Wix.targets.
40-
<Target Name="BeforeBuild">
41-
</Target>
42-
<Target Name="AfterBuild">
43-
</Target>
44-
-->
49+
<Target Name="BeforeBuild">
50+
<GenerateProductId>
51+
<Output PropertyName="NodeProductId" TaskParameter="ProductId"/>
52+
</GenerateProductId>
53+
<CreateProperty Value="$(DefineConstants);ProductId=$(NodeProductId)">
54+
<Output TaskParameter="Value" PropertyName="DefineConstants" />
55+
</CreateProperty>
56+
</Target>
4557
</Project>

vcbuild.bat

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ python "%~dp0tools\getnodeversion.py" > "%temp%\node_version.txt"
8989
if not errorlevel 0 echo Cannot determine current version of node.js & goto exit
9090
for /F "tokens=*" %%i in (%temp%\node_version.txt) do set NODE_VERSION=%%i
9191
heat dir deps\npm -var var.NPMSourceDir -dr NodeModulesFolder -cg NPMFiles -gg -template fragment -nologo -out npm.wxs
92-
uuidgen > "%temp%\node_product_id.txt"
93-
set /p NODE_PRODUCT_ID=<"%temp%\node_product_id.txt"
94-
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
92+
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /t:Clean,Build /p:Configuration=%config% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
9593
if errorlevel 1 goto exit
9694

9795
if defined nosign goto run

0 commit comments

Comments
 (0)