4
我有一個項目使用WiX擴展WixUtilExtension爲我們的Windows服務創建用戶。當我修補安裝(使用.msp)時,執行自定義操作RemoveUser和CreateUser。如何防止在修補程序中刪除和創建Windows用戶
我不希望這些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>
這會覆蓋wix自定義操作直接寫入msi InstallExecuteSequence表的條目嗎? 在InstallExecuteSequence標記中沒有此自定義操作的條目。它看起來像wix自定義操作直接將它添加到msi InstallExecuteSequence表。 – 2010-06-21 14:36:04
如果我正確理解你,那麼不,這只是指定何時和如果行動應該發生。 – 2010-06-21 14:47:56
也許更清楚些: 我使用wix WixUtilExtension庫來創建用戶,並且沒有爲ConfigureUsers自定義操作添加一個條目到InstallExecuteSequence標籤。我不知道這個自定義操作是否已創建,並直接添加到毫無條件的msi InstallExecuteSequence表中,直到我檢查了表。 我採納了您的建議,並將ConfigureUsers自定義操作條目添加到了InstallExecuteSequence標記中,並重新構建了msi。 msi InstallExecuteSequence表中的現有行已更新爲包含條件。 – 2010-06-21 15:13:36