【发布时间】:2014-11-26 11:07:54
【问题描述】:
我一直在使用 Wix 安装程序来创建安装程序,并且安装程序在安装过程中注册了一个端口(使用 netsh.exe)。一切正常。但后来我尝试在法语的 Windows 7 操作系统上安装应用程序……安装程序无法注册端口,因为 netsh 命令是为 en-US 编写的。
以下命令在 en-US 机器上运行良好:
netsh.exe http add urlacl url=http: //+:6700/Demo101/ user=\users 但在 fr 上失败-FR 操作系统。
对于 fr-FR,我需要运行
netsh.exe http add urlacl url=http: //+:6700/Demo101/ user=\utilisateurs
我在 Wix 项目中进行了以下更改:
<?define langLocale = [OSINSTALLEDLOCALE]?>
<?if $(var.langLocale) = "00000409"?>
<!-- Firewall exception -->
<CustomAction Id="ListenerServiceAddReservation"
Execute="deferred"
Impersonate="no"
Directory="INSTALLLOCATION"
ExeCommand="[SystemFolder]netsh.exe http add urlacl url=http://+:6700/Demo101/ user=\users"
Return="asyncWait" />
<?else?>
<CustomAction Id="ListenerServiceAddReservation"
Execute="deferred"
Impersonate="no"
Directory="INSTALLLOCATION"
ExeCommand="[SystemFolder]netsh.exe http add urlacl url= http://+:6700/Demo101/ user=\utilisateurs"
Return="asyncWait" />
<?endif?>
但这不起作用,因为它没有获得值“00000409”,并且总是进入法语的 else 条件并且机器在 en-US 中。
有什么帮助吗?
【问题讨论】: