mattermost-desktop/scripts/installer.nsh
Devin Binnie e244b2c230
[MM-55341][MM-56894] Use electron-builder to create the MSI installer, drop support for 32-bit Windows and the NSIS installer (#3028)
* Drop 32-bit windows support

* Remove unnecessary after build script

* Enable MSI build from electron-builder

* Copy MSI installers correctly

* Change script to `windows-installer`

* Revert "Remove unnecessary after build script"

This reverts commit 65b1cccb063656916a7d12c440792ad013dff826.

* Fix duplicate installers when updating to EXE version

* Inject the app-update.yml from the NSIS installer into the MSI, have the MSI uninstall the EXE if it exists

* Cleanup old MSI builder, switch actions to use new process

* Sign PR builds

* Update to use absolute paths

* Use env variable paths
2024-05-14 12:07:45 -04:00

8 lines
600 B
Plaintext

# This macro fetches the currently install 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