mirror of
https://github.com/kataras/iris.git
synced 2025-12-28 15:27:03 +00:00
nothing serious here yet, just having fun with powershell and my nerves - but it works
Former-commit-id: ec83062ab7a588e9bfc6c42ce59834abf24723fa
This commit is contained in:
40
_benchmarks/benchmarker/scripts/git-install.ps1
Normal file
40
_benchmarks/benchmarker/scripts/git-install.ps1
Normal file
@@ -0,0 +1,40 @@
|
||||
# borrowed: https://github.com/PowerShell/vscode-powershell/blob/develop/scripts/Install-VSCode.ps1
|
||||
# edited to support a custom install directory and fix an issue with ssl and
|
||||
# simplify the script - we don't need update only a temp installation.
|
||||
|
||||
param([string]$InstallDir="$env:TEMP")
|
||||
|
||||
If(!(test-path $InstallDir))
|
||||
{
|
||||
New-Item -ItemType Directory -Force -Path $InstallDir
|
||||
}
|
||||
|
||||
$filename=-join($InstallDir, "\", "git-installer.exe")
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
foreach ($asset in (Invoke-RestMethod https://api.github.com/repos/git-for-windows/git/releases/latest).assets) {
|
||||
if ($asset.name -match 'Git-\d*\.\d*\.\d*-64-bit\.exe') {
|
||||
$dlurl = $asset.browser_download_url
|
||||
$newver = $asset.name
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Write-Host "`nDownloading latest stable git..." -ForegroundColor Yellow
|
||||
Remove-Item -Force $filename -ErrorAction SilentlyContinue
|
||||
Invoke-WebRequest -Uri $dlurl -OutFile $filename
|
||||
|
||||
Write-Host "`nInstalling git..." -ForegroundColor Yellow
|
||||
Start-Process -Wait $filename -ArgumentList /VERYSILENT, /DIR="$InstallDir", \FORCECLOSEAPPLICATIONS
|
||||
# or SILENT
|
||||
|
||||
Write-Host "`nInstallation complete!`n`n" -ForegroundColor Green
|
||||
}
|
||||
finally {
|
||||
$ProgressPreference = 'Continue'
|
||||
}
|
||||
|
||||
$s = get-process ssh-agent -ErrorAction SilentlyContinue
|
||||
if ($s) {$true}
|
||||
@@ -1,38 +1,51 @@
|
||||
$INSTALL_DIR=$args[0]
|
||||
[cmdletbinding()]
|
||||
$Install_Dir=$args[0]
|
||||
$VERSION=$args[1]
|
||||
# param([String]$VERSION="12.4.0",[String]$INSTALL_DIR="../nodejs_bin")
|
||||
|
||||
If(!(test-path $INSTALL_DIR))
|
||||
$Install_Dir=[System.IO.Path]::GetFullPath($Install_Dir)
|
||||
|
||||
If(!(test-path $Install_Dir))
|
||||
{
|
||||
New-Item -ItemType Directory -Force -Path $INSTALL_DIR
|
||||
New-Item -ItemType Directory -Force -Path $Install_Dir
|
||||
}
|
||||
|
||||
function Say($str) {
|
||||
Write-Host "node-install: $str"
|
||||
}
|
||||
|
||||
$url = "https://nodejs.org/dist/v$VERSION/node-v$VERSION-x64.msi"
|
||||
|
||||
# i.e https://nodejs.org/dist/v10.16.0/node-v10.16.0-x64.msi
|
||||
write-host "`n----------------------------"
|
||||
write-host " downloading node "
|
||||
write-host "----------------------------`n"
|
||||
write-host "url : $url"
|
||||
# Say "----------------------------"
|
||||
# Say " downloading node "
|
||||
# Say "----------------------------"
|
||||
# Say "url : $url"
|
||||
|
||||
$filename = "node.msi"
|
||||
$node_msi = "$INSTALL_DIR\$filename"
|
||||
$node_msi = "$Install_Dir\$filename"
|
||||
$start_time = Get-Date
|
||||
$wc = New-Object System.Net.WebClient
|
||||
$wc.DownloadFile($url, $node_msi)
|
||||
write-Output "Download of $filename finished at: $((Get-Date).Subtract($start_time).Seconds) second(s)"
|
||||
# Say "Download of $filename finished at: $((Get-Date).Subtract($start_time).Seconds) second(s)"
|
||||
|
||||
write-host "`n----------------------------"
|
||||
write-host " installing node "
|
||||
write-host "----------------------------`n"
|
||||
# Say "---------------------------"
|
||||
# Say " installing node "
|
||||
# Say "---------------------------"
|
||||
|
||||
$node_msi = $node_msi.substring(2)
|
||||
# Say $node_msi
|
||||
|
||||
$INSTALL_DIR=[System.IO.Path]::GetFullPath($INSTALL_DIR)
|
||||
write-host "installation directory: $INSTALL_DIR"
|
||||
# $Install_Dir = $Install_Dir.replace("\","/")
|
||||
|
||||
$params = '/i', "$node_msi",
|
||||
'INSTALLDIR="$INSTALL_DIR"',
|
||||
'/qn',
|
||||
'/norestart'
|
||||
$p = Start-Process 'msiexec.exe' -ArgumentList $params -Wait -PassThru
|
||||
# Say "installation directory: $Install_Dir"
|
||||
|
||||
# $params = '/i', "$node_msi",
|
||||
# 'INSTALLDIR="$Install_Dir"',
|
||||
# '/qn',
|
||||
# '/norestart'
|
||||
# # '/log $Install_Dir\install.log'
|
||||
|
||||
# $p = Start-Process 'msiexec.exe' -ArgumentList $params -PassThru -Wait
|
||||
|
||||
# Start-Process 'msiexec.exe' -ArgumentList '/i', "$node_msi", "INSTALLDIR=$Install_Dir", '/norestart' -Wait -PassThru
|
||||
|
||||
Start-Process -Wait 'msiexec.exe' -ArgumentList '/i', $node_msi, "INSTALLDIR=$Install_Dir", '/passive'
|
||||
Reference in New Issue
Block a user