additional functions or parameters for Remove-MSIApplications??

Topics: Archive - General
Mar 10, 2015 at 2:05 PM
I have an application (SnagIt) that when uninstalling older versions prompts users to save or delete data.
In order to hide this option you need to add TSC_DATA_STORE=0 to the uninstall.

I could add each and every GUID to the Pre-Installation Phase, but I was hoping to utilize the Remove-MSIApplications so it will detect any "snagit" version, but when doing so I need to add the: TSC_DATA_STORE=0 to the end of it.

Are there other functions or parameters that I can use to allow that to be appended to the Remove-MSIApplications.

My end goal Is to uninstall any previous version, save the data, then install the latest version. Because it does not actually upgrade but installs so both version are there, this seems to be my only option.

I also tried Execute-MSI -Action Uninstall -Path 'GUID'
but again I cannot add the last part which saves the data silently.

The full function would be: TSC_DATA_STORE=0 REBOOT=ReallySuppress /qn

Any ideas?
Mar 10, 2015 at 8:29 PM
With v3.5 you should be able to do this:
Execute-MSI -Action Uninstall -Path 'GUID' -Parameters "TSC_DATA_STORE=0 REBOOT=ReallySuppress /qn "

In the v3.6 beta, the developers have recently added -AddParameters to the Execute-MSI Function.
So this means you could do:
Execute-MSI -Action Uninstall -Path 'GUID' -AddParameters "TSC_DATA_STORE=0"
Note that I did not add "REBOOT=ReallySuppress /qn " because it's already in the AppDeployToolkitConfig.xml file

CAVEAT: The difference between -AddParameters and -Parameters:
  • -Parameters replaces the defaults set in the AppDeployToolkitConfig.xml file
  • -AddParameters adds to the defaults set in the AppDeployToolkitConfig.xml file
You could also try to ask the developers to add -AddParameters and/or -Parameters to the Remove-MSIApplications Function.
Mar 11, 2015 at 3:19 AM
Edited Mar 11, 2015 at 3:45 AM
Thanks for your reply.

I will double check but I am almost positive that I tried adding the -Parameters and I got an error message.

When I add this:
Execute-MSI -Action Uninstall -Path '{5BCC634A-58AD-42F9-B3C6-2EA52F81CF85}' -Parameters "TSC_DATA_STORE=0 REBOOT=ReallySuppress /qn"

I get this error:
[03-10-2015 23:40:39.709] [Pre-Installation] [Execute-Process] :: Function failed, setting exit code to [999]. 
Error Record:

Message        : The variable cannot be validated because the value  is not a valid value for the WorkingDirectory variable.
InnerException : 

FullyQualifiedErrorId : ValidateSetFailure

PositionMessage : 
                  At C:\temp\12030\AppDeployToolkit\AppDeployToolkitMain.ps1:2209 char:51
                  +             If (-not $WorkingDirectory) { $WorkingDirectory <<<<  = Split-Path -Path $Path -Parent -ErrorAction 'Stop' }
I am running this on the machine from a temp directory to make sure it works before doing anything with SCCM.

If I use msiexec.exe /x '{5BCC634A-58AD-42F9-B3C6-2EA52F81CF85}' TSC_DATA_STORE=0 REBOOT=ReallySuppress /qn
Then it works without problems.

I am doing this as part of the Pre-Installation Phase

The main reason I was hoping for the Remove-MSIApplications is because there could be a multitude of different versions of snagit installed. If I use the GUID I would have to put in the GUIDs for each possible version to ensure it does remove the version first, or else it will just install the new version and the end user will have 2 copies.

I will see if the developers could add something like this, but in the meantime I might just have to do the GUIDs.

thanks again.
Mar 11, 2015 at 1:41 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Mar 20, 2015 at 7:06 AM
I have committed below updated to the under the beta under "Source Code" tab of this site:
Added following parameters to Remove-MSIApplications to match those in Execute-MSI: -Parameters, -AddParameters, -LoggingOptions, -LogName.

This update will be included in the next release of the toolkit.
Marked as answer by Fleming15 on 3/31/2015 at 7:04 PM