如何防止 Windows 用户在补丁期间被删除和创建
我有一个项目,它使用 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>
I have a project that uses the WiX extension WixUtilExtension to create a user for our Windows services. When I patch the installation (using an .msp), the custom actions RemoveUser and CreateUser are executed.
I don't want these WiX extension created custom actions to run during a patch.
I can add a condition directly to the custom action (ConfigureUsers) in the InstallExecuteSequence table of the MSI to prevent this, but I have not found a way to handle this in WiX.
Using WiX, how can I prevent RemoveUser and CreateUser from being executed during a patch?
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 WiX 中执行此操作:
以下是更多条件
条件:未安装且未修补
条件:
条件:NOT REMOVE
条件:必须没有条件
条件:未安装且未修补
未安装
未安装或 MaintenanceMode="Modify"
REMOVE~=“全部”或 MaintenanceMode=“删除”
You can do that in WiX:
Here are some more conditions
Condition: NOT Installed AND NOT PATCH
Condition: REMOVE
Condition: NOT REMOVE
Condition: There must be no condition
Condition:NOT Installed AND NOT PATCH
NOT Installed
NOT Installed OR MaintenanceMode="Modify"
REMOVE~="All" OR MaintenanceMode="Remove"