将版本号添加到 Visual Studio 安装项目中的应用程序文件夹
我有一个 Visual Studio 安装项目,其应用程序文件夹 DefaultLocation
设置为 [ProgramFilesFolder][Manufacturer]\[ProductName]
。我想更改此设置以包含软件的版本号,例如 [ProgramFilesFolder][Manufacturer]\[ProductName][Version]
,但 Visual Studio 似乎不支持它。
每次创建新版本时,是否有其他方法可以手动更改应用程序文件夹的 DefaultLocation
?
I have a Visual Studio Setup project which has a Application Folder DefaultLocation
set to[ProgramFilesFolder][Manufacturer]\[ProductName]
. I would like to change this to include the software's version number, like [ProgramFilesFolder][Manufacturer]\[ProductName][Version]
, but Visual Studio doesn't seem to support it.
Is there an alternative to manually changing the Application Folder's DefaultLocation
every time I create a new release?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以像[ProductName]一样使用[ProductVersion],并在项目的属性窗口中设置产品的版本。
You can use [ProductVersion] in the same way as [ProductName] and set product's version in the project's properties window.
我的方法是创建一个构建后事件,该事件运行一个修改 MSI 的 Javascript 程序。这应该是一件非常简单的事情。
有一个示例脚本可以修改问题答案中的 MSI
如何在 MSI 安装后运行 EXE?
该脚本没有执行您想要的操作但是使用 Orca 和该脚本,您应该能够弄清楚如何创建自己的脚本,修改 MSI 以自动插入版本号。
它应该是单个数据库更新。
The way I would do it is create a post-build event, that runs a Javascript program that modifies the MSI. It should be a pretty simple thing.
There's a sample script that modifies an MSI in the answers to the question
How to run an EXE after MSI installation?
That script doesn't do what you want but using Orca and that script, you should be able to figure out how to create your own, that modifies the MSI to insert the version number automatically.
It should be a single db update.
您有
[ProgramFilesFolder][Manufacturer]\[ProductName][Version]
尝试
[ProgramFilesFolder][制造商]\[产品名称]\[产品版本]
特别要注意
[ProductName]
后面的斜杠You have
[ProgramFilesFolder][Manufacturer]\[ProductName][Version]
Try
[ProgramFilesFolder][Manufacturer]\[ProductName]\[ProductVersion]
In particular, note the slash after
[ProductName]