Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions
38 lines
1.1 KiB
PowerShell
38 lines
1.1 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
|
|
$PackageName = 'webdrop-bridge'
|
|
|
|
try {
|
|
# Find installed version
|
|
$UninstallPath = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall |
|
|
Where-Object { $_.GetValue('DisplayName') -like '*WebDropBridge*' } |
|
|
Select-Object -First 1
|
|
|
|
if ($UninstallPath) {
|
|
$UninstallString = $UninstallPath.GetValue('UninstallString')
|
|
|
|
# Extract MSI Product ID from uninstall string
|
|
if ($UninstallString -match '{[A-F0-9-]+}') {
|
|
$ProductId = $matches[0]
|
|
|
|
Write-Host "Uninstalling WebDropBridge (Product ID: $ProductId)..."
|
|
|
|
$UninstallArgs = @(
|
|
'/x'
|
|
$ProductId
|
|
'/quiet'
|
|
'/norestart'
|
|
)
|
|
|
|
& 'msiexec.exe' @UninstallArgs
|
|
|
|
Write-Host "WebDropBridge uninstalled successfully"
|
|
} else {
|
|
Write-Warning "Could not extract Product ID from uninstall string"
|
|
}
|
|
} else {
|
|
Write-Warning "WebDropBridge is not installed"
|
|
}
|
|
} catch {
|
|
Write-Error "Uninstall failed: $_"
|
|
}
|