Managing Service Actions During Installer Upgrades - Advanced Installer Community
Tillu333
Posts: 5
Joined: Wed Feb 28, 2024 5:40 am

Managing Service Actions During Installer Upgrades

Hello,

I'm experiencing a couple of issues with my Advanced Installer projects regarding service management during upgrades. Here are the details:

Unexpected Execution of DeleteServices:

Although I've removed the DeleteServices action from the table editor section under InstallExecuteSequence in my Advanced Installer project, it continues to execute during the installation process. Below is a snippet from the log indicating its execution:

Code: Select all

SI (s) (6C:98) [11:09:09:770]: Doing action: StopServices
Action start 11:09:09: StopServices.
Action ended 11:09:09: StopServices. Return value 1.
MSI (s) (6C:98) [11:09:09:786]: Doing action: DeleteServices
Action start 11:09:09: DeleteServices.
Action ended 11:09:09: DeleteServices. Return value 1.

I have added the condition "(VersionNT) AND (NOT Installed)" to the InstallServices action in the InstallExecuteSequence table. The purpose of this condition is to ensure that services are installed only during new installations and bypassed during upgrades.
Reason for Setup:

I am aiming to preserve existing service configurations, especially the "Log On As" settings, during upgrades to avoid altering configurations unnecessarily.

Additionally, I'm facing a similar challenge in another installer project related to IIS configurations. During upgrades, I want to maintain the existing IIS settings and avoid resetting them to default values.

Steps Taken:
  • Removed DeleteServices.
  • Set conditions for InstallServices for new installations only.
  • Ensured builders are updated with the latest changes.
  • Verified custom actions that might overlap.


Despite these steps, I'm encountering unexpected behaviors and seek guidance on how to resolve these issues effectively.

Any insights or suggestions on resolving these two challenges would be greatly appreciated.

I'm using Advanced Installer 19.3
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

Re: Managing Service Actions During Installer Upgrades

Hello and welcome to our forums,

In the "Services" page, under "Control Operations" for the said service, you can set it to not "stop" and "delete" during uninstall.

This should ensure the service is not stopped and removed during an uninstall (which happens during an upgrade - the upgrade basically being the uninstall of the previous version and the install of the newer version).

This way, the service credentials should be kept between the two versions.
Although I've removed the DeleteServices action from the table editor section under InstallExecuteSequence in my Advanced Installer project
Please note that deleting a standard action is not possible. At most, you can condition it with a condition that is never true (e.g. 1=2).

Re: Update service without changing its logon details
Additionally, I'm facing a similar challenge in another installer project related to IIS configurations. During upgrades, I want to maintain the existing IIS settings and avoid resetting them to default values.
Could you please have a look over the following article and let me know if it helps?

How to preserve customizations between IIS updates in just one-click

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Tillu333
Posts: 5
Joined: Wed Feb 28, 2024 5:40 am

Re: Managing Service Actions During Installer Upgrades

Thanks Catalin

I have unchecked 'Delete' for the service control operations. I have left 'Stop' checked because It's not allowing me to leave all the boxes unchecked also I don't mind stopping the services.

For the actual uninstallation process if I add custom actions to uninstall the services, won't these actions come into play during upgrades (which is basically uninstall and re-install)?

With the IIS Configuration, would the setting "Always" for preserve client customisations work if the previous installation of the webapps/website is not through the Advanced Installer built installers? until now we were using few scripts to Install the webapps
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

Re: Managing Service Actions During Installer Upgrades

Hello,

Apologies for the quite delayed reply on this!
For the actual uninstallation process if I add custom actions to uninstall the services, won't these actions come into play during upgrades (which is basically uninstall and re-install)?
Very good point, here. However, there are ways to differentiate between an upgrade and a normal uninstall.

Under "Execution Stage Condition", if you click on the "Show upgrade scenarios" hyperlink, you will be able to see the options:
Screenshot_10.png
Screenshot_10.png (10.81 KiB) Viewed 5397 times
With the IIS Configuration, would the setting "Always" for preserve client customisations work if the previous installation of the webapps/website is not through the Advanced Installer built installers? until now we were using few scripts to Install the webapps
Regarding this, I can't say for sure. I would advise installing the webapp manually on a VM and then running the installer to see whether the customizations are preserved.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

Re: Managing Service Actions During Installer Upgrades

You are always welcome!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Tillu333
Posts: 5
Joined: Wed Feb 28, 2024 5:40 am

