Friday, October 24, 2014

Quick and Dirty iTunes/Quicktime Bundle Script using SCCM

Unfortunately, iTunes doesn't like being installed outright.

There are a few happy ways to get it to install. 

For this quick and dirty method, download iTunes or iTunes64, depending on your deployment, and Quicktime. If you're using a Mac to manage this mess, like me, be sure to download the Windows versions. 12.0.1 is current as of this tutorial.

Once downloaded, extract the contents of the .exe files using 7zip or Keka (Mac)


You'll find four .msi files in the QuickTimeInstaller folder, and six in each iTunesSetup folder. Copy QuickTime.msi to both iTunesSetup folders, and dump all the other QuickTime files.

Rename iTunesSetup to 12.0.1 and 12.0.1_64bit, for easy recognition, and delete SetupAdmin.exe.  These will function as the version folders you put in your iTunes folder on your application server or distribution point. 

This is the install.cmd script for 32-bit iTunes in 32-bit Windows 7.
@echo off
cls
echo Installing Apple Application Support
msiexec /i "%~dp0AppleApplicationSupport.msi" /qn /norestart ALLUSERS=true
echo Installing Mobile Device Support
msiexec /i "%~dp0AppleMobileDeviceSupport.msi" /qn /norestart
echo Installing Apple Software Update
msiexec /i "%~dp0AppleSoftwareUpdate.msi" /qn /norestart
echo Installing Bonjour
msiexec /i "%~dp0Bonjour.msi" /qn /norestart
echo Installing iTunes
msiexec /i "%~dp0iTunes.msi" /qn /norestart
echo Installing QuickTime
msiexec /i "%~dp0QuickTime.msi" /qn /norestart INSTALL_DESKTOP_SHORTCUT="FALSE"
echo Cleaning Up Installation
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "QuickTime Task" /f
if exist "C:\Users\Public\Desktop\QuickTime Player.lnk" del "C:\Users\Public\Desktop\QuickTime Player.lnk"
if exist "C:\Users\Public\Desktop\iTunes.lnk" del "C:\Users\Public\Desktop\iTunes.lnk"
exit /B %EXIT_CODE%
view raw install.cmd hosted with ❤ by GitHub

This install.cmd is for 64-bit iTunes in 64-bit Windows 7.
@echo off
cls
echo Installing Apple Application Support
msiexec /i "%~dp0AppleApplicationSupport.msi" /qn /norestart ALLUSERS=true
echo Installing Mobile Device Support
msiexec /i "%~dp0AppleMobileDeviceSupport64.msi" /qn /norestart
echo Installing Apple Software Update
msiexec /i "%~dp0AppleSoftwareUpdate.msi" /qn /norestart
echo Installing Bonjour
msiexec /i "%~dp0Bonjour64.msi" /qn /norestart
echo Installing iTunes
msiexec /i "%~dp0iTunes64.msi" /qn /norestart
echo Installing QuickTime
msiexec /i "%~dp0QuickTime.msi" /qn /norestart INSTALL_DESKTOP_SHORTCUT="FALSE"
echo Cleaning Up Installation
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "QuickTime Task" /f
if exist "C:\Users\Public\Desktop\QuickTime Player.lnk" del "C:\Users\Public\Desktop\QuickTime Player.lnk"
if exist "C:\Users\Public\Desktop\iTunes.lnk" del "C:\Users\Public\Desktop\iTunes.lnk"
exit /B %EXIT_CODE%
view raw install.cmd hosted with ❤ by GitHub


Put the install.cmd in the same folder as the .msi files. This will be the SCCM executable.

Notice the Desktop Shortcut variable in the QuickTime installation? This code is reused for earlier versions of QuickTime, some of which actually respond; the if exist statement is only a fallback.

Always use the exit code snippet to the end of any batch script; SCCM may not be sensitive to the orphaning of a script, and an orphaned default installation will run 120 minutes before forcing detection. 

These scripts are likely to work for future versions of iTunes (QuickTime has stayed at 7.5.5 for a long time), and have worked without any editing since version 11 of iTunes, as the .exe files extract to .msi files of the same names. 

In order to make this script deployable, use the Manual Script Application Installer Method.


I've since evolved this process so that installers are individually deployed, and post configuration is done via batch script, which then calls the individual installers as dependencies. The process is a bit more involved, but also cleaner. 

2 comments:

  1. could you possibly detail your process where installers are individually deployed? I've attempted to use a dependency based installation method of individual msis to no avail.

    ReplyDelete
  2. any support on rollback or uninstallation.

    ReplyDelete