SiMoNsAyS Posted August 19, 2004 Share Posted August 19, 2004 (edited) IntroductionFrom a time to now I've used a little batch that let me change between CDs during Windows setup.Lately I've improved the batch enough to be released.FeaturesUnattended! - No user intervention during the process.Small size - 300 kb are enough; just some batch files and a self-extacting archive.Easy to use - Fill some lines and burn!Professional look - A simple RunOnce window look.**CMDOW is necessary for thisThings You Need·Understand the process: Basic batch coding and basic RunOnce knowledge.·CMDOW is optional but totally recommended to give the process a clean look.·A simple text-editor. Notepad is ok.How It WorksAfter the RunOnce process finish the tool will give you a minute to change between media (CD or DVD doesn't matter).If correct CD is inserted then a batch file will run from it installing your applicacions. Once the batch finished, you'll be given another minute to insert your Windows CD.In case you want to skip this step there's no problem, all the process will run unattended and you won't need to press any button.GUI / InterfaceAs said, there's no buttons you need to press. You'll only see a RunOnce window and a line advertising you to insert the CD/DVD. [image 1]CMDOW is used to hide the command prompt window (recommended), or if you're not picky you can just left the command window. [image 2]How ToDownload the compressed archive and extract it. You'll find two folders, uAxp\ and uAapps\.uAxp\ is the root of your Windows setup disc (notice where's placed the $OEM$ folder). In a similar way, uAapps\ is the root of your applications CD or DVD.Add the applications installed from your Windows CD to uAxp\RunOnceEx.cmd, this batch file is necessary to be launched from cmdlines.txt. Then edit uAapps\Setup.cmd to add the applications you're going to install from the other media.That's all.What If...?... you don't insert the other media: Installation will stop for one minute, if the necessary CD/DVD is not found, setup will continue and you won't even need to press any button.... you insert the disc on other drive: Installation will stop for one minute, Setup.cmd on the root of the media inserted will be run (all your apps will be installed without user intervention if you include the necessary silent parameters). The tool will wait an additional minute after everything is installed and Windows setup will continue...... you insert the disc on the same drive: Same from above, but at the final pause you'll need to switch the discs on 1 minute.... you place the necessary files on a HD: You'll be able to install any application. This is useful if you have space problems and you don't own a DVD or DVD burner.Images [image 1] [image 2]F.A.Q.:Q) C: drive is present, why?A) For upgrading purposes, because if after some years you decide to create a new DVD or you want to install your applications from C:\ you can do it.If you don't want to remain in front of the monitor and you only have one CD reader, this will be your solution.Q) Can I increase/decrease the wait time?A) Yes, take a look at pause.cmd inside uAxp\$OEM$\uAapps.exe and just change a 2 digits number.I'm not a geek of batch files so if you think you can improve it, feel free to contact me.MORE TO BE WRITTEN...CD_DVD_Switcher.zip Edited May 21, 2005 by SiMoNsAyS Link to comment Share on other sites More sharing options...
Alanoll Posted August 19, 2004 Share Posted August 19, 2004 i should point out, you you're going to either switch the CD 4 times, or some hefty tidbits.but on a more technical side....let me write up some code for you to test with. Link to comment Share on other sites More sharing options...
SiMoNsAyS Posted August 19, 2004 Author Share Posted August 19, 2004 i should point out, you you're going to either switch the CD 4 times, or some hefty tidbits.if it doesn't fail my time line... it will wait a few time until check the cd:if it find's the file, variable it's established and setup installs officeif it don't finds it will continue installation bucause the variable it's not establishedalso it waits a time for you to switch the cd, but if both are inside 2 different units it will be no problemis this true? or there is a mistake, dunno...but on a more technical side....let me write up some code for you to test with.waiting... Link to comment Share on other sites More sharing options...
Alanoll Posted August 19, 2004 Share Posted August 19, 2004 I think I got everything you wanted, sorta.RunOnceEX.cmdREM CMDOW @ /HIDCLSTITLE Importing RunOnceEX EntriesIF EXIST D:\CD1.txt set XPCD=D:IF EXIST E:\CD2.txt set XPCD=E:IF EXIST F:\CD3.txt set XPCD=F:IF EXIST G:\CD4.txt set XPCD=G:IF EXIST H:\CD5.txt set XPCD=H:IF EXIST I:\CD6.txt set XPCD=I:IF EXIST J:\CD7.txt set XPCD=J:SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Applications" /fREG ADD %KEY%\005 /VE /D "Adobe Reader 6" /fREG ADD %KEY%\005 /V 1 /D "%XPCD%\install\AdobeReader6\AR6.msi /qn" /fREG ADD %KEY%\010 /VE /D "Alcohol 120" /fREG ADD %KEY%\010 /V 1 /D "%XPCD%\install\alcohol\setup.exe /qn" /fREG ADD %KEY%\010 /V 2 /D "REGEDIT /S %XPCD%\install\alcohol\register.reg" /fREG ADD %KEY%\015 /VE /D "Diskeeper 8" /fREG ADD %KEY%\015 /V 1 /D "%XPCD%\install\DiskeeperPro_8.0.459.exe /s /v/qn" /fREG ADD %KEY%\018 /VE /D "Microsoft Office 2003" /fREG ADD %KEY%\018 /V 2 /D "%XPCD%\install\changecd.cmd" /fREG ADD %KEY%\018 /V 1 /D "%XPCD%\install\Office\setup.exe TRANSFORMS=\"%XPCD%\Install\Office\office.mst\" /qn" /fREG ADD %KEY%\018 /V 3 /D "%XPCD%\install\changecd.cmd" /fREG ADD %KEY%\020 /VE /D "DU Meter 3" /fREG ADD %KEY%\020 /V 1 /D "%XPCD%\install\dumeter3.exe /VERYSILENT /SP-" /fREG ADD %KEY%\025 /VE /D "IsoBuster 1.5" /fREG ADD %KEY%\025 /V 1 /D "%XPCD%\install\IsoBuster1.5.exe /VERYSILENT /SP-" /fREG ADD %KEY%\025 /V 2 /D "taskkill /F /IM isobuster.exe" /fREG ADD %KEY%\030 /VE /D "Kerio Personal Firewall 2.1.5" /fREG ADD %KEY%\030 /V 1 /D "%XPCD%\install\KPF\Setup.exe -s" /fREG ADD %KEY%\035 /VE /D "MDAC 2.7 SP1 Hotfix" /fREG ADD %KEY%\035 /V 1 /D "%XPCD%\install\mdac\mdac.cmd" /fREG ADD %KEY%\040 /VE /D "MSN Messenger 6.1" /fREG ADD %KEY%\040 /V 1 /D "%XPCD%\install\MSN_Messenger_6.1.0202.msi /qn" /fREG ADD %KEY%\045 /VE /D "Nero Burning ROM 5.5" /fREG ADD %KEY%\045 /V 1 /D "REGEDIT /S %XPCD%\install\nero\register.reg" /fREG ADD %KEY%\045 /V 2 /D "%XPCD%\install\Nero\Nero551054.exe /silent /noreboot" /fREG ADD %KEY%\050 /VE /D "Importing Registry Tweaks" /fREG ADD %KEY%\050 /V 1 /D "REGEDIT /S %XPCD%\install\regtweaks.reg" /fREG ADD %KEY%\055 /VE /D "Cleaning Up and Rebooting" /fREG ADD %KEY%\055 /V 1 /D "%XPCD%\install\cleanup.cmd" /fEXITchangecd.cmdCMDOW @ /HIDCLSTITLE Changing CDIF EXIST D:\CD1.txt set XPCD=D:IF EXIST E:\CD2.txt set XPCD=E:IF EXIST F:\CD3.txt set XPCD=F:IF EXIST G:\CD4.txt set XPCD=G:IF EXIST H:\CD5.txt set XPCD=H:IF EXIST I:\CD6.txt set XPCD=I:IF EXIST J:\CD7.txt set XPCD=J:COPY /Y %XPCD%\Install\cd_prompt.vbs C:\cd_prompt.vbsCDR.EXE open %XPCD%start /wait wscript C:\cd_prompt.vbsCDR.EXE close %XPCD%DEL /Q /F C:\cd_prompt.vbsEXITcd_prompt.vbsMsgBox "Please insert CD2. When the drive is done flashing, press OK" , vbOKOnly, "Please Replace CD"So here's what it does....theoretically anyway (haven't tested)RunOnceEX.CMD imports the neccesary entries. Upon restart RunOnceEX will run...when it gets to the Office 2003 (can be any program realy), changecd.cmd will run in the background, and all you should see is a prompt saying "Please insert CD2. When the drive is done flashing, press OK", while at the same time, the CD rom drive %XPCD% should eject to replace the CD. (Note, I didn't code this to allow for more then one CDROM in use, if you have more then one, then you could just add more IF EXIST at the begining of RunOnceEX.cmd to check for a file on the second CD and change the variable accordingly) When you press OK on the prompt, the CDROM should reinsert. and Office will install. Then changecd.cmd runs again, to get the original CD back (can be left out if the rest of your RunOnce is from second CD, or it's the last entry. Just keep track if you need the original CD)Did I leave anythign out? CDR.EXE can be found form teh download section of the Unattend site. Link to comment Share on other sites More sharing options...
mazin Posted August 19, 2004 Share Posted August 19, 2004 Execuse me. Are these correct or just typos?REG ADD %KEY%\018 /VE /D "Microsoft Office 2003" /fREG ADD %KEY%\018 /V 2 /D "%XPCD%\install\changecd.cmd" /fREG ADD %KEY%\018 /V 1 /D "%XPCD%\install\Office\setup.exe TRANSFORMS=\"%XPCD%\Install\Office\office.mst\" /qn" /fREG ADD %KEY%\018 /V 3 /D "%XPCD%\install\changecd.cmd" /f Link to comment Share on other sites More sharing options...
Alanoll Posted August 19, 2004 Share Posted August 19, 2004 most likely typos.... REG ADD %KEY%\018 /VE /D "Microsoft Office 2003" /fREG ADD %KEY%\018 /V 1 /D "%XPCD%\install\changecd.cmd" /fREG ADD %KEY%\018 /V 2 /D "%XPCD%\install\Office\setup.exe TRANSFORMS=\"%XPCD%\Install\Office\office.mst\" /qn" /fREG ADD %KEY%\018 /V 3 /D "%XPCD%\install\changecd.cmd" /fbut like I said, I didn't test this Link to comment Share on other sites More sharing options...
SiMoNsAyS Posted August 19, 2004 Author Share Posted August 19, 2004 i've write a piece of code let me know if this can work (red is untested)deleted needed for this to work, sleep.exe on system32 Link to comment Share on other sites More sharing options...
mazin Posted August 19, 2004 Share Posted August 19, 2004 I think Alanoll's should work fine. Also, I think there's no point in setting two variables for the same drive. Link to comment Share on other sites More sharing options...
SiMoNsAyS Posted August 19, 2004 Author Share Posted August 19, 2004 I think Alanoll's should work fine. Also, I think there's no point in setting two variables for the same drive.because it's not the same drive, if D: has \$OEM$\BioHaZaRD.nfo will be %CDROM% and if E: has \Unattended.mst will be %OFFICE%. with Alanoll's code you HAVE to change between CDs, with mine (if it's ok ) you can change between CDs for a minute and if they are in different drives you DON'T HAVE to.ps: thanks Alanoll you give me the piece of code i needed Link to comment Share on other sites More sharing options...
Alanoll Posted August 19, 2004 Share Posted August 19, 2004 because it's not the same drive, if D: has \$OEM$\BioHaZaRD.nfo will be %CDROM% and if E: has \Unattended.mst will be %OFFICE%. with Alanoll's code you HAVE to change between CDs, with mine (if it's ok ) you can change between CDs for a minute and if they are in different drives you DON'T HAVE to.ps: thanks Alanoll you give me the piece of code i neededYour code has the problem that mine has a way to get around. Yours will ONLY work if you have BOTH CDs in at CMDLINES.TXT otherwise, as you said before it will just skip over Office. In yours, even though you set %OFFICE%, you won't be able to change CDs. RunOnceEX and all variables are expanded at the time of importing. If the variable is supposed to change, RunOnceEX does NOT take this into account, as the CMDLINE expands the variables before importing into the registry so they get inported as D:\setup.exe or whatever, NOT %OFFICE%\setup.exeYour for statements are fine (though C: really shouldn't be neccesary )All your's does is stall for 30 seconds, then runs Office setup IF the CD was in the CDROM when RunOnceEX was executed and the CDROM hasn't changed. This negates being able to change CDs but rather the CDs HAVE TO STAY IN THE DRIVE. However..... If you were to do something like I did, and call a batch file (inplace of the Office setups and sleep) THEN find teh Office CDROM, THEN EXECUTE from the same batch it will work (even if the CDROM is NOT in the drive when RunOnceEX is)and just to reiterate how RunOnceEX works. All that is happening when RunOnceEX.cmd is executed, is the %VALUE% is getting expanded to whatever is assigned to it (D: or whatever) and THEN imported into the registry as fixed strings. Upon restart is when the actual actions governed by the entries is executed. Link to comment Share on other sites More sharing options...
SiMoNsAyS Posted August 19, 2004 Author Share Posted August 19, 2004 @Alanoll very very interesting... i thought that the %VALUE% was imported to registry not the expanded path...also i've found another glitch, if you change the CDs in the same CD reader after %OFFICE% the value %CDROM% doesn't have any effect because it's not restored, don't know if you can understand me...anyway i know how to solve it, the solution it's just transform it in to a .cmd file and run it in the early stage of installation, from cmdlines.txt. i've got something in mind, when i'll come back i'll write again... until that, anyone would like to apport another solution... Link to comment Share on other sites More sharing options...
Alanoll Posted August 19, 2004 Share Posted August 19, 2004 I still kinda like mine....and in theory it's solid. In theory atleast.What exactly are you trying to do, and I can try again... Link to comment Share on other sites More sharing options...
SiMoNsAyS Posted August 20, 2004 Author Share Posted August 20, 2004 from cmdlines.txt call a office2003.cmdoffice2003.cmd:deleted i think this is enought, also it can be used a IF ERROR GOTO: and don't use the second pause but i don't know how to do it. Link to comment Share on other sites More sharing options...
Alanoll Posted August 20, 2004 Share Posted August 20, 2004 you really shouldn't technically install applications from CMDLINES.TXT especially ones that are heavy registry entry buggers like Office. The reason, the registry is VERY transitive during setup, and isn't finalized untill the VERY end of it, so ALOT of changes made aren't saved.however, you could just call that CMD file in your normal RunOnceEX routine instead of calling setup directly, just an idea. Link to comment Share on other sites More sharing options...
SiMoNsAyS Posted August 20, 2004 Author Share Posted August 20, 2004 ok i'll try first way from cmdlines.txt and if it doesn't work i'll try tha call from runonceexe. many thanks alanoll , if you find another solution please let me know it edited: someone can correct this one?deleted Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now