如何使用对Installshield的MSBuild支持来验证产品代码和产品版本是否已更新 [英] How to verify if the product code and product version have been updated using MSBuild support for Installshield
问题描述
我正在尝试使用MSBuild和TFS 2013构建InstallShield项目.我按照要求的步骤来覆盖产品代码,如
I'm trying to build an InstallShield project with MSBuild and TFS 2013. I followed the steps required to override the product code as indicated here. First, I created an .isproj file and managed to generate the installer successfully. However, the product code seems not to be changed. I check the file setup.ini and noticed that the Product GUID still the same as the value of Product Code in the .ism file. Is there a way to verify that the product code and product version have been changed?
@更新
It worked finally, I was able to verify the newly generated product code using Orca.
Chris的脚本也可以完美运行!
Chris's script works perfectly as well!
推荐答案
这是我的方法:
在ISM发行视图(构建"选项卡)中,将发行位置"设置为\ Installer,而不是在路径变量"中声明一个ISBUILDDIR路径变量,并将其默认值设置为ISProjectDataFolder
In my ISM release view (build tab) I set the Release Location to \Installer instead of In my Path Variables I declare an ISBUILDDIR path variable and give it a default value of ISProjectDataFolder
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Build">
<PropertyGroup>
<MSIProductVersion>$([System.Text.RegularExpressions.Regex]::Match($(TF_BUILD_BUILDNUMBER), "\d+.\d+.\d+.\d+"))</MSIProductVersion>
<Configuration>Debug</Configuration>
<InstallShieldProductConfiguration>ProductConfigName</InstallShieldProductConfiguration>
<InstallShieldRelease>ReleaseName</InstallShieldRelease>
<InstallShieldProductVersion>$(MSIProductVersion)</InstallShieldProductVersion>
<MSIProductCode>$([System.Guid]::NewGuid().ToString("B").ToUpper())</MSIProductCode>
<InstallShieldBuildDependsOn>PreBuild</InstallShieldBuildDependsOn>
</PropertyGroup>
<ItemGroup>
<InstallShieldPathVariableOverrides Include="$(OutDir)">
<PathVariable>ISBUILDDIR</PathVariable>
</InstallShieldPathVariableOverrides>
</ItemGroup>
<ItemGroup>
<InstallShieldPropertyOverrides Include="$(MSIProductCode)">
<Property>ProductCode</Property>
</InstallShieldPropertyOverrides>
</ItemGroup>
<ItemGroup>
<InstallShieldProject Include="$(MSBuildProjectDirectory)\$(MSBuildProjectName).ism"/>
<InstallShieldMergeModulePath Include="$(MSBuildProjectDirectory)\MSM"/>
</ItemGroup>
<Target Name="PreBuild">
<Exec Command="attrib -s -h -r /s "$(MSBuildProjectDirectory)\*.*"" IgnoreExitCode="true" ContinueOnError="true"/>
</Target>
<Import Project="$(MSBuildExtensionsPath32)\InstallShield\2012\InstallShield.targets"/>
</Project>
这篇关于如何使用对Installshield的MSBuild支持来验证产品代码和产品版本是否已更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!