add Chocolatey package and uninstall scripts for iDescriptor

This commit is contained in:
uncore
2025-11-23 14:52:22 -07:00
parent ed0d8e64bd
commit 1051ac9df8
3 changed files with 81 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>idescriptor</id>
<version>0.1.0</version>
<title>iDescriptor</title>
<authors>The iDescriptor Project contributors</authors>
<owners>iDescriptor</owners>
<licenseUrl>https://github.com/iDescriptor/iDescriptor/blob/main/LICENSE</licenseUrl>
<projectUrl>https://github.com/iDescriptor/iDescriptor</projectUrl>
<iconUrl>
https://raw.githubusercontent.com/iDescriptor/iDescriptor/main/resources/icons/app-icon/icon.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A free, open-source, and cross-platform iDevice management tool written in C++.</description>
<summary>Cross platform, open-source and free idevice management tool written in C++.</summary>
<releaseNotes>https://github.com/iDescriptor/iDescriptor/releases/tag/v0.1.0</releaseNotes>
<tags>idescriptor idevice apple ios ipad iphone admin foss cross-platform</tags>
<packageSourceUrl>https://github.com/iDescriptor/iDescriptor</packageSourceUrl>
<projectSourceUrl>https://github.com/iDescriptor/iDescriptor</projectSourceUrl>
<docsUrl>https://github.com/iDescriptor/iDescriptor/blob/main/README.md</docsUrl>
<bugTrackerUrl>https://github.com/iDescriptor/iDescriptor/issues</bugTrackerUrl>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
+17
View File
@@ -0,0 +1,17 @@
$ErrorActionPreference = 'Stop'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://github.com/iDescriptor/iDescriptor/releases/download/v0.1.0/iDescriptor-v0.1.0-Windows_x86_64.msi'
$checksum = 'bb803b3e4cfaa75068c28d15808284ad7d3400ed2bb7e98cdf1a2223d0543b6e'
$checksumType = 'sha256'
$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'msi'
url = $url
checksum = $checksum
checksumType = $checksumType
silentArgs = "/quiet /norestart"
validExitCodes = @(0, 3010, 1641)
}
Install-ChocolateyPackage @packageArgs
+38
View File
@@ -0,0 +1,38 @@
$ErrorActionPreference = 'Stop'
$displayNamePattern = 'iDescriptor*'
Write-Host "Searching for installed application: '$displayNamePattern'"
$registryKey = Get-ItemProperty -Path @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
) -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like $displayNamePattern } | Select-Object -First 1
if ($registryKey) {
$productCode = $registryKey.PSChildName
$foundName = $registryKey.DisplayName
Write-Host "Found: '$foundName' with Product Code: '$productCode'"
Write-Host "Calling msiexec directly to uninstall..."
# Build the arguments for msiexec.exe
$uninstallArgs = "/x `"$productCode`" /qn /norestart"
Write-Host "Running: msiexec.exe $uninstallArgs"
# Start the uninstaller process and wait for it to finish
$process = Start-Process "msiexec.exe" -ArgumentList $uninstallArgs -Wait -PassThru
$exitCode = $process.ExitCode
Write-Host "msiexec.exe finished with exit code: $exitCode"
# Check if the exit code indicates success (0) or that a reboot is required (3010)
$validExitCodes = @(0, 3010, 1641)
if ($validExitCodes -notcontains $exitCode) {
throw "Uninstallation failed with exit code $exitCode."
} else {
Write-Host "Uninstallation successful."
}
} else {
# If the key is not found, it might have been uninstalled already. Don't error.
Write-Warning "Could not find a product starting with '$displayNamePattern' in the registry. The application may have already been uninstalled."
}