control windows service - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

igi
Posts: 47
Joined: Tue Nov 15, 2011 3:45 pm

control windows service

Hi,

I've already asked Bogdan in another thread but I think it will be better to open an new topic. Thank you.

Here is my problem:
I defined an installer with prerequisites as chained packages. If one specific chained package will be updated or uninstalled and os is 64 bit, then the windows service "spooler" must be stopped before uninstall of this chained package. On end of update/uninstall the "spooler" service must be started again befor the main installer ends.
How can I solve it?

Best regards,
Igor
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: control windows service

Hi Igor,

If that chained package upgrades or uninstalls on a windows service, then the service operations should be controlled from that package.

For example if an installation package removes a service, it must also stop it first. Also, if a package installs a service, it has to start it afterwards.

During an upgrade, the old version is uninstalled and then the new version is installed. If that chained package is built with Advanced Installer this behavior is handled automatically (service control operation).

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
igi
Posts: 47
Joined: Tue Nov 15, 2011 3:45 pm

Re: control windows service

Hi Mihai,

the chained package is a third party software. I dont have any access to the MSI. The package doesn't install/uninstall any service. It's a virtual printer driver (like PDF printer). Sometimes and only on my 64 bit workstation a get the message on uninstall of this package that the printer service (spooler) should be stopped before continue.
So my idea was to stop the service on begin of the maintenance and start it on end. I can stop the service with custom action (EXE with working directory - "net stop spooler") in main package. But how to start it again if main installer ends?

Regards,
Igor
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: control windows service

Hi Igor,

You can try using "sc.exe" utility with a "Launch File or Open URL" custom action to launch the command line that starts the service at the end of install:
How do I launch a CMD or BAT file?

You should set this custom action with "Commit, with no impersonation" and sequence it after "Install Execution Stage" -> "Add Resources" action group.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”