在我的Defines.wxi中我有:
<?define MajorVersion="1" ?>
<?define MinorVersion="08" ?>
<?define BuildVersion="11" ?>
Run Code Online (Sandbox Code Playgroud)
在我的MyProject.Setup.wixproj中,我有:
<OutputName>MyProject</OutputName>
<OutputType>Package</OutputType>
Run Code Online (Sandbox Code Playgroud)
是否可以以某种方式在文件名中包含版本变量,以便我的文件可以命名为MyProject.1.08.11.msi?
这不起作用(没有定义这样的变量):
<OutputName>MyProject-$(MajorVersion)</OutputName>
<OutputType>Package</OutputType>
Run Code Online (Sandbox Code Playgroud)
这不起作用(没有定义这样的变量):
<Target Name="AfterBuild" Condition="'$(Configuration)' == 'Release'">
<Copy SourceFiles="$(OutputPath)$(OutputName).msi" DestinationFiles="C:\$(OutputName)-$(MajorVersion).msi" />
</Target>
Run Code Online (Sandbox Code Playgroud)
我觉得很清楚$(MajorVersion)不是从Defines.wxi文件中获取定义的正确方法.什么是?
更新
我试着把它放在MyProject.Setup.wixproj中:
<InstallerMajorVersion>7</InstallerMajorVersion>
<InstallerMinorVersion>7</InstallerMinorVersion>
<InstallerBuildNumber>7</InstallerBuildNumber>
Run Code Online (Sandbox Code Playgroud)
...
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>PrebuildPath=..\..\obj\prebuild\web\;InstallerMajorVersion=$(InstallerMajorVersion);InstallerMinorVersion=$(InstallerMinorVersion);InstallerBuildNumber=$(InstallerBuildNumber)</DefineConstants>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
这在Defines.wxi中:
<?define MajorVersion="$(var.InstallerMajorVersion)" ?>
<?define MinorVersion="$(var.InstallerMinorVersion)" ?>
<?define BuildVersion="$(var.InstallerBuildNumber)" ?>
<?define Revision="0" ?>
<?define VersionNumber="$(var.InstallerMajorVersion).$(var.InstallerMinorVersion).$(var.InstallerBuildNumber)" ?>
Run Code Online (Sandbox Code Playgroud)
也没用.得到以下错误消息:
我正在寻找一个MSBuild任务,它会告诉我特定dll的版本.有没有可用的任务?
在我的情况下,DLL是一个.Net程序集,所以我实际上在寻找Assembly.FullName.