I have an application that insists that the previous version be removed before the new one can be installed. My cunning plan was to provide the GUIDs for the new version and the previous version and attempt to uninstall each of them, like so:
Why are you passing the GUID of both the old and new MSI to the foreach loop? Why not just use the display name to remove the old? And just use the path to the new MSI file?
I’ll tell you why am I passing the GUID. Since the Execute-MSI has an Action parameter, the thought of looking for another command that actually does what I want, never occurred to me. TL;DR I’m a fool!
Jim, I want to thank you for your answer. This week has been fraught with answers (in other forums) that, while technically answers, were not answers to the questions I asked. You, on the other hand, gave me exactly what I needed. If I could up-vote you, I would.
Good day! You must remove the old version 7z 9.20, before installing the new version 18.06. The problem is that the installer of version 9.20 is packed with NSIS, and the new version is installed through the MSI package. How can I correctly remove the previous version of the software, can I do this? Thanks
To remove older version which is NSIS file , you need to use uninstall string of installer . For this use Execute-Process and pass the required .exe name (using makensis or installer maybe) with uninstall switch. You cant use Remove-MSIApplications to remove NSIS file. This function only removes MSI applications matching with specified app name provided the uninstall string matches “msiexec”.