Re: Managing Service Actions During Installer Upgrades

Hi Catalin, just one more thing

for our services we have quotes to path to executable. for this, we have added a custom action to add quotes(PowerShell script to make changes in the registry). with the above suggested configuration, enabling only stop in the services and disabling 'upgrade' in the uninstall service custom action, I'm still unable to retrieve the quotes. we would not want to run the custom action to add quotes again as this results in a pop-up we want to avoid. I have added "NOT Installed" condition for the service (through component) in the services section.

The only way I figured out is to remove the services from 'Services' section have a custom action for installation of service as well and set up a condition only for first time install.

Can you suggest if there's any other way?
Thanks
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

Re: Managing Service Actions During Installer Upgrades

Hello,

I'm afraid your scenario is not quite clear for me now.

Could you please give me some more details, and perhaps exemplify through some screenshots so I can better assist here?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Tillu333
Posts: 5
Joined: Wed Feb 28, 2024 5:40 am

Re: Managing Service Actions During Installer Upgrades

Hello Catalin,

Here is my current scenario

Our goal is to manage silent installations and upgrades using Advanced Installer while minimizing user interaction. Below is a detailed breakdown of our current scenario and the issues we’re facing.

Installation Process Overview:
For our silent installation process, we utilize a PowerShell script that effectively passes all necessary MSI parameters to our installer. The services involved are configured through the Services section within Advanced Installer. Post service installation, we have implemented a custom action that adds double quotes to the executable path of these services. This custom action involves running a .reg file, which necessitates a pop-up that users must acknowledge to proceed with the installation.
reg.png
reg.png (83.41 KiB) Viewed 3283 times
pathtoexecutable .png
pathtoexecutable .png (16.64 KiB) Viewed 3504 times
Considerations for First-Time Installation:
During the initial installation phase, we are fine with user interaction via the pop-up triggered by the .reg file. User acknowledgment in this phase is acceptable, allowing the installation to progress smoothly.

Challenges During Upgrades:
Our main challenge surfaces during upgrades, where we aim to prevent this pop-up from appearing, ensuring the upgrade process remains entirely silent. This need for silence conflicts with the pop-up generated by the custom action we use for quoting the path during initial installs.

Modifications for Upgrades:
To streamline the upgrade process, we decided to remove the custom action from the upgrade sequence, relying on the fact that the quotes would already have been applied during the first installation. However, we need to ensure that these quotes persist through the upgrade without invoking user interaction.

Service Management Adjustments:
Regarding service management, I made some changes to the uninstall behavior. Based on earlier suggestions, I have unchecked the "Delete on uninstall" option in the Services section under Control Operations to maintain service configuration after uninstall. Additionally, I added a custom action to specifically handle service uninstallation only during a full uninstall, not during an upgrade.
controloperations.png
controloperations.png (32.3 KiB) Viewed 3504 times
Questions and Needed Guidance:

I am seeking further advice on optimizing our service configuration process during upgrades, as I've discovered an interim workaround for retaining service path quotes without triggering user interaction. Here’s the solution I've implemented and my remaining queries:

Workaround Implemented:
To maintain the double quotes in service paths through upgrades, I've removed the service configuration from the Services section and added a custom action to install the service only during the first-time installation. While this method ensures the quotes and logon credentials are retained in upgrades, I consider it a workaround, and I personally may not recommend it as a long-term solution.

Seeking Best Practices:
I am interested in learning about more robust methods or best practices within Advanced Installer for managing silent upgrades efficiently and effectively under these circumstances.
Further Optimization:

Any additional insights, experiences, or strategies that could enhance the upgrade process while maintaining service configuration integrity would be greatly appreciated.
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

Re: Managing Service Actions During Installer Upgrades

Hello,

First of all, thank you for the detailed explanation.

If I understand correctly what you want to achieve (i.e. a silent installation without UAC), please note that we have predefined support for this.

How to handle updates without elevation

Advanced Installer offers a 3rd party tool (created by us and it comes bundled with Advanced Installer) called updater.

With this tool, you can create automatic updates. Basically the updater will download the new MSI from your server and launch it with whatever command line you need (like you do currently with the PowerShell script).

Normally, you need to be prompted with the UAC at each installation (if the installation is done per-machine).

However, using the first mentioned approach, you will need to install it with admin rights only once, then the admin rights will no longer be required because the updater tool will run as a service and therefore elevated already.

Hope this helps!

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

Return to “Common Problems”