Monday, July 2, 2018

Re Packaging Apple iTunes 10 6 1 7 and later

Re Packaging Apple iTunes 10 6 1 7 and later


iTunes comes as an EXE file which can be extracted easily with 7Zip. The five MSI I received were AppleApplicationSupport, AppleMobileDeviceSupport64, AppleSoftwareUpdate, Bonjour64 and iTunes64. The Apple Software Update MSI and Bonjour MSI can be discarded if you do not want to AutoUpdate your iTunes. Bonjour can be kept if you want to allow file sharing on your desktop fleet. We did not want this so we removed this MSI. If you want to install Bonjour then it can be installed silently with /qb! switch.

From this Version QuickTime is not part of iTunes. QuickTime can be packaged separately. more details for packaging this is in this post:
http://msiworld.blogspot.com.au/2012/06/re-packaging-apple-quicktime-7728056.html

Apple Application Support and Apple Mobile Device Support MSI can be installed silently with /qb! switch.

You will have to customize iTunes by creating an MST file.

1) Change the following Public Properties in the MST:
DESKTOP_SHORTCUTS = 0
DISABLEADVTSHORTCUTS = 0
SCHEDULE_ASUW = 0
AMDS_IS_INSTALLED = 1
BONJOUR_IS_INSTALLED = 1
REBOOT = ReallySuppress
NO_ASUW = 0
NO_BONJOUR = 0
IAcceptLicense = Yes
REGSRCH_DESKTOP_SHORTCUTS = 0

2) Install iTunes on a test machine and make all the customizations you want. All the customizations will be stored in following files:

a) "%userprofile%AppDataLocalApple ComputeriTunescache.db
b) "%userprofile%AppDataLocalApple ComputeriTunesiTunesPrefs.xml"
c) "%userprofile%AppDataRoamingApple ComputeriTunesiTunesPrefs.xml"
d) "%userprofile%AppDataRoamingApple ComputeriTunesPreferencescom.apple.iTunes.plist"
e) "%userprofile%AppDataRoamingApple ComputeriTunesPreferenceskeychain.plist"

Copy these files in C:ProgramDataApple ComputeriTunes folder in your MST file and then use the below script to run in Custom Action just before InstallFinalize. Condition to be kept as NOT REMOVE~="ALL"


Created by Piyush Nasa
Used to copy the config file to the current userappdatalocal directory.
on error resume next
Set oShell = CreateObject( "WScript.Shell" )
userprofile=oShell.ExpandEnvironmentStrings("%USERPROFILE%")
systemdrive=oShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")
Set fso = CreateObject("Scripting.FileSystemObject")
Set afile = fso.GetFile(systemdrive & "ProgramDataApple iTuneslocalcache.db")
strDestination1 =userprofile & "AppDataLocalApple ComputeriTunescache.db"
Set bfile = fso.GetFile(systemdrive & "ProgramDataApple iTuneslocaliTunesPrefs.xml")
strDestination2 =userprofile & "AppDataLocalApple ComputeriTunesiTunesPrefs.xml"
Set cfile = fso.GetFile(systemdrive & "ProgramDataApple iTunesRoamingiTunesPrefs.xml")
strDestination3 =userprofile & "AppDataRoamingApple ComputeriTunesiTunesPrefs.xml"
Set dfile = fso.GetFile(systemdrive & "ProgramDataApple iTunesRoamingPreferencescom.apple.iTunes.plist")
strDestination4 =userprofile & "AppDataRoamingApple ComputeriTunesPreferencescom.apple.iTunes.plist"
Set efile = fso.GetFile(systemdrive & "ProgramDataApple iTunesRoamingPreferenceskeychain.plist")
strDestination5 =userprofile & "AppDataRoamingApple ComputeriTunesPreferenceskeychain.plist"

fso.CreateFolder(userprofile & "AppDataLocalApple Computer")
fso.CreateFolder(userprofile & "AppDataLocalApple ComputeriTunes")
fso.CreateFolder(userprofile & "AppDataRoamingApple Computer")
fso.CreateFolder(userprofile & "AppDataRoamingApple ComputeriTunes")
fso.CreateFolder(userprofile & "AppDataRoamingApple ComputeriTunesPreferences")
afile.Copy(strDestination1)
bfile.Copy(strDestination2)
cfile.Copy(strDestination3)
dfile.Copy(strDestination4)
efile.Copy(strDestination5)

3) Add any HKCU registry key in a new component placed at the highest parent Feature. Set this as a keypath. This will ensure that the application is self healed when launched by the user.

Please note that this package works fine when deployed/installed through any deployment tool in System context as it will trigger the self heal. If you have to manually install this application then you need to add the file the LOCALAPPDATAFOLDER manually in your transform.

Hope this will expidite your packaging of iTunes application.

visit link download