How to verify if the product code and product version have been updated using MSBuild support for Installshield

*爱你&永不变心* 提交于 2019-12-12 02:43:57

问题


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?

@Update

It worked finally, I was able to verify the newly generated product code using Orca.

Chris's script works perfectly as well!


回答1:


This is how I do it:

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 &quot;$(MSBuildProjectDirectory)\*.*&quot;" IgnoreExitCode="true" ContinueOnError="true"/>
  </Target>
    <Import Project="$(MSBuildExtensionsPath32)\InstallShield\2012\InstallShield.targets"/>
</Project>


来源:https://stackoverflow.com/questions/22625594/how-to-verify-if-the-product-code-and-product-version-have-been-updated-using-ms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!