Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions images/win/scripts/ImageHelpers/ImageHelpers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ Export-ModuleMember -Function @(
'Test-IsWin19'
'Test-IsWin16'
'Choco-Install'
'Extract-7Zip'
)
21 changes: 21 additions & 0 deletions images/win/scripts/ImageHelpers/InstallHelpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,24 @@ function Test-IsWin16
{
(Get-WinVersion) -match "2016"
}

function Extract-7Zip {
param
(
[Parameter(Mandatory=$true)]
[string]$Path,
[Parameter(Mandatory=$true)]
[string]$DestinationPath
)

try{
Comment thread
dibir-magomedsaygitov marked this conversation as resolved.
Outdated
Comment thread
dibir-magomedsaygitov marked this conversation as resolved.
Outdated
Write-Host "Expand archive '$PATH' to '$DestinationPath' folder"
Comment thread
dibir-magomedsaygitov marked this conversation as resolved.
Outdated
7z.exe x "$Path" -o"$DestinationPath" -y | Out-Null
}
catch
{
Write-Host "There is an error during expanding '$Path' to '$DestinationPath' folder"
$_
exit 1
}
}
2 changes: 1 addition & 1 deletion images/win/scripts/Installers/Install-Chrome.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $ChromeDriverZipDownloadUrl = "https://chromedriver.storage.googleapis.com/${Chr
$ChromeDriverArchPath = Start-DownloadWithRetry -Url $ChromeDriverZipDownloadUrl -Name $ChromeDriverArchName

Write-Host "Expand Chrome WebDriver archive..."
Comment thread
dibir-magomedsaygitov marked this conversation as resolved.
Expand-Archive -Path $ChromeDriverArchPath -DestinationPath $ChromeDriverPath -Force
Extract-7Zip -Path $ChromeDriverArchPath -DestinationPath $ChromeDriverPath

Write-Host "Setting the environment variables..."
setx ChromeWebDriver "$ChromeDriverPath" /M
Expand Down
2 changes: 1 addition & 1 deletion images/win/scripts/Installers/Install-CloudFoundryCli.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ New-Item -Path $CloudFoundryCliPath -ItemType Directory -Force

# Extract the zip archive
Write-Host "Extracting cf cli..."
Expand-Archive -Path $CloudFoundryArchPath -DestinationPath $CloudFoundryCliPath -Force
Extract-7Zip -Path $CloudFoundryArchPath -DestinationPath $CloudFoundryCliPath

# Add cf to path
Add-MachinePathItem $CloudFoundryCliPath
2 changes: 1 addition & 1 deletion images/win/scripts/Installers/Install-Edge.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $EdgeDriverDownloadUrl="https://msedgedriver.azureedge.net/${EdgeDriverLatestVer
$EdgeDriverArchPath = Start-DownloadWithRetry -Url $EdgeDriverDownloadUrl -Name $EdgeDriverArchName

Write-Host "Expand Microsoft Edge WebDriver archive..."
Expand-Archive -Path $EdgeDriverArchPath -DestinationPath $EdgeDriverPath -Force
Extract-7Zip -Path $EdgeDriverArchPath -DestinationPath $EdgeDriverPath

Write-Host "Setting the environment variables..."
setx EdgeWebDriver "$EdgeDriverPath" /M
Expand Down
2 changes: 1 addition & 1 deletion images/win/scripts/Installers/Install-Firefox.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $GeckoDriverDownloadUrl = $GeckoDriverWindowsAsset.browser_download_url
$GeckoDriverArchPath = Start-DownloadWithRetry -Url $GeckoDriverDownloadUrl -Name $GeckoDriverArchName

Write-Host "Expand Gecko WebDriver archive..."
Expand-Archive -Path $GeckoDriverArchPath -DestinationPath $GeckoDriverPath -Force
Extract-7Zip -Path $GeckoDriverArchPath -DestinationPath $GeckoDriverPath

Write-Host "Setting the environment variables..."
Add-MachinePathItem -PathItem $GeckoDriverPath
Expand Down
2 changes: 1 addition & 1 deletion images/win/scripts/Installers/Install-Go.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function Install-GoVersion

# Extract the zip archive. It contains a single directory named "go".
Write-Host "Extracting Go $latestVersion..."
Expand-Archive -Path $goArchPath -DestinationPath "C:\" -Force
Extract-7Zip -Path $goArchPath -DestinationPath "C:\"

# Delete unnecessary files to conserve space
Write-Host "Cleaning directories of Go $latestVersion..."
Expand Down
2 changes: 1 addition & 1 deletion images/win/scripts/Installers/Install-IEWebDriver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ catch {
}

$TempSeleniumDir = Join-Path $Env:TEMP "SeleniumWebDrivers"
Expand-Archive -Path $DriversZipFile -DestinationPath $Env:TEMP -Force;
Extract-7Zip -Path $DriversZipFile -DestinationPath $Env:TEMP;
Comment thread
dibir-magomedsaygitov marked this conversation as resolved.
Outdated
Remove-Item $DriversZipFile;

$SeleniumWebDriverPath = Join-Path $DestinationPath "SeleniumWebDrivers"
Expand Down
2 changes: 1 addition & 1 deletion images/win/scripts/Installers/Install-JavaTools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ $uri = 'https://ayera.dl.sourceforge.net/project/cobertura/cobertura/2.1.1/cober
$coberturaPath = "C:\cobertura-2.1.1"

$archivePath = Start-DownloadWithRetry -Url $uri -Name "cobertura.zip"
Expand-Archive -Path $archivePath -DestinationPath "C:\"
Extract-7Zip -Path $archivePath -DestinationPath "C:\"

setx COBERTURA_HOME $coberturaPath /M
2 changes: 1 addition & 1 deletion images/win/scripts/Installers/Install-MysqlCli.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Install-Binary -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentLi
$mysqlArchPath = Start-DownloadWithRetry -Url $MysqlVersionUrl -Name "mysql.zip"

# Expand the zip
Expand-Archive -Path $mysqlArchPath -DestinationPath "C:\" -Force
Extract-7Zip -Path $mysqlArchPath -DestinationPath "C:\"

# Adding mysql in system environment path
Add-MachinePathItem $mysqlPath