mattermost-desktop/scripts/installer.nsh

9 lines
603 B
Plaintext
Raw Normal View History

2024-10-03 06:35:14 -07:00
# This macro fetches the currently installed MM version via MSI (if any) and uninstalls it first
!macro customInit
nsExec::ExecToStack "$\"$%SYSTEMROOT%\system32\WindowsPowerShell\v1.0\powershell.exe$\" -command $\"$$Installer = New-Object -ComObject WindowsInstaller.Installer; $$MMProduct = $$Installer.ProductsEx('', '', 7) | Where-Object -FilterScript {$$_.InstallProperty('ProductName') -eq 'Mattermost'}; if ($$MMProduct -ne $$null) {Write-Host -NoNewline $$MMProduct.ProductCode()}$\""
Pop $0
Pop $1
StrCmp $1 "" 0 +1
ExecWait '"$%SYSTEMROOT%\system32\msiexec.exe" /x $1 /qn'
!macroend