From 80fb102d92c48b1d8ebaeadf2ad65770f7664f2e Mon Sep 17 00:00:00 2001 From: Iristyle Date: Sat, 13 Oct 2012 13:00:17 -0400 Subject: [PATCH] Install both SMO x86 and x64 on x64 OSes SQL Powershell utils, which run on x86 and x64, require that the matching SMO be installed :( --- SQL2008.SMO/SQL2008.SMO.nuspec | 6 ++++-- SQL2008.SMO/tools/chocolateyInstall.ps1 | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/SQL2008.SMO/SQL2008.SMO.nuspec b/SQL2008.SMO/SQL2008.SMO.nuspec index 8d9114b..9fe77f6 100644 --- a/SQL2008.SMO/SQL2008.SMO.nuspec +++ b/SQL2008.SMO/SQL2008.SMO.nuspec @@ -3,10 +3,12 @@ SQL2008.SMO Microsoft SQL Server 2008 Management Objects - 10.00.2531.00 + 10.00.2531.01 Microsoft Ethan Brown - Microsoft SQL Server 2008 Feature Pack, April 2009 + 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. 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/chocolateyInstall.ps1 b/SQL2008.SMO/tools/chocolateyInstall.ps1 index 3c0bcff..99581f3 100644 --- a/SQL2008.SMO/tools/chocolateyInstall.ps1 +++ b/SQL2008.SMO/tools/chocolateyInstall.ps1 @@ -11,6 +11,16 @@ try { Install-ChocolateyPackage @params + # install both x86 and x64 editions of SMO since x64 supports both + # to install both variants of powershell, both variants of SMO must be present + $IsSytem32Bit = (($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and ` + ($Env:PROCESSOR_ARCHITEW6432 -eq $null)) + if (!$IsSytem32Bit) + { + $params.url64bit = $params.url + Install-ChocolateyPackage @params + } + Write-ChocolateySuccess $package } catch { Write-ChocolateyFailure $package "$($_.Exception.Message)"