Quote from: Dan Gough on May 08, 2024, 02:28:52 AMI have done some further testing around this - if the original source MSI (where it was installed from) and the cached MSI (from C:\Windows\Installer) are no longer available, then trying to uninstall it with just the filename will not work and you'll get a 1612 error.This worked brilliantly! Thanks a lot for your efforts, Dan!
I have just found a much simpler way, which is to add REINSTALLMODE=v to the command line when uninstalling. Any of these will recache the MSI:
msiexec /i app.msi /qn REINSTALLMODE=v
msiexec /fv app.msi /qn
Or you can also add it to the uninstall:
msiexec /x app.msi /qn REINSTALLMODE=v
If you are using PSADT, then you can run:
Execute-MSI -Action Install -Path 'app.msi' -SkipMSIAlreadyInstalledCheck -AddParameters 'REINSTALLMODE=v'
Execute-MSI -Action Repair -Path 'app.msi' -RepairFromSource $true
Execute-MSI -Action Uninstall -Path 'app.msi' -AddParameters 'REINSTALLMODE=v'