WiX: Does it use: User @RemoveOnUninstall supports MajorUpgrade?

As part of the WiX-based installer, I have the following component with an element User(among other components with File, ServiceInstalland ServiceControl):

<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>

I decided to switch only with major versions and placed the following element inside Product:

<MajorUpgrade
  Schedule="afterInstallInitialize"
  DowngradeErrorMessage="A newer version of [ProductName] is already installed."
/>

. , ( RemoveExistingProducts), . -: - , , , (Process Explorer , SID), ).

UtilExtension , , scauser.cpp ( SO-):

// 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.

, RemoveExistingProducts .

- : util:User@RemoveOnUninstall ?

+4

All Articles