我有一个脚本,我在其中将产品的版本号设置为变量“PRODUCTVERSION”,即
PRODUCTVERSION= subprocess.check_output('svnversion c:\sandbox -n', shell=False)
我想将此变量“PRODUCTVERSION”作为 msbuild 属性传递给 wix。下面是我尝试过的代码,但最终出现错误消息,
light.exe : error LGHT0001: Illegal characters in path.
这是我的脚本,
def build(self,projpath):
PRODUCTVERSION= subprocess.check_output('svnversion c:\sandbox -n', shell=False)
arg1 = '/t:Rebuild'
arg2 = '/p:Configuration=Release'
arg3 = '/p:Platform=x86'
arg4 = '/p:ProductVersion=%PRODUCTVERSION%'
p = subprocess.call([self.msbuild,projpath,arg1,arg2,arg3])
我的 wix 项目中的属性在哪里,
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>$(ProductVersion)</ProductVersion>
<ProjectGuid>{d559ac98-4dc7-4078-b054-fe0da8363ad0}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>myapp.$(ProductVersion)</OutputName>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixVariables>Version=$(ProductVersion)</WixVariables>
</PropertyGroup>
我想将我的输出名称显示为 'myapp-2.0.PRODUCTVERSION' ,其中 PRODUCTVERSION 是我从 python 脚本中获得的版本号。请帮我找到解决方案。