Last active
July 9, 2024 19:13
-
-
Save haridhayal11/663799a46ea3608c0ea0a07773cca34f to your computer and use it in GitHub Desktop.
steam-update-no-admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Steam Installer Downloader and Extractor Script | |
# Define the URLs and file paths | |
$steamUrl = "https://cdn.akamai.steamstatic.com/client/installer/SteamSetup.exe" | |
$steamPath = "$env:USERPROFILE\Downloads\SteamSetup.exe" | |
$extractPath = "$env:USERPROFILE\Downloads\SteamSetup_Extracted" | |
# Function to download a file | |
function Download-File($url, $outputPath) { | |
Write-Host "Downloading from $url..." | |
try { | |
Invoke-WebRequest -Uri $url -OutFile $outputPath -ErrorAction Stop | |
Write-Host "Download completed successfully." | |
return $true | |
} catch { | |
Write-Host "Failed to download: $_" | |
return $false | |
} | |
} | |
# Download Steam installer | |
if (-not (Download-File $steamUrl $steamPath)) { | |
Write-Host "Failed to download Steam installer. Exiting script." | |
return | |
} | |
# Create extraction directory | |
New-Item -ItemType Directory -Force -Path $extractPath | Out-Null | |
# Extract Steam installer using 7-Zip | |
Write-Host "Extracting Steam installer..." | |
try { | |
$process = Start-Process -FilePath "7z" -ArgumentList "x", "`"$steamPath`"", "-o`"$extractPath`"", "-y" -NoNewWindow -PassThru -Wait | |
if ($process.ExitCode -ne 0) { | |
throw "7-Zip exited with code $($process.ExitCode)" | |
} | |
Write-Host "Extraction completed successfully." | |
} catch { | |
Write-Host "Failed to extract Steam installer: $_" | |
} | |
# Provide information to the user | |
Write-Host "Steam installer has been downloaded to: $steamPath" | |
Write-Host "Contents have been extracted to: $extractPath" | |
Write-Host "You can examine the extracted files to see the contents of the Steam installer." | |
Write-Host "To install Steam, you can run the original 'SteamSetup.exe' file." | |
Write-Host "For a silent installation, you can run it with the '/S' parameter from a command prompt or PowerShell." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment