Software Deployment Question

packaging itunes with customised itunesprefs.xml is killing me

12/23/2013 6806 views


I am trying to package itunes 11.3 and almost have it.  I have included the 2 customised itunesprefs.xml files and have these copied to the system at install time and then using the duplicatefiles table, I have them copied to their respective local and roaming folders under the users appdata.

All works fine when installing it as an admin or via SCCM when it is installed using the installer service.  However once it is  installed and i try to run it as a standard user the software self repairs.  This is what I want to happen.  Here's the problem, I see my customised itunesprefs.xml files get copied down but then they get overwritten by itunes generic itunesprefs.xml files and then I get asked to accept the EULA and itunes moans that Bonjour isn't installed.  How can I prevent itunes from overwriting the files I have put down ?



0 Comments   [ + ] Show comments


Community Chosen Answer


Did you create duplicateFile table entries for the below files?

"%UserProfile%\AppData\Local\Apple Computer\iTunes\cache.db"
"%UserProfile%\AppData\Local\Apple Computer\iTunes\iTunesPrefs.xml"
"%UserProfile%\AppData\Roaming\Apple Computer\iTunes\iTunesPrefs.xml"
"%UserProfile%\AppData\Roaming\Apple Computer\iTunes\Preferences\com.apple.iTunes.plist"

Answered 12/23/2013 by: jagadeish
Red Belt

All Answers

have you found the solution ?  I have same problem on version 12. Thank you. 
Answered 07/08/2015 by: sevendigit
White Belt

  • No. Still have the same issues with newer versions. I think it is to do with file versioning. Let me know if you found an answer.

No, I just added the xml files.  Will adding the other 2 files stop iTunes from clobbering my xml files ?


Answered 12/23/2013 by: gtalboys
Purple Belt

  • I've seen advice about using the DuplicateFile table but, for user profile-targetted files or registry data, I always use self-healing.

    Search for John McFadyen's blog about self-healing. In summary, you need to add a feature to contain the new user-level components. Then you need to find the feature which contains an adevrtised entry-point (the iTunes shortcut is the obvious choice) and make *that* feature a child of your new feature.

    The first time the shortcut is clicked, WI will self-heal the feature tree and all will be right with the world. It works.
    • Hi, I did create a new feature and put my CU components in there. The self healing seems to be working and the duplicate files action is running because I can see my itunesprefs.xml files dropped into the user's appdata locations. The problem is that once my files are copied in, iTunes overwrites them with it's itunesprefs.xml files. The reason I am using the duplicatesfile table is because there are 2 itunesprefs.xml files which do different things and need to be copied to different locations. I can't have 2 itunesprefs.xml files in the source folder (because they are the same name) so I call one itunesprefs.xml and the other itunesprefs1.xml and then use the duplicatefiles table to write them to the correct locations and rename them at the same time. Thanks
      • ...so put them both in a CAB file. It doesn't care about duplicate names. But, as I say, I don't bother with DuplicateFile since properly constructed self-healing just works, irrespective of same-named files.

        Did you move the shortcut-containing feature so that it becomes a child of your new feature?

        If you want to stop the built-in XML files being repaired, the Event Log will show you the ID for the component . You can then condition-out that component. I normally use '0=1'.
This content is currently hidden from public view.
Reason: Removed by member request For more information, visit our FAQ's.


I think I tried the cab route, but when the repair was run the cab file couldn't be found in the cach file because it is stripped out.  What is the way to get around this ?

I moved the shortcut-containing feature to be a child of my feature so it repairs each time.

I will check the event viewer to see if it gives me any info.


Answered 12/24/2013 by: gtalboys
Purple Belt

  • There are a couple of steps that I think you missed. What you need to do is to run a capture of the initialisation of iTunes and record the registry entries made to show that the initial XML files have been copied down and that the complaint about Bonjour being missing has been acknowledged. Then add those registry keys to the HKCU keys used in self healing.
    As far as the XML files are concerned, I have converted them into VBScript custom actions which write the XML files line by line to the correct folders during self healing thus avoiding the use of the duplicatefiles table. I did write a word document for an earlier release of iTunes which covers this process but I can't find it at the moment as we've just been flooded and I'm too knackered to search. Drop me an email at ert@pobox.com if you would like a copy when I have the energy to find it.
    • Thanks for the reply. I have had a look and cannot see any any registry keys which control the EULA and Bonjour message. In fact I can accept the EULA and message about bonjour and open iTunes happily from then on. If I then delete the itunesprefs.xml files under the users local and roaming appdata, I get prompted for the EULA and bonjour again. Again, if I manually copy over the xml files which I have configured then I don't get prompted for this stuff which shows that the settings are controlled by these files. I have repackaged it this time just using my xml fles contained in cab files and once again when a repair is being done I can see itunes creates .xml files which are 1 K in size. My files then copy over the top of these and are 184K and 14K in size. These then get replaced again by itunes.
      • You are correct - it is my memory at fault. The bonjour and EULA settings are indeed in the XML files, and the trick is to install AND configure iTunes to the desired settings, including the EULA and bonjour settings. Then harvest the two XML files and make them part of your package. Since iTunes no longer needs to run a "repair" of these files, your original settings will remain intact.

This is the problem.  I have harvested the 2 xml files and included them in my package but in order for them to be copied to the current user iTunes needs to do the repair.  This is fine.  It is running the repair and my xml files are beig copied down (I can see them) but almost as soon as they are put down, they get overwritten again by iTunes and I get the EULA prompt and Bonjour missing message.  I know the files are OK because if I run the package as an admin, the files come down and iTunes opens fine.  it is only when the repair runs that iTunes overwrites my files.  It looks like iTunes generates the xml files on the fly and I cannot find any reference to them in the msi.

Answered 01/02/2014 by: gtalboys
Purple Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