mirror of
git://code.qt.io/qt/qt5.git
synced 2026-03-25 07:41:24 +08:00
Add script to install jom through powershell
Change-Id: I3f12aa0dd54f99fafdffb53796e54e7b127c3c8c Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
This commit is contained in:
31
coin/provisioning/common/helpers.ps1
Normal file
31
coin/provisioning/common/helpers.ps1
Normal file
@@ -0,0 +1,31 @@
|
||||
function Verify-Checksum
|
||||
{
|
||||
Param (
|
||||
[string]$File=$(throw("You must specify a filename to get the checksum of.")),
|
||||
[string]$Expected=$(throw("Checksum required")),
|
||||
[ValidateSet("sha1","md5")][string]$Algorithm="sha1"
|
||||
)
|
||||
$fs = new-object System.IO.FileStream $File, "Open"
|
||||
$algo = [type]"System.Security.Cryptography.$Algorithm"
|
||||
$crypto = $algo::Create()
|
||||
$hash = [BitConverter]::ToString($crypto.ComputeHash($fs)).Replace("-", "")
|
||||
$fs.Close()
|
||||
if ($hash -ne $Expected) {
|
||||
Write-Error "Checksum verification failed, got: '$hash' expected: '$Expected'"
|
||||
}
|
||||
}
|
||||
|
||||
function Extract-Zip
|
||||
{
|
||||
Param (
|
||||
[string]$Source,
|
||||
[string]$Destination
|
||||
)
|
||||
echo "Extracting '$Source' to '$Destination'..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $Destination
|
||||
$shell = new-object -com shell.application
|
||||
$zipfile = $shell.Namespace($Source)
|
||||
$destinationFolder = $shell.Namespace($Destination)
|
||||
$destinationFolder.CopyHere($zipfile.Items())
|
||||
}
|
||||
7
coin/provisioning/common/jom.ps1
Normal file
7
coin/provisioning/common/jom.ps1
Normal file
@@ -0,0 +1,7 @@
|
||||
. "$PSScriptRoot\helpers.ps1"
|
||||
|
||||
$zip = "c:\users\qt\downloads\jom_1_1_0.zip"
|
||||
|
||||
Invoke-WebRequest -UseBasicParsing http://download.qt.io/official_releases/jom/jom_1_1_0.zip -OutFile $zip
|
||||
Verify-Checksum $zip "C4149FE706B25738B4C4E54C73E180B9CAB55832"
|
||||
Extract-Zip $zip C:\Utils\Jom
|
||||
6
coin/provisioning/qtci-windows-10-x86/jom.ps1
Normal file
6
coin/provisioning/qtci-windows-10-x86/jom.ps1
Normal file
@@ -0,0 +1,6 @@
|
||||
Set-ExecutionPolicy RemoteSigned -Force
|
||||
|
||||
# install jom
|
||||
. "$PSScriptRoot\..\common\jom.ps1"
|
||||
|
||||
Set-ExecutionPolicy Restricted -Force
|
||||
6
coin/provisioning/qtci-windows-10-x86_64/jom.ps1
Normal file
6
coin/provisioning/qtci-windows-10-x86_64/jom.ps1
Normal file
@@ -0,0 +1,6 @@
|
||||
Set-ExecutionPolicy RemoteSigned -Force
|
||||
|
||||
# install jom
|
||||
. "$PSScriptRoot\..\common\jom.ps1"
|
||||
|
||||
Set-ExecutionPolicy Restricted -Force
|
||||
6
coin/provisioning/qtci-windows-7-x86/jom.ps1
Normal file
6
coin/provisioning/qtci-windows-7-x86/jom.ps1
Normal file
@@ -0,0 +1,6 @@
|
||||
Set-ExecutionPolicy RemoteSigned -Force
|
||||
|
||||
# install jom
|
||||
. "$PSScriptRoot\..\common\jom.ps1"
|
||||
|
||||
Set-ExecutionPolicy Restricted -Force
|
||||
6
coin/provisioning/qtci-windows-8-x86/jom.ps1
Normal file
6
coin/provisioning/qtci-windows-8-x86/jom.ps1
Normal file
@@ -0,0 +1,6 @@
|
||||
Set-ExecutionPolicy RemoteSigned -Force
|
||||
|
||||
# install jom
|
||||
. "$PSScriptRoot\..\common\jom.ps1"
|
||||
|
||||
Set-ExecutionPolicy Restricted -Force
|
||||
6
coin/provisioning/qtci-windows-8-x86_64/jom.ps1
Normal file
6
coin/provisioning/qtci-windows-8-x86_64/jom.ps1
Normal file
@@ -0,0 +1,6 @@
|
||||
Set-ExecutionPolicy RemoteSigned -Force
|
||||
|
||||
# install jom
|
||||
. "$PSScriptRoot\..\common\jom.ps1"
|
||||
|
||||
Set-ExecutionPolicy Restricted -Force
|
||||
Reference in New Issue
Block a user