PowerShell Application Deployment Toolkit is a tool very powerful to use MSIEXEC:
- Installing using MSI
- Installing using MSI with MST
- Patching using MSP
- Uninstalling…
Log files are created in the same folder as the log file of the main script.The log folder is defined in the file AppDeployToolkit\AppDeployToolkitConfig.xml.
For example: <Toolkit_LogPath>$envSystemDrive\Logs</Toolkit_LogPath>
MSI
MSI must be copied in the “Files” folder
## Install MSI Write-Log "----- Installing InstallFile.msi -----" Execute-MSI -Action 'Install' -Path 'InstallFile.msi'
MSI / MST
MSI and MST must be copied in the same folder, in the “Files” folder
## Install MSI+MST Write-Log "----- Installing InstallFile.msi + TransformFile.mst -----" Execute-MSI -Action 'Install' -Path 'InstallFile.msi' -Transform 'TransformFile.mst'
If MSI and MST are copied in a subfolder of the “Files” folder
## Install MSI+MST Write-Log "----- Installing InstallFile.msi + TransformFile.mst -----" Execute-MSI -Action 'Install' -Path 'Sub-Folder\InstallFile.msi' -Transform 'TransformFile.mst'
MSP
MSP must be copied in the “Files” folder
## Install MSP Write-Log "----- Installing PatchFile.msp -----" Execute-MSI -Action 'Patch' -Path 'PatchFile.msp'
Uninstall MSI
To use the ProductCode, the MSI must be still in the cache of the machine.
To use the MSI file, it must be copied in the “Files” folder
## Uninstall MSI Write-Log "----- Uninstalling {ProductCode} -----" Execute-MSI -Action 'Uninstall' -Path '{ProductCode}' ## OR ## Uninstall MSI Write-Log "----- Uninstalling MSI -----" Execute-MSI -Action 'Uninstall' -Path 'InstallFile.msi'
To launch Uninstallation program:
Deploy-Application.exe -DeploymentType “Uninstall”