Locally upgrade an MSI previously deployed with GPO - Advanced Installer Community
juan.garcia.pardo
Posts: 5
Joined: Wed Mar 23, 2016 8:17 am

Locally upgrade an MSI previously deployed with GPO

Hello,
I have a machine with an MSI installed via GPO with an older version of the software.
Now the user is trying to upgrade said software by running locally the MSI of the new version, but the older one seems not to be uninstall.
In particular, I see that by trying to locally uninstall it, some actions marked with the stage condition "Install" still execute when uninstalling.
The question that I have has two parts:
- Is is possible to uninstall an MSI that was deployed with GPO from the local machine?
- Is it possible to upgrade an old, GPO deployed MSI, with a newer MSI by running it in the local machine?

I've looked through the forum and I found hints that locally upgrading a GPO deployed MSI is not advisable. But is it possible? and how?
Thank you very much in advance for the comments and suggestions.

Best regards,
Juan
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Locally upgrade an MSI previously deployed with GPO

Hello Juan and welcome to our forums,
- Is is possible to uninstall an MSI that was deployed with GPO from the local machine?
Yes this is possible from "Program and Features" applet of Control Panel. However, if the product was deployed with the assign method of GPO deployment, then its GPO deployment will be triggered again every time the machine starts.
- Is it possible to upgrade an old, GPO deployed MSI, with a newer MSI by running it in the local machine?
Yes I think this should be possible if the old and new version of your product have the same installation type. A per-user installation type cannot upgrade a per-machine installation type and vice versa. However, this is not a recommended practice at all. If a product was installed by a GPO, then the product upgrade should still be done by the GPO or at least the GPO should uninstall the installed product before proceeding to the manual installation of the new product version.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
juan.garcia.pardo
Posts: 5
Joined: Wed Mar 23, 2016 8:17 am

Re: Locally upgrade an MSI previously deployed with GPO

Hello Daniel, thank you very much for the help. At the end of this post I'll elaborate why I want to be able to upgrade locally an GPO deployed MSI.
Yes this is possible from "Program and Features" applet of Control Panel. However, if the product was deployed with the assign method of GPO deployment, then its GPO deployment will be triggered again on every time the machine starts.
What I have observed is that if I install the MSI with GPO (assign to computer), reboot, and manually remove it from the control panel, there is a key in the registry:

Code: Select all

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\4013E8F4BBC5D4248B6B68ABD17CD35E
That contains information about the "ProductName", "PackageCode", etc. (this registry key is removed if I remove the MSI directly from the GPO editor).

Rebooting the machine does not install the software again. The culprit seems to be that key, because looking at the log in C:\Windows\TEMP\MSI*.log I can see an error message code 2753 about a file not being marked for installation.
The same error can be observed if I try to manually run
msiexec.exe /x package.msi /L*V uninstall.log
For some reason, I see that uninstalling the package triggers an installation, because in the log I see some lines above this error, that there is an action started configured only in the AIP for installation.
Yes I think this should be possible if the old and new version of your product have the same installation type. A per-user installation type cannot upgrade a per-machine installation type and vice versa. However, this is not a recommended practice at all. If a product was installed by a GPO, then the product upgrade should still be done by the GPO or at least the GPO should uninstall the installed product before proceeding to the manual installation of the new product version.
Both the AIP "Installation Type" and the GPO assignation mode are set to "the machine". Manually upgrading the package seems to work.

The application I'm packaging using Advanced Installer is one that can update itself. In essence, there will be another MSI (created with Advanced Installer) with a newer version downloaded, and the application will try to run it using msiexec, as the local system user (the application happens to have a daemon running as a service). Under normal circumstances, this seems to work (at least in our tests), but the problem arises when, for some reason, the local admin in the machine has uninstalled the application. From that point on, there is no automatic way to recover, because both the GPO installation fails (as commented above), and a manual installation of the MSI fails as well.
And there is where I'm stuck. Many thanks in advance (at least for reading this whole bunch). I'll update the thread as I test further with GPO, and trying to update when no user is logged on.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Locally upgrade an MSI previously deployed with GPO

Hello Juan,

If the admin user uninstall the product from Control Panel or by manually launching msiexec /x, then there should be no problem when redeploying the MSI through GPO or by manually installing it.

Can you please give us a verbose log of such a failing installation to support at advancedinstaller dot com so we can investigate it? Maybe we can find something noticeable.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
juan.garcia.pardo
Posts: 5
Joined: Wed Mar 23, 2016 8:17 am

