Service will not stop - Advanced Installer Community
ruck64
Posts: 57
Joined: Wed Jul 24, 2019 8:46 pm

Service will not stop

Okay its been about a week since I last had someone respond to my forum post so I will try here again.
I have a service that I manage myself for most things since the built in service handler does not work well with our service.
Manual upgrade as I see it. Download the newer version of the MSI and upgrade on your own.

I can uninstall, install, repair, and modify with no issues at all in regards to this issue. However, for whatever reason the service wont stop during upgrade. To perform this stop I use the built-in custom action stopService. Again this works just fine for uninstall. This is causing additional prompts to appear that I am trying to resolve. Remove actually has two issue. One being this one as well.

The issue is if before i run the installer I dont recieve any reboot prompts during manual upgrade

A list of things to know.
I am using professional Edition 16.3
I have set reboot behavior to prompt for reboot when required and perform the reboot if required without showing any prompts
I have set it to surpress all reboots and reboot prompts and prompt for reboot when required

The stopService customaction is ran just before searches. I have also tried before path resolution. However, the prompt to reboot happens after searches. So using my own batch file I may be able to stop the service but it would be pointless as it already has occured. I also make a call to stopService from the start of dialogs. These last few setups are from your webiste directly on stopping a service.

Heres what happens,
Actual:
I download new msi.
I start process of MSI
I go through dialogs of MSI
I give admin privleges
it prompts for reboot and then again a second prompt to reboot
(My thoughts are that this is kicking off install and uninstall close together)
It then restarts the service through a stop and start.

Expected:
Download MSI
start MSI
go through dialogs
give admin
it finishes upgrade
I click finish

What I can do to make expected reality.

Download MSI
start MSI
go through dialogs
-------> Manually stop the service
give admin
it finishes upgarde
i click finish

The custom action does fire and does return a return code of 1. However, from watching the service through two different methods I say no visible change it ever stopped.

Which also begs the question on top of how to I get it to actually stop. How does the stopservice custom action work. Do you guys use net, or sc, or some other method
Last edited by ruck64 on Thu Sep 26, 2019 7:31 pm, edited 1 time in total.
ruck64
Posts: 57
Joined: Wed Jul 24, 2019 8:46 pm

Re: Service will not stop

I have emailed multiple .aips over to you guys and if needed I can email more out. Its just been a week and there has been no solution to this
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Service will not stop

Hello Luther,

First of all, please accept my apologies for the delayed reply.
The issue is if before i run the installer I dont recieve any reboot prompts during manual upgrade
So you are saying that you get the reboot prompts when trying to update through the updater tool?
The stopService customaction is ran just before searches. I have also tried before path resolution. However, the prompt to reboot happens after searches.
The reboot prompt happens during the "InstallValidate" custom action.

InstallValidate - verifies that all volumes to which cost has been attributed have sufficient space for the installation. It also notifies the user if one or more files to be overwritten or removed are currently in use by an active process.
it prompts for reboot and then again a second prompt to reboot
Right after the "InstallValidate" standard action, the "RemoveExistingProducts" standard action kicks in. This action upgrades an older version of the package if one is found.
The custom action does fire and does return a return code of 1.
This means that the custom action successfully ended and the service should have been stopped.
However, from watching the service through two different methods I say no visible change it ever stopped.
How have you tested this? For instance, I would test this using a message box placed right after the "StopService" custom action (this custom action is used to basically stop the installer from continuing). Right when the message box is spawned, check the services manager.
Which also begs the question on top of how to I get it to actually stop. How does the stopservice custom action work. Do you guys use net, or sc, or some other method
For this, we use the native Windows API which indeed, on its own, uses "sc.exe" tool.

In order for me to further investigate this, please forward me the following:

- the .AIP file used to build the older version

- the .AIP file used to build the newer version

- a download link for both versions of your setup

- a detailed test-case which reproduces this issue

Looking forward to hearing from you.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”