1

We found some uninstallation issue on already released msi which is creating issue during upgrade of higher version.I need to modify few custom action conditions so that it doesn't run while msi uninstallation. In order to this, transform file is generated with updated condition. However, I am not sure how to pass this during uninstallation? user can trigger uninstall from Add or Remove Programs.

Minor upgrades are not option for us as it requires release of new msi.

Vivek Jaiswal
  • 861
  • 1
  • 7
  • 20
  • 1
    This is a well-known problem. [Please check this answer](https://stackoverflow.com/a/53876981/129130) (you might have seen it already). – Stein Åsmul Jun 22 '22 at 17:01
  • Can we ask what happens during uninstall? – Stein Åsmul Jun 22 '22 at 17:17
  • It's calling http post request to the server using windows authentication. However, newer version supports modern authentication only. By the time older version uninstallation called, server is already upgraded to modern auth. Also, custom action was set to check return code. – Vivek Jaiswal Jun 23 '22 at 05:31
  • Can you move this functionality to the application itself? I guess it is a web-app? – Stein Åsmul Jun 23 '22 at 06:41
  • Yes. It's a web-app. However, application doesn't have that much of permissions (using RBAC) to perform required changes. – Vivek Jaiswal Jun 23 '22 at 07:24
  • I always suggest using application launch code if you can, since [custom action code is very error prone as described in this rant](https://stackoverflow.com/a/46179779/129130). Application launch code means you have a more familiar debugging context and you have single source benefits. Testing and debugging is much easier and more reliable code results. Impersonation and sequencing issues are usually not present. – Stein Åsmul Jun 23 '22 at 08:10

1 Answers1

0

The locally cached MSI within the Windows folder is a transformed version of your original MSI database, if you installed it together with the MST.

Your custom actions added by MST, if they have no condition set, are always run (on install, repair and removal).

If you want to run your action only on uninstallation, set this as the condition: REMOVE="ALL" or inverted NOT REMOVE="ALL" if it should NOT run on uninstallation.

Try to place your custom action in the Table InstallExecuteSequence between InstllValidate and InstallInitialize or after InstallFinalize

You don't need the MST during uninstallation.

ZAY
  • 3,882
  • 2
  • 13
  • 21
  • Sorry if question is not clear. We had already released msi where we find issue during upgrade to the latest version. Uninstallation of previous version is failing. The above mentioned changes could only be done in latest version. However, I need to perform changes in already installed one. – Vivek Jaiswal Jun 22 '22 at 15:48
  • as far as I know, you cannot transform an uninstallation, that has not been transformed before. Maybe you could update (correct) your current installation with the required custom Actions or Transformations to a new Version in a first step, and then uninstall it in a second step. – ZAY Jun 22 '22 at 15:51
  • Did you mean to change the view of InstallExecuteSequence table of cached msi( to update custom action condition) temporarily during upgrade in a first step? Not sure if it's possible but will give it a try. – Vivek Jaiswal Jun 22 '22 at 15:57
  • 1
    just try to update/correct your existing installation by correcting the stuff in te custom action and execute sequence. then you have an updated cached MSI from the updated MSI version. This one then you can remove the way you like because it has been corrected by the first step. – ZAY Jun 22 '22 at 16:01
  • I can't fix it by adding new custom action in updated msi version. The custom action which is failing is set to check return code and trying to use server API which is not available anymore. – Vivek Jaiswal Jun 22 '22 at 16:08
  • Did you make a real Upgrade to the MSI, like increasing the ProductVersion and changing the ProductCode, handling the Upgrade properly? – ZAY Jun 22 '22 at 17:10
  • Yes. I am handling the upgrade properly. – Vivek Jaiswal Jun 23 '22 at 05:32