Double Uninstallation command lines are created

We are customizing the Uninstallation default Template provided by App deploy toolkit and as a result, we are seeing double uninstall command.

*) Could someone please confirm when the default Template uninstallation will be executed and when the customized uninstall command will be executed on preference.
*) Do we need to have both uninstall command or can we keep the customized command only ?

Default command:

===============================================## =============================================== ##* UNINSTALLATION ##*=============================================== [string]$installPhase = ‘Uninstallation’

    1. Handle Zero-Config MSI Uninstallations If ($useDefaultMsi) { [hashtable]$ExecuteDefaultMSISplat = @ { Action = ‘Uninstall’; Path = $defaultMsiFile }; If ($defaultMstFile) { $ExecuteDefaultMSISplat.Add(‘Transform’, $defaultMstFile) } Execute-MSI @ExecuteDefaultMSISplat }

Customized uninstall command:

  1. Execute-MSI -Action Uninstall -Path “{C208811C-385C-3C16-BE72-20618CB11F29}” -Parameters “”"%SystemRoot%\System32\msiexec.exe"" /X {C208811C-385C-3C16-BE72-20618CB11F29} /qn"

Hi All,

Did someone get a chance to look into this? Please let me know if any additional info needed. Thanks!

Hello @Jaganath,

I would need to see your Deploy-Application.ps1 to be able to help you. In my experience Zero-Config MSI Uninstall have never produced anything that doesn’t work.

Thanks for the update.

We are replacing our customized Install/uninstall command line under Install/Uninstall task section as shown in the attachment . Is it going to affect the Install/Uninstall process?

The problem i see is that you are trying to pass a commandline to Execute-MSI.
Execute-MSI takes the path of a MSI or a Product Code as an argument along with an Action.

Execute-MSI uses the default parameters found in the configuration file, if you use -Parameters here it will replace the default parameters all together.
If you want to add parameters use -AddParameters and if you have parameters which shouldnt be written to the log you should use -SecureParameters (for example if the msi takes a licensekey using a parameter).

Another thing that can be a problem is that if PSADT detects this as a Zero-Config MSI installation, you will run both the code inside the if-statement and your additional Execute-MSI. Its not as much of a problem as it is running redundant code. If the MSI has the same product code as you are using in the second statement, the latter will just write to the log that the product code is not installed.

If you want to avoid running both Zero-Config and your statement you can set $appName to something. Setting $appName disables Zero-Config MSI installation.

Thanks for your help Robert!