Jump to content

iTunes 4.7 switches


dkreifus

Recommended Posts

right, i have just found something...with administrative deployment in fact you dont even need administrative msi just launch setup and copy setup files from TEMP folder you can find itunes.msi file you need there.

next problem with error message that comes up if you try just installing this .msi with /qb switch what you need to add is "ISSETUPDRIVEN=0", "SILENT_INSTALL=1" and if yo uneed "REPAIR_INSTALL=1"

any other changes can be made with one of these properties:

ACTION=ADMIN AA="Audible Audio" AIF="AIFF Audio File" AIFC="AIFF Audio File" AIFCREGENTRY=0 AIFF="AIFF Audio File" AIFFREGENTRY=0 AIFREGENTRY=0 ALLUSERS=1 ALLUSERSPROFILE=C:\ APPLE_COMPUTER="C:\Documents and Settings\All Users\Application Data\Apple Computer\" ARPCONTACT="AppleCare Support" ARPHELPLINK=http://www.info.apple.com/ ARPHELPTELEPHONE=1-800-275-2273 ARPNOMODIFY=1 ARPPRODUCTICON=ARPPRODUCTICON.exe ARPURLINFOABOUT=http://www.apple.com ARPURLUPDATEINFO=http://www.apple.com/itunes/ ASSUME_MEDIA_DEFAULTS=0 ASSUME_QT_DEFAULTS=0 AUTOPLAY_CREATECD="Create a CD" AUTOPLAY_IMPORTSONGS="Import songs" AUTOPLAY_PLAYCD="Play audio CD" AUTOPLAY_SHOWSONGS="Show songs" CDA="Audio CD Track" CDDA="Audio CD Track" CD_CONFIGURATION="C:\Program Files\iTunes\CD Configuration\" CD_CONFIGURATION1="C:\Program Files\iTunes\CD Configuration\" CD_CONFIGURATION2="C:\Program Files\iTunes\CD Configuration\" CD_CONFIGURATION3="C:\Program Files\iTunes\CD Configuration\" COMPANYNAME="your company" DRIVERS=C:\WINNT\System32\drivers\ DWUSINTERVAL=30 HIDE_QT=0 INSTALLDIR="C:\Program Files\iTunes\" INSTALLLEVEL=1 INSTALL_DESKTOP_SHORTCUTS=0 IPODDIR="C:\Program Files\iPod\bin" IPODSERVICE.RESOURCES="C:\Program Files\iTunes\iPodService.Resources\" IPODSERVICE.RESOURCES1="C:\Program Files\iPod\bin\iPodService.Resources\" IPOD_BASE_DIR="C:\Program Files\iPod" ISSCRIPT_ENGINE_VERSION=8.1.0.293 ISSCRIPT_VERSION_MISSING="The InstallScript engine is missing from this machine. If available, please run ISScript.msi, or contact your support personnel for further assistance." ISSCRIPT_VERSION_OLD="The InstallScript engine on this machine is older than the version required to run this setup. If available, please install the latest version of ISScript.msi, or contact your support personnel for further assistance." ISSETUPDRIVEN=1 ISSETUP_UISEQUENCE_PROCESSED=1 ISVROOT_PORT_NO=0 ITL="Apple Computer, Inc." ITMS="iTunes Music Store URL" ITUNES="C:\Program Files\iTunes\" ITUNES1="C:\Documents and Settings\All Users\Application Data\Apple Computer\iTunes\" KEY_HAS_BEEN_REMOVED=0 M3U="M3U Audio Playlist" M4A="MPEG-4 Audio File" M4B="MPEG-4 Audio File (Protected)" M4P="MPEG-4 Audio File (Protected)" MOV="Movie File" MP2="MPEG Layer 2 Audio" MP3="MPEG Layer 3 Audio" MPEG="MPEG File" MPG="MPEG File" NEW_DIRECTORY1="C:\Program Files\iPod\" PARTNER_ID=-1 PARTNER_NAME=-1 PARTNER_VERSION=4.7.0.42 PLS="PLS Audio Playlist" QUICKTIME_INSTALL_STATUS=1 REBOOT=Suppress REPAIR_INSTALL=0 RMP="RealJukebox Music Package" ROOTDRIVE=C:\ SC_INFO="C:\Documents and Settings\All Users\Application Data\Apple Computer\iTunes\SC Info\" SETUPEXEDIR="C:\Documents and Settings\"your user name"\Desktop" SILENT_INSTALL=1 STANDARD_USE_SETUPEXE="This installation cannot be run by directly launching the MSI package. You must run setup.exe." TARGETDIR="C:\Program Files\iTunes\" USERNAME=your user name USERPROFILE=C:\ WAV="WAVE Audio File" WAVE="WAVE Audio File" _3BD526EA4F5D4126AA001BB12152916A="C:\Program Files\iTunes\iTunesMiniPlayer.Resources\en.lproj\" _6E1EDA19AF11470086F9B5D9E6F3C5C8="C:\Program Files\iPod\bin\iPodService.Resources\en.lproj\" _7F497CE61492463990D8CB03E227DF10="C:\Program Files\iTunes\iTunes.Resources\en.lproj\" _DC6F1346095D4B42AB0D66A8D3F7AEE6="C:\Program Files\iTunes\iTunesHelper.Resources\en.lproj\" ARPSYSTEMCOMPONENT=1 ARPNOMODIFY=1 ARPNOREMOVE=1 ISSETUPDRIVEN=0

