Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WiX:util:User@RemoveOnUninstall支持主要升级吗?_Wix_Installation_Windows Installer_Wix Extension_Wix3.8 - Fatal编程技术网

WiX:util:User@RemoveOnUninstall支持主要升级吗?

WiX:util:User@RemoveOnUninstall支持主要升级吗?,wix,installation,windows-installer,wix-extension,wix3.8,Wix,Installation,Windows Installer,Wix Extension,Wix3.8,作为基于WiX的安装程序的一部分,我有以下带有元素的组件(除了带有文件、服务安装和服务控制元素的其他组件): 产品的第一次安装按预期工作。在主要升级期间,我希望用户首先被删除(在RemoveExistingProducts期间),然后再被创建。但它的行为不同:用户实际上是在几乎安装结束时被删除的,例如在服务重新启动后(Process Explorer仍然可以告诉我服务的用户名,但不再告诉我SID,因为服务的用户是在服务启动后被删除的) 在对各种安装日志进行了数小时的剖析之后,我开始查看UtilE

作为基于WiX的安装程序的一部分,我有以下带有元素的组件(除了带有
文件
服务安装
服务控制
元素的其他组件):

产品的第一次安装按预期工作。在主要升级期间,我希望用户首先被删除(在
RemoveExistingProducts
期间),然后再被创建。但它的行为不同:用户实际上是在几乎安装结束时被删除的,例如在服务重新启动后(Process Explorer仍然可以告诉我服务的用户名,但不再告诉我SID,因为服务的用户是在服务启动后被删除的)

在对各种安装日志进行了数小时的剖析之后,我开始查看UtilExtension的来源,并可能在
scauser.cpp
中找到了解释(稍微重新格式化以提高可读性):

因此,我猜在这种情况下,用户的延迟删除实际上属于
RemoveExistingProducts
操作

感谢您阅读本文-现在是问题:是否可以使用
util:User@RemoveOnUninstall
是否与主要升级战略合作

<Component Id="cmpServiceUser" Directory="TARGETDIR" Guid="PUT-GUID-HERE">
    <util:User
      Id="ServiceUser"
      Name="[ProductName]"
      Password="[ServiceUserPassword]"
      PasswordNeverExpires="yes"
      LogonAsService="yes"
      CreateUser="yes"
      UpdateIfExists="yes"
      RemoveOnUninstall="yes"
    />
</Component>
<MajorUpgrade
  Schedule="afterInstallInitialize"
  DowngradeErrorMessage="A newer version of [ProductName] is already installed."
/>
// Schedule the removal because the user exists and we don't have any flags set
// that say, don't remove the user on uninstall.
//
// Note: We can't rollback the removal of a user which is why RemoveUser is a
// commit CustomAction.