[wix-users] How to keep service account same on upgrade
raj pandit
rajeev.pandit84 at gmail.com
Tue Jul 12 22:25:42 PDT 2022
Hi guys,
I have an application which actually using Topself to be hosted as window
service. We have wix installer with script based custom action to install
the service.
<CustomAction Id="RunTopShelfServiceInstall" Directory="INSTALLFOLDER"
Execute="deferred" Return="ignore" Impersonate="no"
ExeCommand="[INSTALLFOLDER]management.exe install" />
<CustomAction Id="RunTopShelfServiceUninstall" Directory="INSTALLFOLDER"
Execute="deferred" Return="ignore" Impersonate="no"
ExeCommand="[INSTALLFOLDER] management .exe uninstall" />
I am facing 2 issues that needs solution/approach:
*1. When we upgrade the existing msi and any issues occurred in the new
updated version, neither application is in the working condition. *
* Solution tried: *
- understood its because of major upgrades, as it first uninstall the
previous version and then install the new one. If new upgrades has issue,
it can not roll back. So, i tried below
<MajorUpgrade *Schedule="afterInstallExecuteAgain"*
DowngradeErrorMessage="A newer version of [ProductName] is already
installed." AllowDowngrades="no" AllowSameVersionUpgrades="yes" />
* Problem with this solution:* When error occurs in updated version, It
also removes the services from the service.msc. Its show correctly in
Add/Remove program list.
*2. When we change the service account for the service and upgrade to new
version, it changes the service account or install a new application with
the local system service account.*
- *how to achieve this *?
- i followed stack overflow link : here
<https://stackoverflow.com/questions/26985402/updating-a-package-with-a-windows-service-resets-services-account-and-password>
.
but it does not fit better as we use topself for the hosting application.
- Please suggest if we can check/retrieve the service account username
password with c# code and custom action
Please let me know if any suggestion.
Thanks,
Rajeev Pandit
More information about the wix-users
mailing list