post results guys works for me just need to roll this update out now.:)

cheers!

Link to comment
Share on other sites


@prathapml,

these are not quite switches they are properties that are described inside every MSI file under Property paragraph, so these are unique for this particular package and not nesseceraly will work for all others, some will like USERNAME or COMPANYNAME.

@durex,

when you launch installation in %USERPROFILE%\Local Settings\Temp you will find various log files and temp files so if you keep your install open you will see what it does by reading log files, most of the time;)

p.s. you can add any of these properties into msi using something like orca and not writing them in your command line:)

good luck!

Link to comment
Share on other sites

Okay, so this thread is going in all sorts of directions, so I figured I'd toss up my VBScript to install iTunes 4.7 (for whatever it's worth).

- Lucid

' Automatic iTunes installation and configuration script.

Option Explicit
Dim WshShell, objFSO, SystemDrive, strMessage

On Error Resume Next

Set WshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
SystemDrive = WshShell.ExpandEnvironmentStrings("%Systemdrive%")


' Executes the installtion process using the "Setup.iss" answer file.
WshShell.Run "iTunesSetup.exe -s", 1, False

' Displays a notice for 10 seconds for the end user's benefit.
strMessage = "Please ignore the iTunes Welcome window that will be displayed on your screen during the installation process." + (Chr(13)& Chr(13)) + "(The window will remain on your screen until the iTunes installation finishes.)"
WshShell.Popup strMessage, 10, "Please be patient...", 64

' Verifies that the installer is loaded (checks every two seconds).
While WshShell.AppActivate("InstallShield - iTunes") = FALSE
wscript.sleep 2000
Wend
WScript.Sleep 2000

'Brings the installer to the foreground (seems to need both activations to work correctly).
WshShell.AppActivate "InstallShield - iTunes"
WScript.Sleep 1000
WshShell.AppActivate "iTunes for Windows"
WScript.Sleep 1000

'Sends keystroke to initiate the installation.
WshShell.SendKeys "N"


' Waits for the installation process to complete by looking for the log file.
Do until objFSO.FileExists("setup.log")
  WScript.Sleep 3000
Loop


' Renames the log file in the event that the software ever needs to be reinstalled.
If objFSO.FileExists ("setup.log") Then
If objFSO.FileExists ("LastSetup.log") Then
 objFSO.DeleteFile "LastSetup.log", True
End if

objFSO.CopyFile "setup.log", "LastSetup.log", True

If objFSO.FileExists ("setup.log") Then
 objFSO.DeleteFile "setup.log", True
End If
End If



' OPTIONAL CUSTOMIZATIONS
' Configures QuickTime preferences.
If objFSO.FileExists ("QuickTime.qtp") Then
objFSO.CopyFile "QuickTime.qtp", (SystemDrive & "\Documents and Settings\All Users\Application Data\Quicktime\QuickTime.qtp"), True
End If

If objFSO.FileExists (SystemDrive & "\Documents and Settings\All Users\Desktop\QuickTime Player.lnk") Then
objFSO.DeleteFile (SystemDrive & "\Documents and Settings\All Users\Desktop\QuickTime Player.lnk"), True
End If

