Jump to content

Using WPI to install apps from a separate CD


Recommended Posts

I've searched for a post about this and couldn't find anything, but I think I may have figured it out. What I want to do is keep one CD with just Windows w/current hotfixes and one CD with current drivers/apps that I want to install. And I want the Windows installation to call the installation of the drivers/apps from the other CD. The reason for this is I can keep my Windows CD intact and only have to modify my drivers/apps CD for newer versions or changes for apps that I want to install.

I figure WPI is an excellent choice for installing the drivers/apps this way, I just need to be able to call WPI from the Windows installation while having it run from a different CD. After editing the WPI.cmd this is what I came up with:

I changed the CD-check file from WPI.ico to CD.txt to establish the %CDROM% variable. I did this because I need to check the drives/apps CD for the WPI.ico file to make sure the right CD is in the drive. Of course there will now have to be a CD.txt file at the root of both CDs.

REM Example, how to look for CDROM-drive. Must have WPI.ico at the root of the CD.
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\WPI.ico set CDROM=%%i:
echo Found CD-Rom as drive %CDROM%

changed to:

REM Example, how to look for CDROM-drive. Must have CD.txt at the root of the CD.
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\CD.txt set CDROM=%%i:
echo Found CD-Rom as drive %CDROM%

I then added these lines to check for the correct CD before continuing with WPI:

REM Determine if CD in CDROM-drive is WPI CD.
:WPIcheck
if exist %CDROM%:\WPI.ico goto WPI
echo Please insert WPI CD in drive %CDROM%:
pause
goto WPIcheck

:WPI

Lastly I changed wpipath to run from CD:

:WPI
REM Determine the WPI startup path.
REM if wpi should run off the cd the replace %~dp0 with %CDROM%.
set wpipath=%CDROM%

That's it. Could some please double check my scripting to see if this will have the correct result?

Thanks in advance.

Link to comment
Share on other sites


You have to make sure your CDs _both_ have cd.txt or whatever id file you want on them. After that, you have to either take out the cmdow @ hid line, or add your custom check for correct cd line before it. Something like this:

REM Example, how to look for CDROM-drive. Must have CD.txt at the root of the CD.
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\CD.txt set CDROM=%%i:
if exist %cdrom%\cd.txt goto exists
goto notexists
:exists
if exist %cdrom%\cd1.txt goto cd1
goto cd2
:cd1
rem The commands for CD1 go on the next line

goto exit
:cd2
rem The commands to be executed for CD2 go on the next line

goto exit
:exit
rem Put any commands (such as cleanup and the like) on the next line

exit

After that, your good to go!

~~HH

Edited by HeliumHigh
Link to comment
Share on other sites

  • 2 weeks later...

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