Skip to content

Commit

Permalink
(SQL2014.ClrTypes) Switch to AU package [AU:SQL2014.ClrTypes]
Browse files Browse the repository at this point in the history
  • Loading branch information
mkevenaar committed Oct 1, 2019
1 parent 9d33dc4 commit b734cd6
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 16 deletions.
7 changes: 7 additions & 0 deletions automatic/SQL2014.ClrTypes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# <img src="" width="48" height="48"/> [SQL2014.ClrTypes](https://chocolatey.org/packages/SQL2014.ClrTypes)

The SQL Server System CLR Types package contains the components implementing the new geometry, geography, and hierarchyid types in SQL Server 2014. This component can be installed separately from the server to allow client applications to use these types outside of the server.

**Please Note**: This is an automatically updated package. If you find it is
out of date by more than a day or two, please contact the maintainer(s) and
let them know the package is no longer updating correctly.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Read this before creating packages: https://chocolatey.org/docs/create-packages -->
<!-- It is especially important to read the above link to understand additional requirements when publishing packages to the community feed aka dot org (https://chocolatey.org/packages). -->

<!-- Test your packages in a test environment: https://github.com/chocolatey/chocolatey-test-environment -->

<!--
Expand All @@ -10,11 +11,11 @@ This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Refe
* Any of the following elements can ONLY be used by choco tools - projectSourceUrl, docsUrl, mailingListUrl, bugTrackerUrl, packageSourceUrl, provides, conflicts, replaces
* nuget.exe can still install packages with those elements but they are ignored. Any authoring tools or commands will error on those elements
-->

<!-- You can embed software files directly into packages, as long as you are not bound by distribution rights. -->
<!-- * If you are an organization making private packages, you probably have no issues here -->
<!-- * If you are releasing to the community feed, you need to consider distribution rights. -->
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->

<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<!-- == PACKAGE SPECIFIC SECTION == -->
Expand All @@ -40,10 +41,15 @@ This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Refe
<copyright>Microsoft Corporation</copyright>
<tags>microsoft-system-clr-types-for-sql-server-2014 SQL SQL2014 .NET CLR admin</tags>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<packageSourceUrl>https://github.com/mkevenaar/chocolatey-packages/tree/master/manual/SQL2014.ClrTypes</packageSourceUrl>
<packageSourceUrl>https://github.com/mkevenaar/chocolatey-packages/tree/master/automatic/SQL2014.ClrTypes</packageSourceUrl>
<docsUrl>https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/common-language-runtime-integration-overview?view=sql-server-2014</docsUrl>
<summary>Microsoft-System-CLR-Types-for-SQL-Server-2014</summary>
<description>The SQL Server System CLR Types package contains the components implementing the new geometry, geography, and hierarchyid types in SQL Server 2014. This component can be installed separately from the server to allow client applications to use these types outside of the server.</description>
<summary>Microsoft System CLR Types for SQL Server 2014</summary>
<description><![CDATA[The SQL Server System CLR Types package contains the components implementing the new geometry, geography, and hierarchyid types in SQL Server 2014. This component can be installed separately from the server to allow client applications to use these types outside of the server.
**Please Note**: This is an automatically updated package. If you find it is
out of date by more than a day or two, please contact the maintainer(s) and
let them know the package is no longer updating correctly.
]]></description>
<!-- =============================== -->

<!-- Specifying dependencies and version ranges? https://docs.nuget.org/create/versioning#specifying-version-ranges-in-.nuspec-files -->
Expand All @@ -64,4 +70,4 @@ This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Refe
<files>
<file src="tools\**" target="tools" />
</files>
</package>
</package>
1 change: 1 addition & 0 deletions automatic/SQL2014.ClrTypes/info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
$ErrorActionPreference = 'Stop';
$ErrorActionPreference = 'Stop';

$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

#Based on Msi
$url32 = 'https://download.microsoft.com/download/F/E/E/FEE62C90-E5A9-4746-8478-11980609E5C2/ENU/x86/SQLSysClrTypes.msi'
$checksum32 = '5CA2CC72AA5B9D02014958A8BF664676672DE7D10EF4F4BD2658301210541867'
$checksumType32 = 'sha256'
$url64 = 'https://download.microsoft.com/download/F/E/E/FEE62C90-E5A9-4746-8478-11980609E5C2/ENU/x64/SQLSysClrTypes.msi'
$checksum64 = '74cb1bc8216b24acfbc643ea7555fc7d6067dfd39b7316e79203552c36282c8f'
$checksumType64 = 'sha256'

$packageArgs = @{
packageName = $env:ChocolateyPackageName
packageName = $env:ChocolateyPackageName
unzipLocation = $toolsDir
fileType = 'msi'
url = $url32
checksum = $checksum32
checksumType = $checksumType32
url64bit = $url64
checksum64 = $checksum64
checksumType64= $checksumType64
softwareName = 'Microsoft System CLR Types for SQL Server 2014*'
fileType = 'msi'
silentArgs = "/qn /norestart /l*v `"$env:TEMP\$env:ChocolateyPackageName.$env:ChocolateyPackageVersion.log`""
validExitCodes= @(0,1641,3010)
url = "https://download.microsoft.com/download/F/E/E/FEE62C90-E5A9-4746-8478-11980609E5C2/ENU/x86/SQLSysClrTypes.msi"
checksum = 'E592C97417B8102AA1AFF72A28012AB8BF122E02CB9C23C692B76E1D1EA9B47E'
checksumType = 'sha256'
url64bit = "https://download.microsoft.com/download/F/E/E/FEE62C90-E5A9-4746-8478-11980609E5C2/ENU/x64/SQLSysClrTypes.msi"
checksum64 = 'D264B0B4D8E503C2638C18F09FF74F895DA92A9984D2B7C5D6192A6A22FA3C41'
checksumType64= 'sha256'
destination = $toolsDir
}

Install-ChocolateyPackage @packageArgs
Expand Down
48 changes: 48 additions & 0 deletions automatic/SQL2014.ClrTypes/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Import-Module AU
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1"
Import-Module "$PSScriptRoot\..\..\scripts/au_extensions.psm1"

function global:au_SearchReplace {
@{
'.\tools\chocolateyInstall.ps1' = @{
"(^[$]url32\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'"
"(^[$]checksum32\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
"(^[$]checksumType32\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType32)'"
"(^[$]url64\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'"
"(^[$]checksum64\s*=\s*)('.*')" = "`$1'$($Latest.Checksum64)'"
"(^[$]checksumType64\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType64)'"
}
}
}

