change service to manual before upgrade

Got a problem you cannot solve? Try here.
Post Reply
tzachk
Posts: 171
Joined: Wed Jul 18, 2012 12:14 am

change service to manual before upgrade

Post by tzachk »

Hi all,

During upgrade or uninstall of my product I need to reboot the machine.
Before rebooting, I need to change the service to manual as to prevent it from starting after the reboot.

Any help on how to achieve this is appreciated.

Regards,
Tzach
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: change service to manual before upgrade

Post by FrancescoT »

Dear Tzach,

to set the Start Type of a service you must set the appropriate value for "Start" key under the Service registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\<SERVICENAME>

This can be easly done using the InstallAware comand "Write Registry Key".
If you use the command after Apply Install in your script, you must enable the IA Native Engine otherwise the command will fail.

Example:

Code: Select all

Set Variable NATIVE_ENGINE to TRUE
Write Registry Key HKLM\\, 
Set Variable NATIVE_ENGINE to TRUE
For the required value to use with the "Start" key, please refer to MSDN documentation.
Alternatively set as Manual the service using Service manager in Control Panel and then with REGEDIT check which is the required value.

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
tzachk
Posts: 171
Joined: Wed Jul 18, 2012 12:14 am

Re: change service to manual before upgrade

Post by tzachk »

Hi Francesco,

Thanks for the prompt reply.
It seems I mis-explained myself.

I know how to change a service to start manually. What I don't know is where to place the instructions in the MSIcode script.
I'm having a hard time understanding the flow of operations, like:
- Start of install
- Before reboot
- After reboot
- After installer complets
etc.

Regards,
Tzach.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: change service to manual before upgrade

Post by FrancescoT »

Dear Tzach,

if this have to be done during application upgrade and supposing that the service is installed on your target machine, do that just after your update operation and before system reboot command.

If you post your specific script code snippet, I will add the code for you.

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