【发布时间】:2021-11-30 17:26:38
【问题描述】:
我正在使用 wix 构建一个安装程序,该安装程序根据从命令行传入的“CURRENCY”属性安装不同的功能。
msiexec /i install.msi CURRENCY="GBP"
这里是wix文件的特征元素:
<Feature Id="Complete" Level="1" Title="My Service" Display="expand" InstallDefault="local">
<Feature Id="MainProgram" Title="My Service" Display="expand" Level="1" Absent="allow">
<ComponentRef Id="MyCoordinator" />
<Feature Id="Foo" Title="Foo" Display="expand" InstallDefault="followParent" Level="1" Absent="disallow">
<Feature Id="UK" Title="UK Settings" Description="UK Plugin." Level="0" InstallDefault="followParent" Absent="disallow">
<Condition Level="1">CURRENCY = "GBP"</Condition> <<-- CONDITION
<ComponentRef Id="UK_Settings_Component" />
</Feature>
<Feature Id="US" Title="US Settings" Description="US Plugin." Level="0" InstallDefault="followParent" Absent="disallow">
<Condition Level="1">CURRENCY = "USD"</Condition> <<-- CONDITION
<ComponentRef Id="US_Settings_Component" />
</Feature>
</Feature>
</Feature>
</Feature>
安装过程效果很好。我传入一种货币并安装相应国家/地区的设置组件。
但是当我尝试通过“添加或删除程序”小程序卸载应用程序时,它要求用户卸载应用程序两次,然后才能将其从已安装程序列表中删除。所以我使用详细日志从命令行运行卸载。
> msiexec /x {product-guid} /L*v "uninstall_1.txt"
> msiexec /x {product-guid} /L*v "uninstall_2.txt"
在查看详细的卸载日志后,我认为这是因为安装程序未能删除货币特定设置组件。
从第二次卸载后的卸载日志我可以看到它找到了:
Component: UK_Settings_Component; Installed: Local; Request: Null; Action: Local
如果我将货币传递给卸载命令,它只需要一次卸载
> msiexec /x {product-guid} CURRENCY="GBP"
问题:如何告诉它在卸载应用程序时始终删除所有货币组件?
【问题讨论】:
标签: windows wix windows-installer