WIX获取计算机名称?

时间:2011-03-24 18:36:35

标签: wix wix3.5

如何获取执行MSI的计算机名称以填充控件?

我使用了[ComputerName][COMPUTERNAME]属性,但它不起作用。

2 个答案:

答案 0 :(得分:1)

在习惯打印会话[“ComputerName”]中,检查打印内容。

此属性应该有效。我使用相同的属性,它对我来说很好。如果我给出的答案不起作用,请你在这里发布代码。

答案 1 :(得分:0)

我发现[ComputerName]在将我的Wix Installer版本设置为适用于Windows Server 2008 R2和Windows 7的5.0版本之后工作。我还有条件地检查主机操作系统,因此我知道这将有效。 <Package InstallerVersion="500" Platform="x64" Compressed="yes" InstallScope="perMachine" /> <Condition Message="This application is only supported on 64bit Windows Server 2008 sp2 or later."> <![CDATA[Installed OR ((VersionNT64 >= 600 AND ServicePackLevel >= 2) OR (VersionNT64 >= 601))]]> </Condition>