From 11c09716674180577fa685dabd7c3db594051a3a Mon Sep 17 00:00:00 2001 From: Jacek Date: Wed, 21 Jun 2017 23:19:54 +0100 Subject: [PATCH] Resolves #360 Thanks to @pocelka for providing the content. --- docs/userguide/install.md | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/docs/userguide/install.md b/docs/userguide/install.md index 1b8dcbdc3..5eb39069e 100644 --- a/docs/userguide/install.md +++ b/docs/userguide/install.md @@ -1,7 +1,10 @@ # Downloading latest version of utPLSQL -It is quite easy to download latest version of utPLSQL from github on Unix machines. -Here is a little snippet that can be handy for downloading latest version. +It is quite easy to download latest version of utPLSQL from github on both Unix/Linux as well as Windows machines. +Below are little snippets that can be handy for downloading latest version. + +## Unix/Linux + ```bash #!/bin/bash # Get the url to latest release "zip" file @@ -18,6 +21,35 @@ You may download with a one-liner if that is more convenient. curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') ``` +##Windows + +To run the script on windows you will need [PowerShell 3.0](https://blogs.technet.microsoft.com/heyscriptingguy/2013/06/02/weekend-scripter-install-powershell-3-0-on-windows-7/) or above. +You will also need .NET 4.0 Framework or above. + +```batch +$archiveName = 'utPLSQL.zip' +$latestRepo = Invoke-WebRequest https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest +$repo = $latestRepo.Content | Convertfrom-Json + +$urlList = $repo.assets.browser_download_url + +Add-Type -assembly "system.io.compression.filesystem" + +foreach ($i in $urlList) { + + $fileName = $i.substring($i.LastIndexOf("/") + 1) + + if ( $fileName.substring($fileName.LastIndexOf(".") + 1) -eq 'zip' ) { + Invoke-WebRequest $i -OutFile $archiveName + $fileLocation = Get-ChildItem | where {$_.Name -eq $archiveName} + + if ($fileLocation) { + [io.compression.zipfile]::ExtractToDirectory($($fileLocation.FullName),$($fileLocation.DirectoryName)) + } + } +} +``` + # Headless installation To simply install the utPLSQL into a new database schema and grant it to public, execute the script `install_headless.sql` as SYSDBA.