Windows Service Silent Updates Failing - Advanced Installer Community
rohan@haloconnect.io
Posts: 2
Joined: Wed Mar 15, 2023 9:01 am

Windows Service Silent Updates Failing

Hello!

We are using Advanced Installer 20.4 to package and distribute a service. Our installation and update process uses the Advanced Installer Update service to update silently across approximately 600 remote servers belonging to our customers (servers we don't manage).
The service is written in .Net Framework 4.8 (not sure if that's relevant) and during our testing, it updates successfully.

However, in the field we are receiving reports of issues that either stop the update from applying to about 10% of our customer's servers, or in rare cases (1% or so) even uninstall the previous version of the service including the update server. As you can imagine, this is proving both confusing and frustrating. Its made more complicated by the fact that its often difficult to reproduce these errors in our test environments.

What we're attempting to do is the following:
  1. If an existing installation of our service is present, stop the service (so that there are no open file handles, thus forcing a reboot)
  2. Copy the new files for our service (exe and dll files)
  3. Install or Update our service in the Windows Service Manager to reference the new exe
  4. Start our service
Below is a copy of our current .aip file (with some private details removed). We feel like we're doing something inappropriate with the aip file to achieve this outcome.

So our questions are:
  1. Is this the most appropriate way to do a service install and update?
  2. If it is, is there a way to ensure an update occurs without a server reboot?
  3. If the update fails, are we doing the right things in the aip to ensure a successful rollback?
Any and all assistance would be appreciated. Thanks in advance!
Attachments
service.aip
Service AIP file (with private details removed)
(82.59 KiB) Downloaded 175 times
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Windows Service Silent Updates Failing

Hello Rohan and welcome to our forums,

Let's recap a bit what a mjor upgrade is. It basically consists of the two following processes:

- uninstall the previous version (e.g. v1.0)

- install the newer version (e.g. v2.0)

Usually, in order to have a better view about what happened during the installation process, we would nee to create a log file of the installation.

The log file can be created using the /L*V - How do I create an installation log?

That would help us investigate and find out why the 10% of the updates fail.
or in rare cases (1% or so) even uninstall the previous version of the service including the update server
If the product is removed from the server, this would indicate that the uninstall finished succsesfully, but something failed during the install of the newer version - thus leaving the machine empty.

Coming back to the log file, since you said you are using our Updater, you could automatically create the log file by passing the log parameter in the "Command line" field. The "Command Line" field can be found by opening the "Updates Configuration Project" --> select the update --> "Update Installer" tab.

Regarding the project file, I've had a brief look over it and everything seems to be configure fine, so I can not really say why this is happening.

If possible, please provide the log file either here or by email at support at advancedinstaller dot com so I can further investigate it and see if I can find the cause of this.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rohan@haloconnect.io
Posts: 2
Joined: Wed Mar 15, 2023 9:01 am

Re: Windows Service Silent Updates Failing

Thanks for getting back so quickly Catalin.

You've helped clarify a few things regarding the upgrade process and logging.

To clarify from our end (since I didn't include the updater project) we're performing our upgrades reasonably simply. Instead of specifying source and target versions, we specify a single target version to update to and the updater service ensures that the version is installed. And as far as we're aware, this treats every update as a major version. Pretty simple!

As for the uninstall/reinstall for the major version upgrades, that was also what we were thinking was happening. We did some work to make sure these two steps were happening in the same preparing phase before a commit. Hopefully, this is apparent in our project file.

I've asked our support team to gather samples of installation log files for some upgrades that I will forward to the address specified above.

Thanks again and talk soon!

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

Re: Windows Service Silent Updates Failing

You are always welcome, Rohan!

Glad to hear my explanation helped you guys.

Sure, once you gather the log files, please send one of them to me so I can have a look over it to see if I can find the culprit.

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

Return to “Common Problems”