SimHorizon
Posts: 44
Joined: Sun Jan 31, 2021 7:11 am
Contact:  Website

Updater issue when uninstalling?

Fri May 14, 2021 11:20 pm

When a new version is detected the updater notifies and is launched ... this is working well.

I'm assuming a Updater process is considered as "Upgrades" ... where my Upgrades are set:

Automatic upgrade older product version
Use Original installation path when upgrading
Uninstall old version first and then install new version

My Custom Action on Uninstall, Regular Uninstall, Replace by a New Version is working with condition = (Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" )). Custom Action is defined for "Uninstall" and is located in the Install Execution Stage (confusing) between "Paths Resolution" and "Preparing" ... it needs to run before any files are actually removed by the AI uninstall process.

The problem is when the updater executes, I'm getting prompted for the "Modify, Repair, Remove" Dialog ... I don't want this option to display when I'm running an "Updater" (which I assume is the same as "Upgrade").

How do I prevent this and also make sure my Custom Action still works during an "updater/upgrade". Or am I not understand the relationship between "Updater" and "Upgrades" in AI?

Thoughts?

Cheers, Rob.

SimHorizon
Posts: 44
Joined: Sun Jan 31, 2021 7:11 am
Contact:  Website

Re: Updater issue when uninstalling?

Sat May 15, 2021 1:29 am

Now I seem to be stuck with a message that says:
MoreRecentVersionAlreadyInstalled.jpg
MoreRecentVersionAlreadyInstalled.jpg (16.41KiB)Viewed 2987 times
Which doesn't make any sense? The updater finds a more recent version. I ok the update and when the uninstall starts I get the above error?

Kinda stuck ... manual uninstall doesn't solve the problem either.

Thoughts?

Cheers, Rob.

SimHorizon
Posts: 44
Joined: Sun Jan 31, 2021 7:11 am
Contact:  Website

Re: Updater issue when uninstalling?

Sun May 16, 2021 12:41 am

I was able to resolve this problem, apparently when I did "Save As" on my original AIP project and gave the project a different name something must have changed with the GUIDs??

Anyway, I went back to building the installer from the original .AIP project and that message no longer appears during an update.

HOWEVER, the updater is now prompting me for the "Modify, Repair, Remove"?
AIUpdating1.jpg
AIUpdating1.jpg (42.89KiB)Viewed 2976 times
No idea why?

The user should NOT be getting any prompt when via the Updater process. If I select "Remove" that will trigger an error:
AIUpdating2.jpg
AIUpdating2.jpg (29.48KiB)Viewed 2976 times
IMPORTANT: this problem happened on the 2nd update (not the first). In my testing I ran one update test and it went smoothly as expected. In my due diligence I compiled a new version, deployed, my app found update, downloaded, and executed and it was this run where I got the "Modify, Repair, Remove" prompt (which I should NOT be getting on an updater process).

Really frustrated and stuck, any suggestions?

Rob.

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

Re: Updater issue when uninstalling?

Wed May 19, 2021 7:15 pm

Hello Rob,

The "Updater" and the term "upgrade" are indeed correlated. Please allow me to explain them and maybe we can better understand the concepts.

So basically, Windows Installer (the base technology that Advanced Installer is built upon) has two ways of upgrading a setup, those being:

- a major upgrade (we will refer to this as upgrade)

- a minor upgrade (we will refer to this as a patch)

A patch is usually much smaller in size and it consists of the diffs between two packages (an MSI is basically a database). After diffing two MSIs (e.g. version 1.0.0 and 1.0.1) the changes will be saved into the patch file (MSP). At install time, the patch basically attaches to the already installed MSI, i.e.: version 1.0.0 is installed --> we apply the patch --> we obtain version 2.0.0.

As I have mentioned earlier, one advantage of patches consists in the fact that it is much smaller in size. However, a disadvantage would be the fact that it can not act like a standalone installation - it is imperative that the older version is already installed.

A major upgrade is considerably larger in size. A major upgrade consists of two steps:

- the uninstallation of the older version

- the installation of the newer version

A major upgrade can act like a standalone installation, i.e. it can either upgrade its' previous versions (e.g. version 1.0.1 upgrades version 1.0.0) or it can be simply installed (e.g. the user installs version 1.0.1).

At a "lower" level, the differences between the two consist of:

- in a major upgrade, the ProductCode is always changed

- in a patch, the ProductCode stays the same

The ProductCode property is a unique GUID used to identify your application. This identifier varies from version to version of the same installer.

It is important to note that two products with the same ProductCode can not be installed on the same computer. Windows Installer will prevent this with an error reading:
Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Programs and Features in the Control Panel.
Now that hopefully these concepts are a bit cleared, let's try to explain the Updater. The Updater is basically a custom .EXE of ours that automates the upgrade/patch process, i.e. instead of you manually providing the upgraded version to your users, you can use the Updater which does that automatically.

Now, let's try to shed some light over the provided information:
My Custom Action on Uninstall, Regular Uninstall, Replace by a New Version is working with condition = (Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" )). Custom Action is defined for "Uninstall" and is located in the Install Execution Stage (confusing) between "Paths Resolution" and "Preparing" ... it needs to run before any files are actually removed by the AI uninstall process.
So basically the installation process consists of two parts - client and server.

In Advanced Installer, these two are represented by "Wizard Dialogs Stage" (client) and "Install Execution Stage" (server).

The "Wizard Dialogs Stage" represents the stage of the installation where the dialogs are spawned.

The "Install Execution Stage" represents the stage where the files are installed (it basically starts when the user presses the "Install" button). To be more precise here, this would be the stage where the system is modified by your setup and the system is modified in both install and uninstall.

Regarding the 'A more recent version is already installed' message:
I was able to resolve this problem, apparently when I did "Save As" on my original AIP project and gave the project a different name something must have changed with the GUIDs??

Anyway, I went back to building the installer from the original .AIP project and that message no longer appears during an update.
First of all, I am really glad you were able to solve this.

Secondly, you are right about the GUIDs. I have explained why this is happening in the following thread:

A more recent version of xxxx is already installed on this computer.
HOWEVER, the updater is now prompting me for the "Modify, Repair, Remove"?
The dialog you are prompted with means that the setup was launched in Maintenance Mode.

There are two ways of launching your setup in Maintenance mode:

- from Control Panel by selecting your setup and clicking on the "Change" button

- when you launch the same setup that was already installed

In our specific scenario, only the second option is viable. This basically means that the Updater downloads the exact same version of your setup.

In more technical terms, this means:

- the same version

- the same ProductCode

As explained above, the ProductCode is used to identify a product. Windows (and more specifically Windows Installer) will consider two products having the same ProductCode the same product, even if they are totally different products.

We can end up in this situation by having a wrong condition and an incorrect criteria set in the "Update Installed Detection" tab of your "Updates Configuration" project.

Basically, the updater will check the wrong criteria --> will think that an update is indeed available --> will prompt the user --> will then download the wrong version (most likely, the URL you have provided points to the same version) --> when the same version will be launched, the setup will enter in Maintenance Mode.

Hope this helps!

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

SimHorizon
Posts: 44
Joined: Sun Jan 31, 2021 7:11 am
Contact:  Website

Re: Updater issue when uninstalling?

Wed May 19, 2021 9:39 pm

Hi Catalin,

Thank you for the detailed response, very helpful.

I have it working as expected an as you pointed out it's likely I had the wrong version information in the update configuration file which triggered an update and since they were actually the same versions it triggered "maintenance" mode.

On to another issue, when I enter a custom path during installation, my application files are not being installed into that user custom location? They are always being installed into C:\Program Files\MyAppName. My understanding is APPDIR should be assigned the path the user entered during initial installation?

BTW, love the new Forum layout and default text.

Cheers, Rob.

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

Re: Updater issue when uninstalling?

Thu May 20, 2021 5:14 pm

Hello Rob,

Thank you for your followup on this!

I am glad to hear everything works as expected now.

Regarding your question, please note I have answered your other forum thread here:

Not installing into user input path?

P.S.: I am glad to hear you enjoy the new theme! :)

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

Return to “Common Problems”