Skip to content

Commit

Permalink
feat(software): chrome ARM and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Jun 6, 2024
1 parent 81b4b4c commit 716596b
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/playbook/Executables/SOFTWARE.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ param (

$msiArgs = "/qn /quiet /norestart ALLUSERS=1 REBOOT=ReallySuppress"
$arm = ((Get-CimInstance -Class Win32_ComputerSystem).SystemType -match 'ARM64') -or ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64')
$armString = ('x64', 'arm64')[$arm]

# Create temporary directory
$tempDir = Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath $([System.Guid]::NewGuid())
Expand All @@ -27,7 +26,7 @@ if ($Brave) {
}

Write-Output "Installing Brave..."
& "$tempDir\BraveSetup.exe" /silent /install 2>&1 | Out-Null
Start-Process -FilePath "$tempDir\BraveSetup.exe" -WindowStyle Hidden -ArgumentList '/silent /install'

do {
$processesFound = Get-Process | Where-Object { "BraveSetup" -contains $_.Name } | Select-Object -ExpandProperty Name
Expand All @@ -45,25 +44,22 @@ if ($Brave) {

# Firefox
if ($Firefox) {
if ($arm) {
$firefoxArch = 'win64-aarch64'
} else {
$firefoxArch = 'win64'
}
$firefoxArch = ('win64', 'win64-aarch64')[$arm]

Write-Output "Downloading Firefox..."
& curl.exe -LSs "https://download.mozilla.org/?product=firefox-latest-ssl&os=$firefoxArch&lang=en-US" -o "$tempDir\firefox.exe"
Write-Output "Installing Firefox..."
Start-Process -FilePath "$tempDir\firefox.exe" -WindowStyle Hidden -ArgumentList '/S /ALLUSERS=1' -Wait 2>&1 | Out-Null
Start-Process -FilePath "$tempDir\firefox.exe" -WindowStyle Hidden -ArgumentList '/S /ALLUSERS=1' -Wait | Out-Null
exit
}

# Chrome
if ($Chrome) {
Write-Output "Downloading Google Chrome..."
& curl.exe -LSs "https://dl.google.com/dl/chrome/install/googlechromestandaloneenterprise64.msi" -o "$tempDir\chrome.msi"
$chromeArch = ('64', '_Arm64')[$arm]
& curl.exe -LSs "https://dl.google.com/dl/chrome/install/googlechromestandaloneenterprise$chromeArch.msi" -o "$tempDir\chrome.msi"
Write-Output "Installing Google Chrome..."
Start-Process -FilePath "$tempDir\chrome.msi" -WindowStyle Hidden -ArgumentList '/qn' -Wait 2>&1 | Out-Null
Start-Process -FilePath "$tempDir\chrome.msi" -WindowStyle Hidden -ArgumentList '/qn' -Wait | Out-Null
exit
}

Expand Down Expand Up @@ -125,19 +121,20 @@ foreach ($a in $vcredists.GetEnumerator()) {

# 7-Zip
$website = 'https://7-zip.org/'
$download = $website + ((Invoke-WebRequest $website -UseBasicParsing).Links.href | Where-Object { $_ -like "a/7z*-$armString.exe" })
$7zipArch = ('x64', 'arm64')[$arm]
$download = $website + ((Invoke-WebRequest $website -UseBasicParsing).Links.href | Where-Object { $_ -like "a/7z*-$7zipArch.exe" })
Write-Output "Downloading 7-Zip..."
& curl.exe -LSs $download -o "$tempDir\7zip.exe"
Write-Output "Installing 7-Zip..."
Start-Process -FilePath "$tempDir\7zip.exe" -WindowStyle Hidden -ArgumentList '/S' -Wait 2>&1 | Out-Null
Start-Process -FilePath "$tempDir\7zip.exe" -WindowStyle Hidden -ArgumentList '/S' -Wait | Out-Null

# Legacy DirectX runtimes
& curl.exe -LSs "https://download.microsoft.com/download/8/4/A/84A35BF1-DAFE-4AE8-82AF-AD2AE20B6B14/directx_Jun2010_redist.exe" -o "$tempDir\directx.exe"
Write-Output "Extracting legacy DirectX runtimes..."
Start-Process -FilePath "$tempDir\directx.exe" -WindowStyle Hidden -ArgumentList "/q /c /t:`"$tempDir\directx`"" -Wait 2>&1 | Out-Null
Start-Process -FilePath "$tempDir\directx.exe" -WindowStyle Hidden -ArgumentList "/q /c /t:`"$tempDir\directx`"" -Wait | Out-Null
Write-Output "Installing legacy DirectX runtimes..."
Start-Process -FilePath "$tempDir\directx\dxsetup.exe" -WindowStyle Hidden -ArgumentList '/silent' -Wait 2>&1 | Out-Null
Start-Process -FilePath "$tempDir\directx\dxsetup.exe" -WindowStyle Hidden -ArgumentList '/silent' -Wait | Out-Null

# Remove temporary directory
Pop-Location
Remove-Item -Path $tempDir -Force -Recurse *>$null
Remove-Item -Path $tempDir -Force -Recurse -EA 0

0 comments on commit 716596b

Please sign in to comment.