From 2833729373a7f748ff5402a3df7ea8161f7ad4df Mon Sep 17 00:00:00 2001 From: Justin Dearing Date: Thu, 17 Jan 2013 05:22:32 -0500 Subject: [PATCH] feat: SQL2008R2.CmdLine 10.50.1600.0 - 10.50.1600.1 because zippy1981 bungled the pushed packages --- SQL2008R2.CmdLine/SQL2008R2.CmdLine.nuspec | 29 +++++++++++++++++++ SQL2008R2.CmdLine/tools/chocolateyInstall.ps1 | 27 +++++++++++++++++ .../tools/chocolateyUninstall.ps1 | 26 +++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 SQL2008R2.CmdLine/SQL2008R2.CmdLine.nuspec create mode 100644 SQL2008R2.CmdLine/tools/chocolateyInstall.ps1 create mode 100644 SQL2008R2.CmdLine/tools/chocolateyUninstall.ps1 diff --git a/SQL2008R2.CmdLine/SQL2008R2.CmdLine.nuspec b/SQL2008R2.CmdLine/SQL2008R2.CmdLine.nuspec new file mode 100644 index 0000000..e8e2bf0 --- /dev/null +++ b/SQL2008R2.CmdLine/SQL2008R2.CmdLine.nuspec @@ -0,0 +1,29 @@ + + + + SQL2008R2.CmdLine + Microsoft SQL Server 2008 Command Line Utilities + 10.50.1600.1 + Microsoft + Ethan Brown, zippy1981 + Microsoft SQL Server 2008 R2 Feature Pack, October 2011 + + The SQLCMD utility allows users to connect to, send Transact-SQL batches from, and output rowset information from SQL Server 7.0, SQL Server 2000, SQL Server 2005, and SQL Server 2008 and 2008 R2 instances. The bcp utility bulk copies data between an instance of Microsoft SQL Server 2008 R2 and a data file in a user-specified format. The bcp utility can be used to import large numbers of new rows into SQL Server tables or to export data out of tables into data files. + The SQLCMD utility allows users to connect to, send Transact-SQL batches from, and output rowset information from SQL Server 7.0, SQL Server 2000, SQL Server 2005, and SQL Server 2008 and 2008 R2 instances. The bcp utility bulk copies data between an instance of Microsoft SQL Server 2008 R2 and a data file in a user-specified format. The bcp utility can be used to import large numbers of new rows into SQL Server tables or to export data out of tables into data files. + http://www.microsoft.com/en-us/download/details.aspx?id=16978 + SQL SQL2008R2 cmdline bcp SQLCMD + + false + https://github.com/Iristyle/ChocolateyPackages/raw/master/SQL2008.SMO/SQL2008.png + + + + + + + + + + diff --git a/SQL2008R2.CmdLine/tools/chocolateyInstall.ps1 b/SQL2008R2.CmdLine/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000..3eb5408 --- /dev/null +++ b/SQL2008R2.CmdLine/tools/chocolateyInstall.ps1 @@ -0,0 +1,27 @@ +$package = 'SQL2008R2.CmdLine' + +try { + $params = @{ + packageName = $package; + fileType = 'msi'; + silentArgs = '/quiet'; + url = 'http://download.microsoft.com/download/B/6/3/B63CAC7F-44BB-41FA-92A3-CBF71360F022/1033/x86/SqlCmdLnUtils.msi'; + url64bit = 'http://download.microsoft.com/download/B/6/3/B63CAC7F-44BB-41FA-92A3-CBF71360F022/1033/x64/SqlCmdLnUtils.msi'; + } + + Install-ChocolateyPackage @params + + # install both x86 and x64 editions since x64 supports both + $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)" + throw +} diff --git a/SQL2008R2.CmdLine/tools/chocolateyUninstall.ps1 b/SQL2008R2.CmdLine/tools/chocolateyUninstall.ps1 new file mode 100644 index 0000000..2a366c6 --- /dev/null +++ b/SQL2008R2.CmdLine/tools/chocolateyUninstall.ps1 @@ -0,0 +1,26 @@ +# HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ +$msiId = '{5AA08D9F-3BE3-4A34-B53E-858A1895589E}' +$msiId64 = '{D9F711D3-3C90-4D79-9292-47C90C722E2A}' + +$package = 'SQL2008R2.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 +}