cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RonGiA
Level 3

Uninstall Patch for Basic MSI Project

Jump to solution

I have made a Quick Patch for a Basic MSI project. 

Before the patch the product is correctly shown in 'Programs and Feature' with version as Major.Minor.Build.

After patching the product is correctly shown in 'Programs and Feature' with versionas Major.Minor.Build.Patch#.

How do I uninstall the  patch? If I uninstall, it uninstalls the entire product.

Checking 'Allow Patch to be Uninstalled' didn't seem to matter.

Thanks

Labels (1)
0 Kudos
(1) Solution
shunt
Revenera Moderator Revenera Moderator
Revenera Moderator

Hi,

The Windows Installer Engine can't read the 4th field of the Productversion.
Try leaving out the 4th field and incrementing the 3rd field - for example: xx.yy.02
Rebuild, re-apply the new patch to your package and then try to remove it again.

In addition take a look at the MSIPATCHREMOVE property which you can use in a command prompt.
https://docs.microsoft.com/en-us/windows/win32/msi/msipatchremove

View solution in original post

0 Kudos
(8) Replies
shunt
Revenera Moderator Revenera Moderator
Revenera Moderator

Not all patches can be uninstalled - uninstallation of a patch is not allowed if:

- You have packaged a Major Upgrade as a Patch
- If the patch adds a row certain windows installer tables. If it does patch validator (Val0015) will be shown. A full list of these tables can be found here: https://docs.revenera.com/installshield27helplib/helplibrary/Val0015.htm#updatingapplications_1015703954_1068608
- If the patch adds content to the RemoveFile or RemoveRegistry tables. If the patch is designed to remove a file or registry entry that was not included in the original installation package, uninstalling the patch will not restore that file or registry entry.
- If the patch contains SQL script support that was added through the SQL Scripts view, the SQL script will not run during the patch uninstallation.

Hope this helps,
Stuart

0 Kudos

Shunt, Thanks for your quick reply. I  think my patch is able to be uninstalled.

Where would I find the Val0015 message?

When I install my base product the version is xx.yy.zz in 'Programs and Features'.

I install the Quick Patch with:

msiexec /p PatchPackage.msp REINSTALL=ALL REINSTALLMODE=ous

Then the version is xx.yy.zz.01 in 'Programs and Features'.

That seems correct... or should there be a separate line for the patch in 'Programs and Features'? 

Then I uninstall the patch with:

msiexec /package {Product Code of Original Install Package} /uninstall {Revision number of .msp file}.

That uninstalls the entire patched and original package.

How do I uninstall just the patch?

Thanks

0 Kudos

I see this in the build window:

Performing Upgrading and Patching Validation
Val0003: This setup will perform a MINOR upgrade of the referenced previous setup

0 Kudos
shunt
Revenera Moderator Revenera Moderator
Revenera Moderator

Hi,

The Windows Installer Engine can't read the 4th field of the Productversion.
Try leaving out the 4th field and incrementing the 3rd field - for example: xx.yy.02
Rebuild, re-apply the new patch to your package and then try to remove it again.

In addition take a look at the MSIPATCHREMOVE property which you can use in a command prompt.
https://docs.microsoft.com/en-us/windows/win32/msi/msipatchremove

0 Kudos
RonGiA
Level 3

Thanks Shunt.

That got me going. I did find that I am able to keep the 4th field... which is great! Major.Minor.Build.Patch.

I did find the link you posted to be a bit confusing and found this link to be better.

https://docs.microsoft.com/en-us/windows/win32/msi/uninstalling-patches

Thanks again.

0 Kudos

Quick patch oddity when attempting to patch Dynamically Linked files.

Dynamically Linked files appear twice under 'Files', 'Original Setup Files'.

The file will only be patched if I add BOTH of them to 'Files To Patch'.

That works fine for installing the patch... but then the entire patch uninstall fails.

How to handle patching of Dynamically Linked files?

Thanks

0 Kudos
shunt
Revenera Moderator Revenera Moderator
Revenera Moderator


Dynamic File linking will create new components GUIDS and new Key files with each new build.
This breaks the upgrade rules and therefore produces the strange behaviour as we can't delete components/key files with patches/minor upgrades.

You will need to create a Major Upgrade, or try using the Patch Optimization "Previous Package" settings with a Minor Upgrade and then Patch Design.

Hi Shunt,

Thanks for that explanation. I will avoid using dynamic links for our next release.

Best Regards

0 Kudos