Jump to content

Make Your Unattended Cd Up To Date


 Share

Recommended Posts

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).

REM

REM Is it local?  If yes, call the local apps.bat and exit.  If no, continue processing.

REM

:decide

REM this section will need to be rewritten

REM IF exist a:\apps.bat goto aapps

IF exist c:\apps.bat goto bapps

IF exist d:\apps.bat goto capps

IF exist e:\apps.bat goto dapps

IF exist f:\apps.bat goto eapps

IF exist \\%myserver%\Install$\apps.bat goto fapps

goto PrePre

echo "using current apps.bat (no changes)" >> %windir%\apps.log

:aapps

echo "using a:\apps.bat" >> %windir%\apps.log

call a:\apps.bat

exit

:bapps

echo "using c:\apps.bat" >> %windir%\apps.log

call c:\apps.bat

exit

:capps

echo "using d:\apps.bat" >> %windir%\apps.log

call d:\apps.bat

exit

:dapps

echo "using e:\apps.bat" >> %windir%\apps.log

call e:\apps.bat

exit

:eapps

echo "using f:\apps.bat" >> %windir%\apps.log

call f:\apps.bat

exit

:fapps

echo "using \\%myserver%\Install$\apps.bat" >> %windir%\apps.log

call \\%myserver%\Install$\apps.bat

exit

Here 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

Link to comment
Share on other sites


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 aapps

This 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 fails

These are statements that very few people are even aware of. You can also chain these statements:

This would run each command after the next

a.cmd & b.cmd & c.cmd

This would run each command only after the previous were successful

a.cmd && b.cmd && c.cmd

This would run each command only after the previous failed

a.cmd || b.cmd || c.cmd

You 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.exe

this 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.exe

Lets 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.cmd

f.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.cmd

f.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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 11 months later...

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!

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...