|
16 | 16 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> |
17 | 17 | <OutputPath>..\..\..\$(Configuration)\</OutputPath> |
18 | 18 | <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> |
19 | | - <DefineConstants>Debug;ProductVersion=$(NodeVersion);ProductId=$(NodeProductId);NPMSourceDir=..\..\..\deps\npm\</DefineConstants> |
| 19 | + <DefineConstants>Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\</DefineConstants> |
20 | 20 | </PropertyGroup> |
21 | 21 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> |
22 | 22 | <OutputPath>..\..\..\$(Configuration)\</OutputPath> |
23 | 23 | <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> |
24 | | - <DefineConstants>Debug;ProductVersion=$(NodeVersion);ProductId=$(NodeProductId);NPMSourceDir=..\..\..\deps\npm\</DefineConstants> |
| 24 | + <DefineConstants>Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\</DefineConstants> |
25 | 25 | </PropertyGroup> |
26 | 26 | <ItemGroup> |
27 | 27 | <Compile Include="product.wxs" /> |
|
33 | 33 | <Name>WixUIExtension</Name> |
34 | 34 | </WixExtension> |
35 | 35 | </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> |
36 | 48 | <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> |
45 | 57 | </Project> |
0 commit comments