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-):
, RemoveExistingProducts .
- : util:User@RemoveOnUninstall ?