在 WiX 中,ProductCode 在哪里指定? [英] In WiX, where is the ProductCode specified?

查看:25
本文介绍了在 WiX 中,ProductCode 在哪里指定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 WiX 创建安装程序,为了从命令行卸载我的应用程序(使用 MsiExec.exe/X{...}),我需要知道 ProductCode对于我的 .msi 文件.

I'm using WiX to create an installer, and in order to uninstall my application from the command line (using MsiExec.exe /X{...}) I need to know the ProductCode for my .msi file.

当我安装我的应用程序时,我可以看到安装日志文件中列出了 ProductCode.但是,显示的 GUID 在我的 WiX 文件中没有任何特征.它似乎也在我的安装程序的构建之间发生变化.

When I install my application, I can see that the ProductCode is listed in the installation log file. However, the GUID shown does not feature anywhere in my WiX files. It also seems to change between builds of my installer.

我可以在我的 WiX .wsx 文件中的某处指定 ProductCode 吗?如果有,在哪里?

Can I specify the ProductCode somewhere in my WiX .wsx file? If so, where?

推荐答案

产品代码是 Product 元素的 Id.

The product code is the Id of the Product element.

指定一个 guid

<Product Id="INSERT_GUID_HERE" 

指定 '*' 将使 GUID 每次自动生成

Specifying a '*' makes the GUID auto generate every time

<Product Id="*"

或者您可以将产品代码作为变量存储在 config.wxi 文件中并像这样引用它

Or you can store the product code as a variable in a config.wxi file and reference it like so

<Product Id="$(var.MyProductCode)"

这篇关于在 WiX 中,ProductCode 在哪里指定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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