在 Wix Burn Bundle 级别显示 MSI 版本部分(以显示在标题/标题中)
我发现了如何访问 MSI/产品标签中的部件。但我的目标是根据主要/次要版本号设置刻录安装程序的标题。
下面的代码是我尝试做的事情的摘要,但这不起作用(我认为是因为我不在产品标签内)。
Burn wxs:
<Wix>
<Bundle Version="!(bind.packageVersion.<packageName>)" >
<Variable Name="ProductVersionMajor" Value="!(bind.property.ProductVersion.Major)"/>
<Variable Name="ProductVersionMinor" Value="!(bind.property.ProductVersion.Minor)"/>
....
Theme.wxl:
<WixLocalization ...>
<String Id="Caption">[WixBundleName] [ProductVersionMajor].[ProductVersionMinor] Setup</String>
....
是否有某种解决方法可以让我在捆绑包级别获取此信息而无需编写自定义代码?
这里的答案很有用,但并不完全是我所需要的;因为我不在内部 MSI 的 WIX 产品标签内。
I've discovered how to access the parts within the MSI/Product tag. But my goal was to set the caption of the burn installer based on the Major/Minor version number.
This code below is the summary of what I tried to do, but this doesn't work (I think because I'm not within the Product tag).
Burn wxs:
<Wix>
<Bundle Version="!(bind.packageVersion.<packageName>)" >
<Variable Name="ProductVersionMajor" Value="!(bind.property.ProductVersion.Major)"/>
<Variable Name="ProductVersionMinor" Value="!(bind.property.ProductVersion.Minor)"/>
....
Theme.wxl:
<WixLocalization ...>
<String Id="Caption">[WixBundleName] [ProductVersionMajor].[ProductVersionMinor] Setup</String>
....
Is there some kind of work around where I can get this information at the bundle level without writing custom code?
This answer here was useful, but not quite what it appears I need; since I'm not within the WIX product tag for the inner MSI.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
!(bind.property.ProductVersion.Major)
是构建 MSI 时的绑定变量,而不是捆绑包。可用的绑定变量记录在 https://wixtoolset.org/documentation/manual /v3/overview/light.html。 https://github.com/wixtoolset/ 有一个针对 MsiPackage 属性绑定变量的开放功能请求问题/问题/4298。让ProductVersion.Whatever
部分正常工作可能需要额外的工作,因此如果您愿意,那么您应该对该问题添加评论。!(bind.property.ProductVersion.Major)
is a bind variable when building an MSI, not a bundle. The available bind variables are documented at https://wixtoolset.org/documentation/manual/v3/overview/light.html. There is an open feature request for MsiPackage property bind variables at https://github.com/wixtoolset/issues/issues/4298. It would likely be additional work to get theProductVersion.Whatever
part working, so if you want that then you should add a comment to that issue.除了@Sean 的回答之外,如果您只对完整版本感兴趣,而不对主要/次要/构建的任何细分感兴趣,那么下面的示例我在本地化 WXL 文件中的标题可以定义为简单如下
: bundle.wxs 文件我有以下定义:
其中变量 MyProductFullName 在我的包的安装程序项目下的变量文件中定义。所以基本上[WixBundleName]
和[WixBundleVersion]绑定到Bundle元素的名称和版本 分别是属性值。
In addition to @Sean's answer, if you are only interested in the full version and not in any breakdown of major/minor/build then the below example I have the caption in the localization WXL file can be defined as simple as:
and in my bundle.wxs file I have the following definition:
where the variable MyProductFullName is defined in my variables file under my package's installer project. So basically the [WixBundleName]
and [WixBundleVersion] are bound to the Bundle element's Name and Version attribute values, respectively.