Last active
June 20, 2016 23:04
-
-
Save dtgm/cae2e0ea3db5c7493bc522f4f51f364f to your computer and use it in GitHub Desktop.
miranda-ng improvements https://chocolatey.org/packages/miranda-ng/0.95.5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add to nuspec: | |
-------------- | |
<dependencies> | |
<dependency id="chocolatey-uninstall.extension" /> | |
</dependencies> | |
Copy/replace chocolateyInstall.ps1 with text below: | |
-------------------------------------------------- | |
$packageName = 'miranda-ng' | |
$fileType = 'exe' | |
$url = 'http://www.miranda-ng.org/distr/stable/miranda-ng-v0.95.5.exe' | |
$url64 = 'http://www.miranda-ng.org/distr/stable/miranda-ng-v0.95.5_x64.exe' | |
$silentArgs = '/verysilent' | |
[array]$key = Get-UninstallRegistryKey -SoftwareName "Miranda NG" | |
$installedVersion = $key.DisplayVersion | |
if ([version]$installedVersion -ge [version]$env:ChocolateyPackageVersion) { | |
Write-Host "$packageName $installedVersion is already installed." | |
} else { | |
Write-Verbose "Uninstalling previous version" | |
Uninstall-ChocolateyPackage $packageName $fileType $silentArgs ($key.UninstallString.Replace('"','')) | |
Install-ChocolateyPackage $packageName $fileType $url $url64 $silentArgs | |
} | |
add file chocolateyUninstall.ps1 | |
-------------------------------- | |
$packageName = 'miranda-ng' | |
$softwareName = "Miranda NG" | |
$installerType = 'exe' | |
$silentArgs = '/verysilent' | |
$validExitCodes = @(0) | |
[array]$key = Get-UninstallRegistryKey -SoftwareName $softwareName | |
$key | ForEach-Object { | |
Uninstall-ChocolateyPackage -PackageName $packageName ` | |
-FileType $installerType ` | |
-SilentArgs $silentArgs ` | |
-File $($_.UninstallString.Replace('"','')) ` | |
-ValidExitCodes $validExitCodes | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment