我有一个项目使用WiX扩展WixUtilExtension为我们的Windows服务创建用户。当我修补安装(使用.msp)时,将执行自定义操作RemoveUser和CreateUser。
我不希望这些WiX扩展程序在修补程序中创建自定义操作。
我可以在MSI的InstallExecuteSequence表中直接向自定义操作(ConfigureUsers)添加条件以防止这种情况,但我还没有找到在WiX中处理此问题的方法。
使用WiX,我如何防止在修补程序中执行RemoveUser和CreateUser?
<util:Group Id="LocalAdministrators" Name="Administrators"/>
<DirectoryRef Id="INSTALLLOCATION" DiskId="1">
<Component Id="CreateServiceAccountUser" Guid="{614550A7-C766-4B5D-9BF9-233D07EB3B69}">
<util:User Id="ServiceAccountUser"
CanNotChangePassword="yes"
CreateUser="yes"
Disabled="no"
FailIfExists="no"
LogonAsService="yes"
Name="TestUser"
Password="testuserpw"
PasswordExpired="no"
PasswordNeverExpires="yes"
RemoveOnUninstall="yes"
UpdateIfExists="yes">
<util:GroupRef Id="LocalAdministrators"/>
</util:User>
<RegistryKey Root="HKMU" Key="Software\AMT\WebBrix">
<RegistryValue Name="CreateServiceAccountUser"
Value="Common"
Type="string"
KeyPath="yes" />
</RegistryKey>
</Component>
</DirectoryRef>
答案 0 :(得分:3)
你可以在WiX中做到这一点:
<InstallExecuteSequence>
<Custom Action='ConfigureUsers'
After='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>
以下是一些更多条件