during service upgrade: skip feature selection and uninstall/reinstall - Advanced Installer Community
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

during service upgrade: skip feature selection and uninstall/reinstall

Hi all,

I know that upgrading means uninstall and then install back again but I have a special request here to ask to you.
I have a setup which installs two services, allowing the user to select them with a ConfigureDlg and asking for service user credentials in with a specific dialog.

During an upgrade we'd like to:
1. avoid the uninstall of the already installed services and their reinstall: stop services, copy new files and restart services would be enough
2. the ConfigureDlg should list the services but allowing the user to select the ones not installed: the checkboxes of the ones already installed should be flagged but disabled

Is this possible somehow?
Thanks a lot in advance
Silvio
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: during service upgrade: skip feature selection and uninstall/reinstall

Hello Silvio,

If you do not want the service to be deleted upon uninstall, you can go to "Services" page --> under "Control Operations" --> uncheck the "Delete" option from "On Uninstall".

Uninstall.png
Uninstall.png (37.41 KiB) Viewed 4557 times

For the second request, you could use the "Detect Service" custom action and, based on that, disable the checkbox controls of the already installed services.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

Re: during service upgrade: skip feature selection and uninstall/reinstall

Hi Catalin,

thank you for you reply.
For what regards point n.2, how can I disable the features checkboxes? In the ConfigureDlg I cannot see them at design time but only at run time.
More, once I disable them (as flagged) are they still upgraded, right?

Thanks a lot,
Silvio
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

Re: during service upgrade: skip feature selection and uninstall/reinstall

Hi Catalin,

I forgot another doubt on point n.1: if I unflag the "Delete" checkbox, does the uninstall (from the control panel) remove the service? I only want to avoid the delete of the service during the uninstal of an upgrade run.

Thanks again.

Kind regards
Silvio
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: during service upgrade: skip feature selection and uninstall/reinstall

Hello Silvio,
For what regards point n.2, how can I disable the features checkboxes? In the ConfigureDlg I cannot see them at design time but only at run time.
If you want to disable the checkbox which is assigned to your feature, you can do so by going to the "Organization" page --> select your feature --> from under the "Installation Behavior" section, select the "Not installed" option.
I forgot another doubt on point n.1: if I unflag the "Delete" checkbox, does the uninstall (from the control panel) remove the service? I only want to avoid the delete of the service during the uninstal of an upgrade run.
No, if you disable that option, the service will not be deleted upon uninstall.

I believe that, in this case, we can try to condition the standard action that deletes the service to execute only on a non-upgrade behavior. To do so, please proceed as it follows:

- check back the "Delete" option for your service

- go to "Custom Actions" page

- under "Install Execution Stage", right click on any action group --> "Show Standard Actions" --> "Remove Resources" --> click on the "Delete Service" standard action

- condition the action so it does not execute during an upgrade, i.e.:

Code: Select all

VersionNT AND (NOT UPGRADINGPRODUCTCODE)
As you may already know, an upgrade consists of two processes:

- uninstall of the older version

- install of the newer version

The above condition should be added in the older version of your setup, as during the older version's uninstall the "Delete Service" standard action is taking place.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
scambias
Posts: 29
Joined: Tue Nov 19, 2019 3:26 pm

Re: during service upgrade: skip feature selection and uninstall/reinstall

Hello Catalin,

sorry for my very late reply. Tough moments in our company these days...

Anyway, going back to the topic, I've tried your suggestion for topic n.1 (avoid to remove the service from windows while upgrading its files): I found out that the files are not updated.

Let me summarize the topic so you can avoid reading the whole thread :)

I have designed a setup that installs a service using a specific user and password: the user must exist on the machine and the user/pass details are provided using a dialog in the wizard during setup (if the service is not detected only).
During upgrade (UPGRADINGPRODUCTCODE), I would like to avoid providing those details: I suppose the service is installed and running so I would like the service being just stopped, files then overwritten, and then the service started up again. Instead, during proper uninstall, I'd like the files and the service to be deleted at all.

The suggestion you gave on your last post works fine for what regards the uninstall moment: if I uninstall from control panel, the service disappears from window services window. In case of upgrade I've noticed that the files are not overwritten. I can understand this by manually modifying, before upgrading, on a text file belonging to the service files set: after upgrade, this file is the one I modified!

Thank you very much for your kind help :)

Silvio
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: during service upgrade: skip feature selection and uninstall/reinstall

Hello Silvio,

No worries about the late reply.

Hopefuly everything is fine now with your company!

Now, in what regards the encountered problem, thank you for the summary!

First thing I'd like to clarify here is this:
During upgrade (UPGRADINGPRODUCTCODE), I would like to avoid providing those details:
During an upgrade process, there are two properties that are set: UPGRADINGPRODUCTCODE and OLDPRODUCTS. The difference between these two is as it follows:

- UPGRADINGPRODUCTCODE is set in the old setup

- OLDPRODUCTS is set in the newer setup

The UPGRADINGPRODUCTCODE condition would be used if you want to condition an action from the old package, while the OLDPRODUCTS would be used if you want to condition an action in the newer package.

I felt like mentioning this because, in your scenario, those details would be provided during the installation of the newer setup, therefore if you want to condition that somehow, the correct condition would be OLDPRODUCTS.
The suggestion you gave on your last post works fine for what regards the uninstall moment: if I uninstall from control panel, the service disappears from window services window.
I am glad to hear that this works as expected.

The reason we have used the UPGRADINGPRODUCTCODE as our condition here is the fact that the service is removed during the uninstall process of the older version.
In case of upgrade I've noticed that the files are not overwritten.
This is quite strange. Could you please:

- make sure the file in subject does not have the "Do not overwrite existing file" option set? To do so, please go to "Files and Folders" page, select the file that is not overwritten --> right click on it --> "Properties" --> "Operations" tab.

- make sure that the component associated with your file does not have the "Never Overwrite" or "Permanent" attributes. To do so, please go to "Files and Folders" page --> select your file --> right click --> "Go to component".

Normally, the file should be removed and then added again in the newer setup. Beside the above, I do not quite see why the file would not be overwritten.

Hope this helps!

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

Return to “Common Problems”