mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-14 09:07:52 +00:00
* desktop: do not delete the whole install folder when uninstalling on Windows * plans: Windows uninstall deleting the chosen install folder
16 lines
627 B
PowerShell
16 lines
627 B
PowerShell
param([string]$Msi)
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
$msiOpenDatabaseModeTransact = 1
|
|
|
|
function Invoke-ComMethod($Object, [string]$Method, [object[]]$Arguments) {
|
|
$Object.GetType().InvokeMember($Method, [Reflection.BindingFlags]::InvokeMethod, $null, $Object, $Arguments)
|
|
}
|
|
|
|
$installer = New-Object -ComObject WindowsInstaller.Installer
|
|
$database = Invoke-ComMethod $installer 'OpenDatabase' @($Msi, $msiOpenDatabaseModeTransact)
|
|
$view = Invoke-ComMethod $database 'OpenView' @('DELETE FROM `WixRemoveFolderEx`')
|
|
Invoke-ComMethod $view 'Execute' @()
|
|
Invoke-ComMethod $view 'Close' @()
|
|
Invoke-ComMethod $database 'Commit' @()
|