WshShell.RegWrite "HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\ActiveX\QTTaskRunFlags", 2, "REG_DWORD"

' Uses TaskKill to remove the taskbar icon right away instead of waiting for a restart.
WshShell.Run "%COMSPEC% /C TASKKILL /F /IM qttask.exe", 1, False


Wscript.Quit

Link to comment
Share on other sites

I am also impressed with the properties specific to iTunes.msi file (thanks to hulala.[uk]) and would like to know if this was possible for other msi files as well, and how to do so. As far as iTunes.msi is concerned, this is what my sample batch file looked like:

@echo off

echo.

echo trying itunes...

start /wait iTunes.msi ISSETUPDRIVEN=0 SILENT_INSTALL=1

It installs iTunes with an interface that looks like if you had used the "/qb" switch with normal msi. However, upon first run, iTunes complains about not being able to import or burn files because the drivers are missing. I do not own an iPod, so I don't know if other functions were affected also. Perhaps an explanation and clearer post of the individual properties would be beneficial.

Link to comment
Share on other sites

yeah ive noticed that as well, first error is to do with UpperFilters in your CDROM controls(HKLM\SYSTEM\CurrentControlSet\Contorls\Class\{4D36...), this is how it checks if its own driver is loaded to control cd for burning.

it also doesnt copy any iPod software at all...

i assume that it doesnt do any associations either...:(

well it seems that job needs to be redone again...i mean what a piece of shait this installer is...may be i will just write to stupid apple and try to get answer from them,i can see you saying not a chance:(

another solution i might end up using is to repackage it.

what i have done and may be this will help is that ive done full administrative image with some extra folders it creates there.

setup.exe /a /r /f1c:\setup.iss

and then point it to something like c:\itunes47 you will see what happens

but then when im trying to deploy it looks very promising even says in setup.log

ResultCode=0,

which is Success, but still not a single file in %ProgramFiles% :(

this is the command line i use to deploy it after ive done admin image

setup.exe /s /a /s /sms /f1c:\setup.iss

(there is no .exe file within admin image folder)

Link to comment
Share on other sites

Yea... it appears if youre going to use these parameters it strips them all out except the ones you specify so you need to specify parameteres to associate with files, cdburning, install ipod software, etc...

i think ill just stick with my vbs/setup.iss combo.

Link to comment
Share on other sites

Durex, I have no idea how to use the vbscript and setup.iss combo thingy, can you guide me through it, As I would love to be able to silently install this...

I use a .bat file to install everything, so hopefully u have enough info...

If I can learn what the vbscript and other stuff is I will know it for future silent installs... Thanks heaps.

Link to comment
Share on other sites

I actually decided to write up this guide for all who are interested... its my 1st for this place, so please... ANY suggestions are very much welcome.

iTunes v4.7 Silent Installation

Updated: 12/14/04 @ 10:10 EST

Overview

This guide will walk you through configuring a silent installation of iTunes v4.7 for use with a Windows XP Unattended Installation, using VBScripting. It also explains why the workaround is necessary as well as how to uninstall the optional QuickTime components that arent required for iTunes.

Why an iTunes silent installation is such a pain in the arse...

The reason why youre forced to go through these somewhat painful steps in order to install iTunes without any user intervention is simply because the installer its packaged in is screwed up. Ive seen a few people say this started occurring in version 4.7... I never tried it prior to this, so Im not sure if this is the case. If it worked without issue you would have a couple different options available to accomplish this.

You should be able to use the -s parameter (after creating the setup.iss file) and have it automatically install without intervention, but for some reason your still prompted with the 1st initial screen that youre forced to click 'Next' to... after you hit next, it installs silently as it should... but this obviously isnt a true silent install.

Another option you should have available to you is similar to what prathapml touched on... using the msi thats packaged in the installer with the '/QB' parameters, but this come back with some stupid error.

So alas, youre forced to brew up some work-around to accomplish this if you dont want to touch the install at all...

Configuring your iTunes silent install

1. Uninstall iTunes if you already have it installed.

2. Install iTunes using the following command

setup.exe -r

This will launch the installer as normal, enter the options during this install exactly how you want it setup after your silent install.

3. Once you complete the installation process, you should be able to find the 'answer file' it created, with all the option you chose, in your WINDOWS folder. Place it in the same location that the iTunes setup.exe is going to be in on your UA CD.

4. Open notepad, copy and paste the following in it and save it as 'setup.vbs'. Place this in the same location as mentioned above.


Dim FSO, WshShell, AllDrives, CDROM, SYSD, APP, MsgBox
Set FSO = CreateObject("Scripting.FileSystemObject")
Set AllDrives = FSO.Drives
Set WshShell = WScript.CreateObject("WScript.Shell")
SYSD = WshShell.ExpandEnvironmentStrings("%Systemdrive%")
' Check for CDROM
For Each objDrive In fso.Drives
If objDrive.DriveType = "4" And objDrive.IsReady Then
If fso.FileExists(objDrive & "\WIN51") Then cdrom = objDrive
End If
Next
If Len(CDROM) = 0 Then
MsgBox "Error: CD-ROM not found!",vbCritical,"Diskeeper"
WScript.Quit
End if
APP = CDROM & "\Custom\Applications"
' Launch Silent Installer
WshShell.Run (APP & "\iTunes\setup.exe -s -f2" & SYSD & "\iTunes.log")
' Wait for Install Window to come to focus
Do until WshShell.AppActivate ("iTunes for Windows")
WScript.Sleep 2000
Loop
WScript.Sleep 500
' Hit N for Next
WshShell.SendKeys "N"
' Wait for Installation to complete by checking for the iTunes.log
Do until FSO.FileExists(SYSD & "\iTunes.log")
WScript.Sleep 3000
Loop
WScript.Quit

5. Now you need to modify this file thats specific to your setup

  • a. The text in red is the parent folder where all your application install folders should be. The 'Custom' folder in this example is on the same level as i386 and $OEM$. Inside this, I have this 'Applications' folder (as well as a couple other folders for regtweaks and drivers, but those arent pertinent to this example) and within the Applications folder I have folders for each pieces of software that I want to install during my UA (ie: iTunes, Diskeeper, WinRAR, etc).
    b. The text in orange is obviously the specific folder and install exe for iTunes
    NOTE: You could simply specify the full path and file of the setup.exe on the APP line and get rid of everything in Orange, but this way I can use the entire upper portion of code for other VBScripts as well

6. Now call the setup.vbs script from your RunOnceEx.cmd, similar to the following:

REG ADD %KEY%\033 /VE /D "iTunes v4.7" /f
REG ADD %KEY%\033 /V 1 /D "<Enter Path to iTunes folder here>\setup.vbs" /f

setup.vbs Explained

Everything above the line starting with 'APP' declares and sets variables, including one for your CD-ROM drive. This example assumes you have a file 'WIN51' in the root of your UA CD, if you dont, simply replace this with a file that does exist.

The next 15 or so lines (down to the 'Hit N for Next' line) launches the installer, waits for the dialog box to appear, then simulates the 'N' keystroke so next is chosen.

The installer creates a log file (iTunes.log), once its complete, at the root of your system drive, the last loop statement looks for this before the script completes. If this wasnt added the VBScript would complete and RunOnceEx would start the next line even though iTunes is still installing. Whether or not you want to keep this file (I dont bother), you may want to include it to be deleted in your cleanup.cmd.

Hate QuickTime

I hate it and while you think you dont hate it, you do and unwillingly, QuickTime is also installed during your iTunes setup. In fact iTunes uses key component from it to operate, so unfortunately you cant uninstall it completely. You can, however, uninstall the optional components, which include the shortcuts for quicktime it creates.

Again, I couldnt find any easy way to this (one liner batch command), so I whipped up this script...

Set WshShell = WScript.CreateObject("WScript.Shell")

' Launch Uninstaller
WshShell.Run "C:\WINDOWS\unvise32qt.exe /s C:\WINDOWS\System32\QuickTime\Uninstall.log"

' Wait for Uninstall Window to come to focus
Do until WshShell.AppActivate ("QuickTime Uninstall")
   WScript.Sleep 2000
Loop

WScript.Sleep 500

' send 1 'tab' keystrokes to choose 'Uninstall'
WshShell.SendKeys "{TAB}"

' send the 'enter' keystroke
WshShell.SendKeys "{ENTER}"

' Wait 5 seconds for Uninstall to Complete
WScript.Sleep 5000

WScript.Quit

The only thing with this you may have to alter is the last Sleep line... depending on how slow your system is, you may need to increase this, but it should leave for plenty of time.

I called this 'UIQT.vbs' (UnInstall QuickTime) and placed it in the same folder as my iTunes files. I also created a seperate line for RunOnceEx to call it from as I wanted to treat the installation of iTunes and uninstallation of QuickTime components as 2 seperate items. If its not obvious (which it really should), you want to make sure you run this script after youve run the iTunes installer.

Thats pretty much it. Again.. my 1st guide for this place, so I hope others will find it helpful and easy. Let me know if anything should be clarified, added, removed, etc...

Link to comment
Share on other sites

  • 2 months later...

Durex, I was wondering if you could clear up a few things for me about the parts I'm supposed to modify. I guess I should start by saying I haven't tried it out yet, because I'd like to get it to work from the get go.

I guess I'm a little thrown off by the "APP = CDROM & "\$OEM$\Applications" line. During my unattended install, iTunessetup.exe and everything in my cd's \$OEM$\$1 gets copied over to my systemdrive (c:\). So I'm not running the install from the cdrom. Does that change anything ? What should I put in the place if the setup exe is located at %systemdrive%\Install\Applications\iTunes\ ?

By the way, I'm trying to keep my unattended cd as modular as possible, so if I can use %systemdrive% instead of C:, that would be great. Any help in this matter would be greatly welcome, as this is the final item I need to get right.

I tried using Hulala's modified msi file, but while it does install silently, when I try to run iTunes after a fresh install, it doesn't start iTune but the setup process and asks for the msi file, which has been deleted because of my cleanup.cmd. Weirdly enough, when trying out the .msi on my other machine ( not during a fresh install or anything ) it installs silently fine using the method I use on my unattended cd. Rather than spending 3 hours wrapping my mind around why that might be I'd rather try your method.

Anyway, I hope you can make a little sense from what I've been saying, and can provide me with the answers I need. Thanks in advance.

Link to comment
Share on other sites

Be glad to help...

This script was designed assuming youre installing programs directly from the CD, which I do. To modify this to reflect installing from the hard drive like many others, including yourself do as well, take the following steps.

1. off you can remove the following code from the script:

' Check for CDROM
For Each objDrive In fso.Drives
If objDrive.DriveType = "4" And objDrive.IsReady Then
If fso.FileExists(objDrive & "\WIN51") Then cdrom = objDrive
End If
Next

If Len(CDROM) = 0 Then
MsgBox "Error: CD-ROM not found!",vbCritical,"Diskeeper"
WScript.Quit
End if

APP = CDROM & "\Custom\Applications"

All this does is figure out which drive is the CDROM and set a variable for it. "The APP =" line is setting APP equal to the "CDROM drive\Custom\Applications" folder, which is where my application install folders reside.

2. Replace this line:

WshShell.Run (APP & "\iTunes\setup.exe -s -f2" & SYSD & "\iTunes.log")

with this line:

WshShell.Run (SYSD & "\Install\Applications\iTunes\setup.exe -s -f2" & SYSD & "\iTunes.log"")

As you can see I changed APP to SYSD (which is the variable for your systemdrive) then the folder where your setup.exe resides.

After making these couple changes, you should be good to go.

Let me know if you have any other questions / issues!

Link to comment
Share on other sites

hulala posted a re-packaged msi someplace around here which is supposed to silently install itunes without any switches and eliminates the 'Next' problem of the original installer... but based on analfoams post, there may be issues with it and I dont think he's updated it for the latest version of iTunes.

You could also use autoit to install this I would imagine. I havent used it myself, but search around.. its covered in quite a bit of detail around here.

Other than these methods, there isnt any other way to install iTunes in a truley unattended fashion. Because the installsheild doenst work like its supposed to and hangs at that initial 'Welcome' screen, causing you to manually press next to continue, we're forced to resort to these types of work arounds which press it for you.

Id be happy to clear anything up for you to make it that much easier to implement if youd like. Its actually a pretty straight forward cut and paste from my guide.. with the couple changes I mentioned to reflect your specific settings.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...