gosh Posted October 9, 2003 Posted October 9, 2003 Don't you hate it when you spend months making an unattended cd, only to have it be outdated less than a month after you burned it to cd? Then you have to go through the whole process again - adding new hotfixes, new software, things like that. So far i haven't seen anyone address this issue. Well let's think outside of the box as i show you guys how to make your old unattend cd always up to date.Below is current code in my apps.bat file that i use to install. As you can see, i'm going to rewrite the section later because of other changes i've made (my new cd is going to use winpe to install xp, bypassing text mode).REMREM Is it local? If yes, call the local apps.bat and exit. If no, continue processing.REM:decideREM this section will need to be rewrittenREM IF exist a:\apps.bat goto aappsIF exist c:\apps.bat goto bappsIF exist d:\apps.bat goto cappsIF exist e:\apps.bat goto dappsIF exist f:\apps.bat goto eappsIF exist \\%myserver%\Install$\apps.bat goto fappsgoto PrePreecho "using current apps.bat (no changes)" >> %windir%\apps.log:aappsecho "using a:\apps.bat" >> %windir%\apps.logcall a:\apps.batexit:bappsecho "using c:\apps.bat" >> %windir%\apps.logcall c:\apps.batexit:cappsecho "using d:\apps.bat" >> %windir%\apps.logcall d:\apps.batexit:dappsecho "using e:\apps.bat" >> %windir%\apps.logcall e:\apps.batexit:eappsecho "using f:\apps.bat" >> %windir%\apps.logcall f:\apps.batexit:fappsecho "using \\%myserver%\Install$\apps.bat" >> %windir%\apps.logcall \\%myserver%\Install$\apps.batexitHere is my thought process behind the code. You place this code at the top of a batch file run by GuiRunOnce in your unattend file. The batch file runs, and the first thing it does it look for another apps.bat. If it finds an apps.bat, it runs it and stops processing any other commands in your batch file. If it doesn't find another apps.bat, it keeps processing it's self.For example, lets say you burn an unattended cd and format. A month later, a new version of Nero comes out, and you want the new version of Nero to be installed and not the nero on your cd. So on your d drive you make apps.bat. Apps.bat is a copy of the batch file on your cd. The only difference is d:\apps.bat runs the updated version of nero on your hard drive, not the one on the cd. So you run your unattended cd, when your batch file is run it sees d:\apps.bat exists, so it runs that and stops processing commands. This way, your unattended cd is ALWAYS up to date. Even if your unattended cd is a year old, this method will keep your cd up to date.As a side note, i had to remove the line looking for a:\apps.bat because during setup a message would come up saying a disk in drive a could not be found. If anyone can get this working i would appreciate it. Change %myserver% to your other computer name if you want to install over the network.-gosh
un4given1 Posted October 9, 2003 Posted October 9, 2003 I understand the thought process, but the problem with this could be that someone might only have one drive, or maybe this CD is used in a corporate environment of some kind so access to these drives may be impossible. We all know that during the setup process network resources are not available so that idea is down the drain. here's your fix for the A drive problem. If it doesn't exist you will get text in your script that will say "The device is not ready." if it is unfound, but there is no prompt. dir a:\apps.bat>nul && IF exist a:\apps.bat goto aappsThis will use the "dir" command to check if a disk exists. if it exists then the output will be redirect to NUL, if it does not exist it displays "The device is not ready." The "&&" command is a conditional statement saying "if the first part has no errors then run the second." There are many other conditional statement options such as:& runs each command after another&& run each only if the one preceeding it was successful|| runs a command only if the command preceeding it failsThese are statements that very few people are even aware of. You can also chain these statements:This would run each command after the nexta.cmd & b.cmd & c.cmdThis would run each command only after the previous were successfula.cmd && b.cmd && c.cmdThis would run each command only after the previous faileda.cmd || b.cmd || c.cmdYou can also use grouping(a.cmd && b.cmd) || c.cmd This would run a.cmd and if it's successful, run b.cmd. If both a.cmd and b.cmd are successful then c.cmd does not run. If either of a.cmd or b.cmd fails then c.cmd would run.Here's some more examples:((a.cmd && b.cmd) & (c.cmd && d.cmd)) || notepad.exethis would run a.cmd and only if it were successful it would run b.cmd. Then it runs c.cmd no matter what and if c.cmd is successful it runs d.cmd. If any of the whole process files then it would launch notepad.exeLets assume that a.cmd, b.cmd and d.cmd exist... This statement would run a.cmd and b.cmd (because a.cmd exists). It would not run c.cmd because it does not exist, and because of that it would not run d.cmd either. Because one part of the whole process failed it would launch notepad.exe. If you changed the "||" to && then it would only launch notepad.exe if the whole process was successful.One step further...((a.cmd && b.cmd) & (c.cmd && d.cmd)) || (notepad.exe || e.cmd)assuming the same as above, e.cmd would only be launched if notepad.exe did not exist. It would not be launched if it does not exist.((a.cmd && b.cmd) & (c.cmd && d.cmd)) || (notepad.exe || e.cmd) || f.cmdf.cmd would only launch if part one failed and part 2 failed.((a.cmd && b.cmd) & (c.cmd && d.cmd)) || (notepad.exe && e.cmd) && f.cmdf.cmd woudl only launch if part one failed and part 2 was successful.Grouping works the exact same way it did back in math. (we all remember those days, right?)I hope this helps!
DaveXP Posted October 9, 2003 Posted October 9, 2003 what would be better is if you could install from a Second HDD then you can just add bits with burning new CD's all the time
un4given1 Posted October 9, 2003 Posted October 9, 2003 DaveXP: You can do it that way...Just create a boot disk that points to your second drive and launched winnt.exe from the i386 directory. Run it with a /? switch to see the options available.Just get yourself an old 2GB HD for just that purpose That would be perfect, right? I myself use RIS because I deal with more than 500 PCs, but that's not a solution for the normal home user.
Thanatos Posted October 9, 2003 Posted October 9, 2003 Thanks for the info, been looking for w way to determine whether the user wants to open a command prompt
Stinger12348 Posted October 9, 2003 Posted October 9, 2003 Why not spend the .50 cents or so, and re-burn a CD. I would think every month or so, we're able to afford .50 cents. But I can see where this would come in handy if you wanted to install applications that were unable to fit on the CD. Just my 2 cents though.
DaveXP Posted October 9, 2003 Posted October 9, 2003 DaveXP: You can do it that way...Just create a boot disk that points to your second drive and launched winnt.exe from the i386 directory. Run it with a /? switch to see the options available.Just get yourself an old 2GB HD for just that purpose That would be perfect, right? I myself use RIS because I deal with more than 500 PCs, but that's not a solution for the normal home user.it know good to me that way i have a Home Network i also look after my uncles PC and My Friends PC so it needs to be on disk but that for the information on how to do the HDD way.
data0002 Posted October 9, 2003 Posted October 9, 2003 even better why not use a cd-rw instead that way you will only be using the one cdPaulData0002
gosh Posted October 9, 2003 Author Posted October 9, 2003 Apps.bat launches during the first boot into the gui, you DO have network access! Only cmdlines.txt doesn't have network access. Using my method you can put apps.bat on a floppy, another hard drive, another partition, another computer - anywhere you want. And sure you can burn a new cd when a new hotfix comes out, but do you really want to burn a new cd everytime a hotfix comes out? Using this method you can use the same cd for years while having up to date software.Using my method you can also install more software than a normal cd can hold. For example, you could put apps.bat locally and have it install office 2003, and other software. No longer are your unattended installs limited to your cd size. Now you're only limited by the free space on your hard drive.-gosh
un4given1 Posted October 10, 2003 Posted October 10, 2003 gosh: your method is just the CD version of what I do using RIS. It's great because I have created scripts to the point of only having to drop a new hotfix into a directory and I'm done. Software isn't much harder. I create a directory for it in the software directory and drop the EXE in there, and then I create a cmd file in the software directory with switches. The scripts automatically find all of these files and install them just like that. Everyone talks about "slipstream" everything, but why even go that far? That's just to prove that you can do it, that's all. I guarantee that my method is easier to administer than any other method you will find anywhere else. Gosh, I didn't know that you were launching that from the first login. For some reason I thought you were launching that from cmdlines.txt. I don't know where my mind was.
aresgodofwar Posted September 24, 2004 Posted September 24, 2004 or now since dvds are so cheap you could use one of those and not be limited by the size of a cd. i have been able to put a TON of Apps on a dvd and still not fill it up. of course, that doesn't include any games i might want to install. just your basic windows office nero alcohol acrobat im programs photoshop antivirus P2P and anything else i left out. I'm so glad dvd burners came around!
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now