From ee0385230644bd718d33c9da90525329cbb5d247 Mon Sep 17 00:00:00 2001 From: Iristyle Date: Tue, 23 Jul 2013 20:48:18 -0400 Subject: [PATCH] feat: SQL2008.SMO uninstaller / bump ver --- SQL2008.SMO/SQL2008.SMO.nuspec | 4 ++-- SQL2008.SMO/tools/chocolateyUninstall.ps1 | 26 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 SQL2008.SMO/tools/chocolateyUninstall.ps1 diff --git a/SQL2008.SMO/SQL2008.SMO.nuspec b/SQL2008.SMO/SQL2008.SMO.nuspec index 9fe77f6..4bd2e18 100644 --- a/SQL2008.SMO/SQL2008.SMO.nuspec +++ b/SQL2008.SMO/SQL2008.SMO.nuspec @@ -3,12 +3,12 @@ SQL2008.SMO Microsoft SQL Server 2008 Management Objects - 10.00.2531.01 + 10.00.2531.02 Microsoft Ethan Brown Microsoft SQL Server 2008 Feature Pack, April 2009 - 10.00.2531.00 - Note that this is 10.00.2531.00, but had to be updated to 10.00.2531.01 to ensure that the dependent Powershell package would install correctly. + Note that this is 10.00.2531.00, but had to be updated to 10.00.2531.02 to ensure that the dependent packages would install / uninstall correctly. The SQL Server Management Objects (SMO) is a .NET Framework object model that enables software developers to create client-side applications to manage and administer SQL Server objects and services. The SQL Server Management Objects (SMO) is a .NET Framework object model that enables software developers to create client-side applications to manage and administer SQL Server objects and services. This object model will work with SQL Server 2000, SQL Server 2005 and SQL Server 2008. diff --git a/SQL2008.SMO/tools/chocolateyUninstall.ps1 b/SQL2008.SMO/tools/chocolateyUninstall.ps1 new file mode 100644 index 0000000..ad937c3 --- /dev/null +++ b/SQL2008.SMO/tools/chocolateyUninstall.ps1 @@ -0,0 +1,26 @@ +# HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ +$msiId = '{2BF67B4B-7C5E-4045-8766-BB44838DC61A}' +$msiId64 = '{08ECC740-2B3E-45D7-860C-59B511386286}' + +$package = 'SQL2008.SMO' + +$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 +}