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!

Shorty
Posts: 5
Joined: Wed May 24, 2017 9:18 am

Upgrade issue for service and app (AI 11.5.1)

Hello,

I'm using AI 11.5.1 for building the Setup project.

I have a windows service which controls an app. So at the time of upgrading the system (app and service) I need to stop the service (app gets finished by the service) and install the new system. But my AI project is not able to stop the service.

I setup the project as described under the Upgrade section of your website. I have a new product code and also set the "Automaticcally upgrade older product version". At upgrade page I checked the stop and delete checkbox at uninstall. Also I added custom actions to stop the service. If I run the project the service doesn't get stopped and I cannot run the upgrade as intended.

Any ideas whats going wrong?

Regards,
Karsten
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Upgrade issue for service and app (AI 11.5.1)

Hello,

In order to stop a service when the application is uninstalled from an upgrade you should take the following steps:

1. Go to "Custom Actions" Page and create a new "Stop Service" custom action with sequence. Place it after "Preparing" in "Install Execution Stage"
2. Enter the name of the service in "Service name" field.
2. Click [...] button on the right of the condition field and select "Application is being uninstalled by an upgrade" condition.

The following condition will appear in the "Condition" field:

Code: Select all

 (UPGRADINGPRODUCTCODE)
Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Shorty
Posts: 5
Joined: Wed May 24, 2017 9:18 am

Re: Upgrade issue for service and app (AI 11.5.1)

Hello Sorin,

I tried your recommended setup but unfortunately it didn't work.

I investigated a bit further. I install my *.msi with the service and app where the service after completed installation starts and afterwards controls the app. With the same *.msi I can repair, modify and remove the system as long I don't use the condition at the Custom Action.

As soon I change one thing on the setup after installation, i.e. move the position of the custom forth and back, it's not working any more.

It seems the setup / installer doesn't get access to the service anymore. How could I check if it is maybe a permission problem or what happens to the Custom Action of Stop Service? Verbose logging starts too late for that because the Stop Service Custom Action is placed in the beginning of the Wizard Dialogs Stage.

Regards, Karsten
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Upgrade issue for service and app (AI 11.5.1)

Hello,
I tried your recommended setup but unfortunately it didn't work.
Please take a look on the way our sample .AIP projects (old and upgrade) are configured for your scenario. These will install a sample Windows service (winservicesample.exe)
It seems the setup / installer doesn't get access to the service anymore.
Please make sure that the service name is configured correctly in the StopService custom action.
How could I check if it is maybe a permission problem or what happens to the Custom Action of Stop Service? Verbose logging starts too late for that because the Stop Service Custom Action is placed in the beginning of the Wizard Dialogs Stage.
The Stop Service action will be logged even if it is placed in the begining of Wizzard Dialogs stage. The log entry will have the following form:

Code: Select all

Doing action: StopServices
Also, by leaving "Fail installation if custom action returns error" option checked in the StopService Custom Action page, the install will not complete succesfully if the custom action fails.

If this doesn't help, please send us us both the .AIPs (old and upgrade) to support at advancedinstaller dot com so we can investigate them.

Best regards,
Sorin
Last edited by Sorin on Wed Jun 07, 2017 7:43 am, edited 1 time in total.
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Shorty
Posts: 5
Joined: Wed May 24, 2017 9:18 am

Re: Upgrade issue for service and app (AI 11.5.1)

Hello,

could you please resend the sample with the Upgrade project in AI 11.5.1? I cannot open it otherwise.

Thanks,
Karsten
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Upgrade issue for service and app (AI 11.5.1)

Shorty wrote:Hello,

could you please resend the sample with the Upgrade project in AI 11.5.1? I cannot open it otherwise.

Thanks,
Karsten
Sure! Here it is.

Best regards,
Sorin
Last edited by Sorin on Wed Jun 07, 2017 7:43 am, edited 1 time in total.
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Shorty
Posts: 5
Joined: Wed May 24, 2017 9:18 am

Re: Upgrade issue for service and app (AI 11.5.1)

Hi Sorin,

I send you a mail.

Regards,
Karsten
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Upgrade issue for service and app (AI 11.5.1)

Hello Karsten,

Please take a look on the attached sample, made in Advanced Installer 11.5.1 Professional.

In this sample we used a Launch File to stop the service, as we continue to investigate if our predefined stop service custom action is not working as expected.
This launch file custom action lanches sc.exe system tool with stop parameter for the sample service.

If you want to stop the service from the upgrade package, the condition will be :

Code: Select all

OLDPRODUCTS
The OLDPRODUCTS property is resolved if the current installation found an earlier version of the product.
UPGRADINGPRODUCTCODE is resolved if the installation is upgraded by a newer version.

Best regards,
Sorin
Attachments
sample 11.5.1 professional.zip
(9.75 KiB) Downloaded 605 times
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Shorty
Posts: 5
Joined: Wed May 24, 2017 9:18 am

Re: Upgrade issue for service and app (AI 11.5.1)

Hi Sorin,

thanks very much.

It works now for an upgrade, but uninstalling the upgraded product doesn't stop the service anymore. Do you have any hints?

Regards,
Karsten
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Upgrade issue for service and app (AI 11.5.1)

Hello Karsten,

If you want to stop the service at uninstall please configure the Launch File custom action as shown in the attached screenshot.
Please note that the OLDPRODUCT condition is redundant as the "sc.exe" launch file custom action could be executed even if the service is not installed on the machine, if the "Fail Installation if custom action returns an error" option is unchecked.

Please make sure that while keeping Shift key pressded, you drag and drop the launch file custom action from the "Wizard Dialogs Stage" to "Install Execution Stage". Then, you should go to the custom action from "Install Execution Stage", click Advanced execution scenarios and select "Skip action in Install Execution Stage if executed in Dialogs Stage". This is necessary as the uninstall by an upgrade is triggered in silent mode.

Best regards,
Sorin
Attachments
screenshot.jpg
screenshot.jpg (125.68 KiB) Viewed 7726 times
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”