packaging itunes with customised itunesprefs.xml is killing me
Hi,
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 ?
Cheers
G
Answers (5)
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"
Comments:
-
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.
Cheers - gtalboys 9 years ago
No, I just added the xml files. Will adding the other 2 files stop iTunes from clobbering my xml files ?
Thanks
Comments:
-
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. - anonymous_9363 11 years ago-
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 - gtalboys 11 years ago
-
...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'. - anonymous_9363 11 years ago
Thanks
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.
Cheers
Comments:
-
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. - EdT 11 years ago-
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. - gtalboys 10 years ago
-
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. - EdT 10 years ago
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.