function GetResultInformation([string]$url32, [string]$url64) {
$dest = "$env:TEMP\SQLSysClrTypes.msi"

Get-WebFile $url32 $dest | Out-Null
$checksumType = 'sha256'
$version = (Get-MsiInformation -Path $dest).ProductVersion
$checksum32 = Get-FileHash $dest -Algorithm $checksumType | % Hash
Remove-Item -force $dest -ErrorAction SilentlyContinue

return @{
URL32 = $url32
URL64 = $url64
Version = $version
Checksum32 = $checksum32
ChecksumType32 = $checksumType
Checksum64 = Get-RemoteChecksum $url64 -Algorithm $checksumType
ChecksumType64 = $checksumType
}
}

function global:au_GetLatest {
$url32 = 'https://download.microsoft.com/download/F/E/E/FEE62C90-E5A9-4746-8478-11980609E5C2/ENU/x86/SQLSysClrTypes.msi'
$url64 = 'https://download.microsoft.com/download/F/E/E/FEE62C90-E5A9-4746-8478-11980609E5C2/ENU/x64/SQLSysClrTypes.msi'

Update-OnETagChanged -execUrl $url64 `
-OnETagChanged {
GetResultInformation $url32 $url64
} -OnUpdated { @{ URL32 = $url32 ; URL64 = $url64 }}
}

update -ChecksumFor none

0 comments on commit b734cd6

Please sign in to comment.