Re: Locally upgrade an MSI previously deployed with GPO

Hello Daniel, I've just sent an email with the verbose log. I've put some comments in it to try to explain what we've been discussing here.
Thank you very much in advance,

Juan
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Locally upgrade an MSI previously deployed with GPO

Hello Juan,

Thank you for the sent file. I tested your installation scenario and indeed, it seems the problem is caused because the old product was manually uninstalled from local machine (i.e. manually uninstalled from Control Panel).

In this case when the new product version will be installed, the old product features are still seen by Windows Installer as installed (advertised - because there is a GPO configured), but all of their containing components are uninstalled from local machine. Thus during the upgrade installation all the component states (Absent) will be preserved for the new product components too and therefore no file will be installed. This will happen during the "MigrateFeatureStates" standard action.

Also, if you have (in the old product version) any custom action configured to launch an installed file, then during the upgrade installation (during the old product removal part of the upgrade installation) the custom action will fail because its target file is missing from disk (as it was manually uninstalled).

The only solution I can see in this case is to try to remove the GPO you configured for your old product from your domain and then try again to manually install the setup.

Also, in order to prevent such scenarios in the future when deploying your product through GPO you can check the "Disable Remove" option from "Product Details" page so that your product cannot be manually uninstalled.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
juan.garcia.pardo
Posts: 5
Joined: Wed Mar 23, 2016 8:17 am

Re: Locally upgrade an MSI previously deployed with GPO

Hello Daniel,
thank you very much for the answer. I just wonder if there's any chance of overwriting the preservation of the component states, so that the installer will always write those files down. Our installer is pretty simple in the sense that the user cannot select which components will be installed (it installs a service plus some other tools).
Another question that I have regards the difference in behaviour when the user uninstalls the product from the control panel or from command line using msiexec.
  • If they unsintall from control panel, there are a couple of entries left in the registry
    • HKEY_CLASSES_ROOT\Installer\UpgradeCodes
    • HKEY_CLASSES_ROOT\Installer\Products
    which point to the GUID of the product.
  • But if they uninstall from the command line using msiexec, the product uninstalls cleanly (no product keys in the registry, except for the GPO AppMgmt, and they can run the install for the new version (or the older one for that matter) without any problem.
I wonder if there is any way to trigger the second behaviour also from the control panel, or at least, understand why it doesn't behave the same way.
Thank you very much in advance for your help, it's very appreciated.
Best regards,

Juan
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Locally upgrade an MSI previously deployed with GPO

Hello Juan,
thank you very much for the answer. I just wonder if there's any chance of overwriting the preservation of the component states, so that the installer will always write those files down. Our installer is pretty simple in the sense that the user cannot select which components will be installed (it installs a service plus some other tools).
I'm not sure if this will work, but as a try you can skip the execution of the "MigrateFeatureStates" action. Just go to "Table Editor" page and set a flase condition (e.g. 1=2) for the "MigrateFeatureStates" action in the "Install ExecuteSequence" amd "InstallUISequence" tables. Please note that the "Table Editor" feature is available only starting with an "Enterprise" or higher project type.
Another question that I have regards the difference in behaviour when the user uninstalls the product from the control panel or from command line using msiexec.
If they unsintall from control panel, there are a couple of entries left in the registry
HKEY_CLASSES_ROOT\Installer\UpgradeCodes
HKEY_CLASSES_ROOT\Installer\Products
which point to the GUID of the product.
But if they uninstall from the command line using msiexec, the product uninstalls cleanly (no product keys in the registry, except for the GPO AppMgmt, and they can run the install for the new version (or the older one for that matter) without any problem.
I wonder if there is any way to trigger the second behaviour also from the control panel, or at least, understand why it doesn't behave the same way.
I'm not so sure why this happens. Can you replicate the behavior on a clean machine too? I've tested the scenario on a Windows 8.1 clean machine, but the related entries under "UpgradesCodes" and "Products" registry zones were deleted every time I uninstalled the product from Control Panel.

Can you please send us the .aip (project file) to support at advancedinstaller dot com so we can investigate its settings?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
juan.garcia.pardo
Posts: 5
Joined: Wed Mar 23, 2016 8:17 am

Re: Locally upgrade an MSI previously deployed with GPO

I have sent you the project, the generated MSI and an installation log.
Unfortunately skipping MigrateFeatureStates seemed not to work :(
I'm out of ideas.
Many thanks in advance, and best regards,

Juan

Return to “Common Problems”