Mike.Bryant
Posts: 8
Joined: Fri Apr 17, 2020 7:05 pm

Installer removes app when starting up

Wed Jun 03, 2020 7:10 pm

I have an installer which is working well when I first use it. When I run the program a second time I expected to go into maintenance mode and allow the addition of options. Unfortunately what I'm seeing is it remove all files before even the Prepare dialog comes up. I have verbose logging turned on but I don't see any mention of "remove" or "uninstall" in it. I do see one item that is a bit curious where it says "No matching ProductCode found in database". The product is definitely installed and the code in the log matches the ID in the project. Even uninstall isn't horrible with the exception that I have code defined to run during uninstall which never gets run. If I go into Apps & Features and select "Modify", I DO get the maintenance dialogs as expected.

So, I must be missing some configuration setting in my project but my internet searches are not helping me out. What would cause an installation to uninstall the existing program automatically before the very first dialog is displayed?

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

Re: Installer removes app when starting up

Thu Jun 04, 2020 11:02 am

Hello Mike,

What you are describing is how a major upgrade works - the older version is uninstalled and then it proceeds with installing the newer version.

The major upgrade is achieved in two steps:

1. the package must be having a higher version that the one already installed. For instance, if version 1.0.0 is already installed, in order to perform a major upgrade, a higher version must be deployed (e.g. version 2.0.0, 1.0.1, etc.).

2. the new package has a different ProductCode than the one already installed.

In Advanced Installer, if you increase the version of your product and then try to change views, you will be prompted with this message:

GenerateProdCode.png
GenerateProdCode.png (16.29KiB)Viewed 3297 times

The reason for this is because two products having the same ProductCode can not be installed on the same machine. When trying to do so, Windows Installer will prompt you with the following message:

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.



In Advanced Installer, you can see more information (e.g. Name, Version, etc) about the version of your product in "Product Details" page --> "Product Details" tab --> "Version" field.

Additionally, you can also see the ProductCode of your product in "Product Details" page --> "Product IDs" tab --> "ProductCode" section.

In what regards the already installed application, we will need to retrieve this information manually.

For instance, the installed version can be seen from "Control Panel", but unfortunately the ProductCode can not.

In order to retrieve more information about your product, you can open a PowerShell window, and proceed as it follows:

ProdInfo.png
ProdInfo.png (79.58KiB)Viewed 3297 times

Where the "IdentifyingNumber" attribute is the ProductCode.

Hope this helps.

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

Mike.Bryant
Posts: 8
Joined: Fri Apr 17, 2020 7:05 pm

Re: Installer removes app when starting up

Thu Jun 04, 2020 8:12 pm

I'm running the EXACT same install program both times so I don't understand how it could see the second run as a Major upgrade. I am not seeing any message about another version of the product being installed. The remove message flashes by very quickly and then shows the preparing to install progress bar.

When the app is removed in this manner it doesn't look like it is considered an uninstall from the aspect of running custom actions. I have a database backup as part of my uninstall but I don't see this action being done.

FWIW, I'm running Advanced Installer 13.1. I've tried both a manual product version as well as one coming from the installed executable. I've tried regenerating the Product ID and then doing a clean install and then attempt a second install expecting it to show Modify but I'm still seeing the "major upgrade" behavior.

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

Re: Installer removes app when starting up

Fri Jun 05, 2020 10:26 am

Hello Mike,

This is indeed really strange.

In order for me to further investigate this, could you please forward me the following resources:

- a copy of the .AIP file

- a download link for the setup (built with the above .AIP file)

- a verbose log of the second installation process (when you launch the setup again)

by e-mai at support at advancedinstaller dot com?


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

Mike.Bryant
Posts: 8
Joined: Fri Apr 17, 2020 7:05 pm

Re: Installer removes app when starting up

Mon Jun 08, 2020 2:58 pm

I've sent an email to your support with your name in the subject header.

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

Re: Installer removes app when starting up

Wed Jun 10, 2020 2:02 pm

Hello Mike,

Thank you for the provided files.

I was indeed able to reproduce the behavior with the provided executable. It was at that moment it clicked for me what the problem may be.

First of all, from the log file, it looks like the "RemoveExistingProducts" action is executed.
MSI (s) (54:6C) [09:54:34:453]: Doing action: RemoveExistingProducts
Action 9:54:34: RemoveExistingProducts. Removing applications
Action start 9:54:34: RemoveExistingProducts.
In the above provided link, you can see that this action should only execute during an upgrade operaiton. However, the log file didn't contain any hint that an upgrade would be performed.

Upon further investigation of the .AIP file, I have noticed that you have the "Uninstall a package with the same version (if found)" option checked.

You can find this option in "Builds" page --> "Bootstrapper Options" section.

Please uncheck it and let me know if everything works as expected.

Hope this helps.

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

Mike.Bryant
Posts: 8
Joined: Fri Apr 17, 2020 7:05 pm

Re: Installer removes app when starting up

Wed Jun 10, 2020 4:37 pm

That fixed my problem!
Thank you very much!

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

Re: Installer removes app when starting up

Thu Jun 11, 2020 9:56 am

Awesome news, Mike!

I am glad everything works as expected now.

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

Return to “Common Problems”