I've got product installed as a service and I was wondering about the following scenario:
1. The installed (Windows) service is running.
2. The user decides repair the installation.
3. InstallAware does upgrade.
However, I forget to stop the service prior to repairing, this means the file (executable) is locked. You can't delete it or modify.
InstallAware doesn't seem to mind since the repair goes without at problem.
After the repair, a reboot is requested.
Is that reboot necessary because some files were locked?
And are these files replaced with the 'repaired' ones during the reboot?
Or should I stop the service while repairing and start it afterwards (saving a reboot)?
Repairing an existing running service.
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Repairing an existing running service.
Dear Frank,
you should "Always" stop the service before to execute any operation over the service file.
Regards
you should "Always" stop the service before to execute any operation over the service file.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Repairing an existing running service.
OK, clear answer. I assumed that much already, but do you perhaps know if Windows (MSI) can circumvent a locked file by requesting a reboot and then replace the file when the system restarts?
This is just me being curious, your answer will get me going so thanks for that!
One more question: The stopping of this service during a repair can that be done with "Control Service ServiceName: stop on uninstall" or should I call Run Program "sc.exe stop ServiceName"?
This is just me being curious, your answer will get me going so thanks for that!
One more question: The stopping of this service during a repair can that be done with "Control Service ServiceName: stop on uninstall" or should I call Run Program "sc.exe stop ServiceName"?
Re: Repairing an existing running service.
Frank,
I've used both with equal success. Sometimes a mix of both work well together. That is, I'd use net stop as it just seems more "tactile" if you get my meaning and then use the IA commands to do the service teardown.
Then again, if you create your services with TopShelf it becomes easier still.
I've used both with equal success. Sometimes a mix of both work well together. That is, I'd use net stop as it just seems more "tactile" if you get my meaning and then use the IA commands to do the service teardown.
Then again, if you create your services with TopShelf it becomes easier still.

Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
InstallAware MVP
Re: Repairing an existing running service.
@bokkie
How did you overcome the problem that Run Program is not passing on the elevated status and a net call without admin elevation will fail.
Best regards,
How did you overcome the problem that Run Program is not passing on the elevated status and a net call without admin elevation will fail.
Best regards,
Manfred Wilner
Re: Repairing an existing running service.
Manfred,
I've never done anything special when installing services. I tested them on my local machines first and then the installation media was given to the sys admins. The sys admins ran the installations on the production servers so they probably had the necessary elevations and privileges. These days, I create all my services with TopShelf's factory assembly. The sys admins continued to install the application and assemblies and I gave them the simple DOS command to install and uninstall the service; effectively giving them full control.
I know I've beaten the TopShelf drum many times but for service development it's really very good.
I've never done anything special when installing services. I tested them on my local machines first and then the installation media was given to the sys admins. The sys admins ran the installations on the production servers so they probably had the necessary elevations and privileges. These days, I create all my services with TopShelf's factory assembly. The sys admins continued to install the application and assemblies and I gave them the simple DOS command to install and uninstall the service; effectively giving them full control.
I know I've beaten the TopShelf drum many times but for service development it's really very good.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
InstallAware MVP
Who is online
Users browsing this forum: No registered users and 115 guests