Page 1 of 1
change service to manual before upgrade
Posted: Wed Jul 18, 2012 12:16 am
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
Re: change service to manual before upgrade
Posted: Wed Jul 18, 2012 8:38 am
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
Re: change service to manual before upgrade
Posted: Wed Jul 18, 2012 11:28 am
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.
Re: change service to manual before upgrade
Posted: Wed Jul 18, 2012 11:37 am
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