From d48507f0bb947ec5dcce6ea1091dd97fe79fe32d Mon Sep 17 00:00:00 2001 From: Iristyle Date: Tue, 23 Jul 2013 20:43:34 -0400 Subject: [PATCH] feat: SQL2008.CmdLine uninstaller / bump verison --- SQL2008.CmdLine/SQL2008.CmdLine.nuspec | 2 +- SQL2008.CmdLine/tools/chocolateyUninstall.ps1 | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 SQL2008.CmdLine/tools/chocolateyUninstall.ps1 diff --git a/SQL2008.CmdLine/SQL2008.CmdLine.nuspec b/SQL2008.CmdLine/SQL2008.CmdLine.nuspec index a598ec7..e875833 100644 --- a/SQL2008.CmdLine/SQL2008.CmdLine.nuspec +++ b/SQL2008.CmdLine/SQL2008.CmdLine.nuspec @@ -3,7 +3,7 @@ SQL2008.CmdLine Microsoft SQL Server 2008 Command Line Utilities - 10.00.2531.00 + 10.00.2531.01 Microsoft Ethan Brown Microsoft SQL Server 2008 Feature Pack, April 2009 diff --git a/SQL2008.CmdLine/tools/chocolateyUninstall.ps1 b/SQL2008.CmdLine/tools/chocolateyUninstall.ps1 new file mode 100644 index 0000000..1420690 --- /dev/null +++ b/SQL2008.CmdLine/tools/chocolateyUninstall.ps1 @@ -0,0 +1,26 @@ +# HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ +$msiId = '{59D0A396-6A00-43C6-AE6C-7BE4ADFAB261}' +$msiId64 = '{BBF7C6D0-9BCC-4E02-8B48-BFBB9BC6410A}' + +$package = 'SQL2008.CmdLine' + +$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 +}