From f397666cca087fde168627a1d5a784bf26b9b2a9 Mon Sep 17 00:00:00 2001 From: Iristyle Date: Tue, 23 Jul 2013 20:46:29 -0400 Subject: [PATCH] feat: SQL2008.PowerShell uninstaller / bump ver --- SQL2008.Powershell/SQL2008.Powershell.nuspec | 7 ++--- .../tools/chocolateyInstall.ps1 | 2 +- .../tools/chocolateyUninstall.ps1 | 26 +++++++++++++++++++ 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 SQL2008.Powershell/tools/chocolateyUninstall.ps1 diff --git a/SQL2008.Powershell/SQL2008.Powershell.nuspec b/SQL2008.Powershell/SQL2008.Powershell.nuspec index ba7adfb..a98d23e 100644 --- a/SQL2008.Powershell/SQL2008.Powershell.nuspec +++ b/SQL2008.Powershell/SQL2008.Powershell.nuspec @@ -1,9 +1,9 @@ - SQL2008.Powershell + SQL2008.PowerShell Microsoft Windows PowerShell Extensions for SQL Server - 10.00.2531.00 + 10.00.2531.01 Microsoft Ethan Brown Microsoft SQL Server 2008 Feature Pack, April 2009 @@ -24,9 +24,6 @@ - diff --git a/SQL2008.Powershell/tools/chocolateyInstall.ps1 b/SQL2008.Powershell/tools/chocolateyInstall.ps1 index 8d382da..56d9349 100644 --- a/SQL2008.Powershell/tools/chocolateyInstall.ps1 +++ b/SQL2008.Powershell/tools/chocolateyInstall.ps1 @@ -1,4 +1,4 @@ -$package = 'SQL2008.Powershell' +$package = 'SQL2008.PowerShell' try { $params = @{ diff --git a/SQL2008.Powershell/tools/chocolateyUninstall.ps1 b/SQL2008.Powershell/tools/chocolateyUninstall.ps1 new file mode 100644 index 0000000..ce9ada8 --- /dev/null +++ b/SQL2008.Powershell/tools/chocolateyUninstall.ps1 @@ -0,0 +1,26 @@ +# HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ +$msiId = '{4033FB91-32C7-440D-B4A3-B76D47190233}' +$msiId64 = '{A2D06441-583D-4D37-9A9A-E4AE1663A81E}' + +$package = 'SQL2008.PowerShell' + +$IsSystem32Bit = (($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and ($Env:PROCESSOR_ARCHITEW6432 -eq $null)) + +try { + + $uninstallParams = @{ + PackageName = $package; + FileType = 'MSI'; + SilentArgs = "$msiId /qb"; + ValidExitCodes = @(0) + } + + if ($IsSystem32Bit) { $uninstallParams.SilentArgs = "$msiId64 /qb" } + + Uninstall-ChocolateyPackage + + Write-ChocolateySuccess $package +} catch { + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +}