Can you run msiexec.exe uninstall of another software simultaneously? - Advanced Installer Community
bloo
Posts: 9
Joined: Tue Aug 20, 2019 10:23 am

Can you run msiexec.exe uninstall of another software simultaneously?

Hi,

I am working with a client, and need to provide some sort of way of uninstalling old software through group policy.
It is an msi given to them by some other company, and it needs to be replaced with a new one, which we made.
Anyway, I have managed to make a .bat file which does all that, but they said it does not run in group policy, it is just copied to the desired location and asked if we can make one project (msi) for those two things - uninstall, and a new msi.
Of course, .bat uninstall file calls msiexec.exe with the product code, so it cannot run that way and we told them that; (probably there is a way to call that script anyway, but well..)
I've seen msiexec.exe command line possibilities in your documentation, but didn't quite understand how to use it?
If you could explain?
Is it possible?
Thank you in advance
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Can you run msiexec.exe uninstall of another software simultaneously?

Hello,

I think that for this scenario you can make use of the "Upgrades" section from the "Upgrades" page.

In this section you can specify other products that will be upgraded when your package will be installed. Note that these packages must be MSI-based, you cannot use this page to upgrade packages which don't use the Windows Installer technology. When you click the [ New... ] button Advanced Installer shows a dialog which allows you to select the target installation package from the disk.

If in that dialog, you click "Cancel", it will allow you to customize your own upgrade scenario (in the "New Upgrade" dialog). This dialog has two tabs: "Product Info" tab and "Upgrade Action" tab. Please have a look on the following two articles for more information about this:

- Product Info Tab

- Upgrade Action Tab

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bloo
Posts: 9
Joined: Tue Aug 20, 2019 10:23 am

Re: Can you run msiexec.exe uninstall of another software simultaneously?

Thank you very much!
I managed to build it, but I have a new problem:

My application has x32 and x64 version. I have to uninstall both of them, while mine is only x32, but its configuration covers both machine types.
So Upgrade action works when I am installing this new msi on 64bit machine, becuse it uninstalls from Program Files, and installs in Program Files (x86);
but fails to install it on x32, because they use the same path in Program Files.
It uninstalls the old one, but doesn't install the new one.

Basically, it is the same software, not much of a different version, but still is different, which I think would maybe complicate things for future changes, since is going through group policy on a large number of workstations? Plus, it has a different configuration.
I assume I cannot reorder path actions.
Theoretically I could use detect and move to feature, instead of removing them? But, then I go back to that version difference, but same path.
I am sorry if these are some basic questions, I am fairly new to all of this, and have a deadline :(

Thank you very much again
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Can you run msiexec.exe uninstall of another software simultaneously?

Hello,
Thank you very much!
You are always welcome.
but fails to install it on x32, because they use the same path in Program Files.
For this, you could simply increase the "Version" from "Product Details" page. After doing so, when prompted with the "Generate a new Product Code?" message, you should select "Generate new".

This way, your setup will automatically search and uninstall previous versions of your application.

Please have a look on our "Product Identification" article for more information about this.

Also, please have a look on our "How to upgrade an older version of your application" article which I also think you may find useful.

Additionally, by doing this, I no longer think it is necessary to use the method I have give you earlier. I gave you that solution because I thought you wanted your setup to uninstall a different software (e.g. when installing your setup, uninstall "Notepad++").

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bloo
Posts: 9
Joined: Tue Aug 20, 2019 10:23 am

Re: Can you run msiexec.exe uninstall of another software simultaneously?

Thank you,

I have tried that too, but applications don't have the same name, and parts of them are different, because the old one was someone else work, but it is created in AI.
Mine is already different, 1.2, the old one is 1.0, they are different in name, but use the same service as a part of installation
Is it possible to do that, or it is mandatory to uninstall old & install new separately?
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Can you run msiexec.exe uninstall of another software simultaneously?

Hello,

Yes, that should still be possible.

Please let me try to explain few things:

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

- Unlike the ProductCode, the UpgradeCode is a GUID representing a related set of products. A set of different versions of your application will have the same UpgradeCode. This enables newer versions of your application to search and upgrade previous versions installed on the same computer.

Following the above explanation, you will need to have the same "UpgradeCode" for both of your setups, so your 1.2 setup can look for and uninstall the 1.0 setup. Additionally, the "ProductCode" should be different.

You can find both of the above properties by opening your project --> "Product Details" page --> "Product IDs" tab.

Also, please have a look on our "Product Identification (ProductCode and UpgradeCode)" article for more information about this.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bloo
Posts: 9
Joined: Tue Aug 20, 2019 10:23 am

Re: Can you run msiexec.exe uninstall of another software simultaneously?

I tried it. Didn't work for me. :(

When I've put the same upgrade code, it would just uninstall the old one, but doesn't install a new one at all.
I've tried with changing the path, and that worked for 32 and 64, and stopped working, for some reason, now it doesn't delete anything.
Part of my msi is another msi, with some WIX variables, which were also set to always set the path to default.
So when I changed that, I think something messed up. Not sure
Also, in the folder of the program I want to uninstall, there are some remains, like some data log folder, but I don't figure that should be a problem, since I have also tried Always overwrite.
So, I don't know...I don't understand why it doesn't work, tried to enable verbose logging also, but there is no log file anywhere
I suppose it should not be this complicated to upgrade or replace a software
Thank you for your help
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Can you run msiexec.exe uninstall of another software simultaneously?

Hello,

That is strange, indeed.

I can not say for sure why the software is not installed after the previous version is uninstalled.

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

- the .AIP file used to build your project

- a download link of the older version

- a download link of the newer version

by e-mail at support at advancedinstaller dot com.

In what regards the fact that you do not find the log file, by default (if you do not give it a certain path), it is generated in the location of the setup.

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

Return to “Common Problems”