绑定 WIX FileVersion 子值? [英] Binding WIX FileVersion sub values?

查看:20
本文介绍了绑定 WIX FileVersion 子值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 WIX 中,我可以这样做以自动为我的 MSI 生成合适的版本号:

In WIX, I can do this to automatically generate a decent version number for my MSI:

<?define ProductVersion="!(bind.FileVersion.MyMainExecutable)" ?>
<Product Version="$(var.ProductVersion)" ... />

这会产生一个像1.0.1.0"这样的字符串,但我只想要前三部分:1.0.1"

That produces a string like "1.0.1.0" but I want only the first three parts: "1.0.1"

我怎样才能做到这一点?

How can I accomplish this?

推荐答案

没有办法只获取绑定 FileVersion 的前三个字段.但是,如果您可以将四部分版本分配给 Product/@Version(这是完全有效的,尽管主要升级只会查看前三个字段),那么您可以访问每个部分使用以下变量的主要、次要、构建和修订:

There isn't a way to only get the first three fields of a bound FileVersion. However, if you are okay assigning the four part version to the Product/@Version (which is completely valid, although major upgrades will only look at the first three fields) then you can access each part of the major, minor, build, and revision using the following variables:

!(bind.property.ProductVersion.Major)
!(bind.property.ProductVersion.Minor)
!(bind.property.ProductVersion.Build)
!(bind.property.ProductVersion.Revision)

希望有用.

这篇关于绑定 WIX FileVersion 子值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