forked from microsoft/mssql-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'RTW_6.2.0' into metadataCaching
- Loading branch information
Showing
53 changed files
with
2,539 additions
and
677 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# JCE chocolatey package | ||
|
||
### Disclaimers: | ||
1. All contents within this directory originate from [this GitHub project](https://github.com/TobseF/jce-chocolatey-package). This project was added to allow us to test the Always Encrypted feature on AppVeyor builds. | ||
|
||
2. This is not an official project of Oracle. It\`s only easy of the manual installation: It downloads the JCE from oracle.com and unpacks it to the installed JDK. | ||
|
||
|
||
[Chocolatey](https://chocolatey.org/) package for the [JCE (Unlimited Strength Java Cryptography Extension Policy Files)](http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html) | ||
|
||
This chocolatey package adds the JCE to latest installed Java SDK. The The `JAVA_HOME` environment variable has to point to the JDK. If `JAVA_HOME` is not set, nothing will be changed. The original files are backuped (renamed to `*_old`) and can be reverted at any time. This package is a perfect addion to the [JDK8 package](https://chocolatey.org/packages/jdk8). | ||
|
||
#### Install with [Chocolatey](https://chocolatey.org/) | ||
```PowerShell | ||
choco install jce -y | ||
``` | ||
|
||
#### Build from source: | ||
1. Install [Chocolatey](https://chocolatey.org/). | ||
2. Open cmd with admin rights in jce package directory. | ||
3. Pack NuGet Package (.nupkg). | ||
```PowerShell | ||
cpack | ||
``` | ||
4. Install JCE NuGet Package. | ||
```PowerShell | ||
choco install jce -fdv -s . -y | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- 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/2010/07/nuspec.xsd"> | ||
<metadata> | ||
<!-- Read this before publishing packages to chocolatey.org: https://github.com/chocolatey/chocolatey/wiki/CreatePackages --> | ||
<id>jce</id> | ||
<title>JCE (Java Cryptography Extension)</title> | ||
<version>7.0.0</version> | ||
<authors>Sun Microsystems/Oracle Corporation</authors> | ||
<owners>Tobse Fritz</owners> | ||
<summary>Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7</summary> | ||
<description>Downloads and installs the Java Cryptography Extension (JCE) to the lastest JDK. The The JAVA_HOME environment variable has to point to the JDK. If JAVA_HOME is not set, nothing will be changed. The original files are backuped (renamed to *_old) and can be reverted at any time.</description> | ||
<projectUrl>https://github.com/TobseF/jce-chocolatey-package</projectUrl> | ||
<tags>java jce admin</tags> | ||
<copyright></copyright> | ||
<licenseUrl>http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html</licenseUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<iconUrl>http://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/50fd97744110dcbce1acde889c0870599c9d5584/icons/java.svg</iconUrl> | ||
<!--<dependencies> | ||
<dependency id="" version="__VERSION__" /> | ||
<dependency id="" /> | ||
</dependencies>--> | ||
<releaseNotes></releaseNotes> | ||
</metadata> | ||
<files> | ||
<file src="tools\**" target="tools" /> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
$script_path = $(Split-Path -parent $MyInvocation.MyCommand.Definition) | ||
$common = $(Join-Path $script_path "common.ps1") | ||
. $common | ||
|
||
#installs JCE | ||
try { | ||
chocolatey-install | ||
} catch { | ||
if ($_.Exception.InnerException) { | ||
$msg = $_.Exception.InnerException.Message | ||
} else { | ||
$msg = $_.Exception.Message | ||
} | ||
throw | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
$script_path = $(Split-Path -parent $MyInvocation.MyCommand.Definition) | ||
$common = $(Join-Path $script_path "common.ps1") | ||
. $common | ||
|
||
function Uninstall-ChocolateyPath { | ||
param( | ||
[string] $pathToUninstall, | ||
[System.EnvironmentVariableTarget] $pathType = [System.EnvironmentVariableTarget]::User | ||
) | ||
Write-Debug "Running 'Uninstall-ChocolateyPath' with pathToUninstall:`'$pathToUninstall`'"; | ||
|
||
#get the PATH variable | ||
$envPath = $env:PATH | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
$jce_version = '7' | ||
$zipFolder = 'UnlimitedJCEPolicy' | ||
$script_path = $(Split-Path -parent $MyInvocation.MyCommand.Definition) | ||
|
||
function has_file($filename) { | ||
return Test-Path $filename | ||
} | ||
|
||
function download-from-oracle($url, $output_filename) { | ||
if (!(has_file($output_fileName))) { | ||
Write-Host "Downloading JCE from $url" | ||
|
||
try { | ||
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true } | ||
$client = New-Object Net.WebClient | ||
$dummy = $client.Headers.Add('Cookie', 'gpw_e24=http://www.oracle.com; oraclelicense=accept-securebackup-cookie') | ||
$dummy = $client.DownloadFile($url, $output_filename) | ||
} finally { | ||
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = $null | ||
} | ||
} | ||
} | ||
|
||
function download-jce-file($url, $output_filename) { | ||
$dummy = download-from-oracle $url $output_filename | ||
} | ||
|
||
function download-jce() { | ||
$filename = "UnlimitedJCEPolicyJDK$jce_version.zip" | ||
$url = "http://download.oracle.com/otn-pub/java/jce/$jce_version/$filename" | ||
$output_filename = Join-Path $script_path $filename | ||
If(!(Test-Path $output_filename)){ | ||
$dummy = download-jce-file $url $output_filename | ||
} | ||
return $output_filename | ||
} | ||
|
||
function get-java-home(){ | ||
return Get-EnvironmentVariable 'JAVA_HOME' -Scope 'Machine' -PreserveVariables | ||
} | ||
|
||
function get-jce-dir($java_home) { | ||
return Join-Path $java_home 'jre\lib\security' | ||
} | ||
|
||
function chocolatey-install() { | ||
$java_home = get-java-home | ||
if (!$java_home) { | ||
Write-Host "Couldnt find JAVA_HOME environment variable" | ||
Write-Host "Skipping installation" | ||
}else{ | ||
$jce_dir = get-jce-dir $java_home | ||
$already_patched_file = Join-Path $jce_dir 'local_policy_old.jar' | ||
|
||
If(Test-Path $already_patched_file){ | ||
Write-Host "JCE already installed: $jce_dir" | ||
Write-Host "Skipping installation" | ||
}else{ | ||
Write-Host "JCE is not installed ($already_patched_file) is not present" | ||
Write-Host "Starting installation" | ||
install-jce $jce_dir | ||
} | ||
} | ||
} | ||
|
||
function install-jce($jce_dir) { | ||
$jce_zip_file = download-jce | ||
$temp_dir = Get-EnvironmentVariable 'TEMP' -Scope User -PreserveVariables | ||
$local_policy = Join-Path $jce_dir 'local_policy.jar' | ||
$export_policy = Join-Path $jce_dir 'US_export_policy.jar' | ||
|
||
Write-Host "Downloading JCE ($jce_zip_file)" | ||
Install-ChocolateyZipPackage -PackageName 'jce7' -Url $jce_zip_file -UnzipLocation $temp_dir | ||
|
||
If(Test-Path $local_policy){ | ||
Rename-Item -Path $local_policy -NewName 'local_policy_old.jar' -Force | ||
} | ||
|
||
If(Test-Path $export_policy){ | ||
Rename-Item -Path $export_policy -NewName 'US_export_policy_old.jar' -Force | ||
} | ||
|
||
$unzippedFolder = Join-Path $temp_dir $zipFolder | ||
Copy-Item $unzippedFolder\*.jar $jce_dir -force | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.