Execute-MSI -Patch and Execute-MSP silent install behavior question

According to Microsoft if you’re installing a patch silently, you must also set the REINSTALLMODE property to ecmus and REINSTALL to ALL. Otherwise, the patch only updates the MSI cached on the target device.

Our application vendor states the following string must be used.
msiexec.exe /p “<Full path to .msp>” REINSTALL=ALL REINSTALLMODE=omus /qn

I have looked into the code and cannot find where this is being done or can be done for that matter.
Nor does the installation string in the log reflect these parameters being added.

Is this something that could be added? Perhaps add a new default parameters configuration item for when executing a patch?

Here is information on the REINSTALLMODE property:
https://docs.microsoft.com/en-us/windows/win32/msi/reinstallmode

Here is information on the REINSTALL property:
https://docs.microsoft.com/en-us/windows/win32/msi/reinstall

Have you tried using the PSADT-provided command Execute-MSI with the parameter -AddParameters ?

The default params are “REBOOT=ReallySuppress /QB!”. If you need different params use -AddParameters to add the additional params, or modify the default params by editing AppDeployToolkitMain.ps1

Yes. -AddParameters does work.

But I was suggesting that this become an XML configurable default for the patch parameter per the aforementioned article since it is best practice.

Just a thought for improvement on an already excellent project.

Execute-MSI -Action Patch does not work this way currently and Execute-MSP uses Execute-MSI so no they do not work this way currently.

However, this function does not use the /p option but /update.

Execute-MSI -Action ‘Patch’ -Path $_ -AddParameters ‘REINSTALL=ALL REINSTALLMODE=omus’
Seems to work in version PSADT 3.7.0.

I see the added parameters on the patch string invoked and the properties apply according to the verbose log.

Property(S): REINSTALL = ALL
Property(S): REINSTALLMODE = omus
Property(S): PATCH = C:\Support\Installs\InstallApplication.msp

I am unable to find much of a difference between /p and /update. They both modify the PATCH property. It would seem they are the equivalent like /x is to /uninstall

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

The only thing I can find on MSDN is the below from https://docs.microsoft.com/en-us/windows/win32/msi/standard-installer-command-line-options :

/update [;Update2.msp] Install patches option. Installs one or multiple patches.

[!Note]
The equivalent Windows Installer command line has PATCH= [msipatch.msp]<;PatchGuid2> set on the command line.

I am going to test with 3.8.2 and see if I get the same result.

PSADT version 3.8.2 works as well. I also confirmed in the patch logs that the defined behavior occurs as well too.

Back to the OP.

As stated, Execute-MSP does not have an -AddParmeters parameter and it essentially calls Execute-MSI -Patch.

I thought it would be handy to have a $configMSIPatchParams variable per se loaded from AppDeployToolkitConfig.xml where default PATCH properties can be set.

I dont see an issue with adding -AddParameters for Execute-MSP and I also dont see an issue with adding the variables but both need to be tested. The function already uses default config MSI parameters.

PR:https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/pull/549

Could not get a patch applied to some package called “Dell SupportAssist”. It only accepted “msiexec /p SupportAssistx64-3.10.4.18.msp /qn REBOOT=ReallySuppress /norestart”.
Using process explorer and procomon i found out execute-msi -Action ‘Patch and execute-msp in PSADT will always try using the /update switch and /Qb! instead of /Qn. Running the patch manually it said that it must be running using /qn.

Got around it using: Execute-Process -Parameters “/p SupportAssistx64-3.10.4.18.msp /qn REBOOT=ReallySuppress /norestart” -Path “msiexec.exe” -WorkingDirectory “$dirFiles”