Skip to content

Instantly share code, notes, and snippets.

@denblackstache
Created February 22, 2015 22:39
Show Gist options
  • Save denblackstache/a8466c1521a054c9e69f to your computer and use it in GitHub Desktop.
Save denblackstache/a8466c1521a054c9e69f to your computer and use it in GitHub Desktop.
iTunes Silent Installer | Without Bloatware
# Set-ExecutionPolicy to RemoteSigned to start this script
# Checking out the 7z
if (-not (test-path "C:\Program Files\7-Zip\7z.exe")) {throw "C:\Program Files\7-Zip\7z.exe needed"}
set-alias sz "C:\Program Files\7-Zip\7z.exe"
$source = "./iTunes64Setup.exe"
$dest = "./iTunes64Setup"
# Unpack Bloatware
sz x -y $source "-o$dest"
# Install The iTunes main parts
cd $dest
Start-Process -FilePath msiexec -ArgumentList /i, AppleApplicationSupport.msi, /passive -Wait
Start-Process -FilePath msiexec -ArgumentList /i, AppleMobileDeviceSupport64.msi, /passive -Wait
Start-Process -FilePath msiexec -ArgumentList /i, iTunes64.msi, /passive -Wait
# Destruct
cd ..
Remove-Item $dest -Force -Recurse
Write-Host "Press any key to continue..."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Write-Host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment