Skip to content

Instantly share code, notes, and snippets.

@trumad
Last active April 8, 2024 14:08
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trumad/0196c04a0246727fc2413dabe3484da0 to your computer and use it in GitHub Desktop.
Save trumad/0196c04a0246727fc2413dabe3484da0 to your computer and use it in GitHub Desktop.
# Create a temporary directory if it doesn't exist
$tempDirectory = "C:\Temp"
if (-not (Test-Path $tempDirectory -PathType Container)) {
New-Item -ItemType Directory -Path $tempDirectory -Force
}
# Step 0: Backup Arc:
Write-Host "Backing up arc..."
& "C:\Program Files\7-Zip\7z.exe" a -t7z "c:\Temp\arcBackup.7z" "c:\arcBrowser\*" -mx=4
Write-Host "...Done"
# Step 1: Download the .appinstaller file
$appInstallerUrl = "https://releases.arc.net/windows/prod/Arc.appinstaller"
$appInstallerPath = "C:\Temp\Arc.appinstaller"
Invoke-WebRequest -Uri $appInstallerUrl -OutFile $appInstallerPath
# Step 2: Parse the .appinstaller file to get the MSIX download URI
[xml]$appInstallerXml = Get-Content $appInstallerPath
$msixDownloadUri = $appInstallerXml.AppInstaller.MainPackage.Uri
# Step 3: Download the MSIX file
$msixPath = "C:\Temp\Arc.x64.msix"
Invoke-WebRequest -Uri $msixDownloadUri -OutFile $msixPath
& "C:\Program Files\7-Zip\7z.exe" x "C:\Temp\Arc.x64.msix" -o"c:\arcBrowser" -y
# Cleanup: Remove temporary files
Remove-Item $appInstallerPath
Remove-Item $msixPath
Write-Host "Arc Browser has been downloaded and extracted to $extractPath"
@haven80
Copy link

haven80 commented Apr 8, 2024

Is it possible to use this script to dowload old Arc's versions?

@trumad
Copy link
Author

trumad commented Apr 8, 2024

Not with this script, and all the old versions are gone or at least not easily accessible by now.

But if you wanted to be a hero and save all future versions, you could write a cronjob or run a script on a timer. You would need to hit up "https://releases.arc.net/windows/prod/Arc.appinstaller" at least once a day to get the downloadURI from the xml file. You'd have to then download each new version. And maybe upload them to the internet archive or somewhere that other people can access them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment