TheTechGuide Forum

General Category => Software => Topic started by: ali6 on March 06, 2003, 02:37:12 AM

Title: [GuiRunOnce]
Post by: ali6 on March 06, 2003, 02:37:12 AM
Hello,

I created an unattended Win XP BootCD with the section header [GuiRunOnce] and the key and value Command0=\"D:SoftProgName\", it works fine except if the user\'s PC has 2 physical HD and the CD-ROM drive assigned the letter E:, then I\'ll get an error and the program will not be installed.

Any suggestion.

Thanx
Title: [GuiRunOnce]
Post by: Zentinel on March 08, 2003, 05:36:47 AM
hello ali6!!

i solved the problem by copying the files i want to execute via [GuiRunOnce] temporarily to the harddisk and deleting them after the installation is completed... you can do this by creating a folder called \'$OEM$\' in the root of your cd... then you create a directory called \'$1\' for drive c:, \'$2\' for drive d: and so on... you can create a dir called \'$$\' for your c:winnt - directory... in this directory (\'$1\') you place the program you want to execute and then you write under [GuiRunOnce]:

command0=\"c:SoftProgName\" when your $OEM$ looks like this: \"$OEM$$1SoftProgName\"

i hope this helped you solve the problem...

you can create a batch-file that deletes the directory c:Soft after installation...

c ya

Zentinel
Title: [GuiRunOnce]
Post by: gosh on March 10, 2003, 10:35:43 PM
Hi

Like Zentinal said, using GuiRunOnce will allow you to use relative paths (wildcards) to work around this issue.

However there\'s a very simple way to find out what drive letter the cdrom is.

For example, let\'s assume youre making an unattended xp CD and on the root of the cd you have a file called WIN51IP.SP1 (cd identifer for xp with sp1).  In your unattend file under GuiRunOnce, add this:

[GuiRunOnce]
Command2=\"%windir%Source.bat\"

On your cd make $OEM$$$Source.bat

In Source.bat add the following:

----copy below to source.bat-------

@ECHO OFF
IF EXIST C:WIN51IP.SP1 set CDROM=C:
IF EXIST D:WIN51IP.SP1 set CDROM=D:
IF EXIST E:WIN51IP.SP1 set CDROM=E:
IF EXIST F:WIN51IP.SP1 set CDROM=F:
IF EXIST G:WIN51IP.SP1 set CDROM=G:
IF EXIST H:WIN51IP.SP1 set CDROM=H:
IF EXIST I:WIN51IP.SP1 set CDROM=I:
IF EXIST J:WIN51IP.SP1 set CDROM=J:
IF EXIST K:WIN51IP.SP1 set CDROM=K:
IF EXIST L:WIN51IP.SP1 set CDROM=L:
IF EXIST M:WIN51IP.SP1 set CDROM=M:
IF EXIST N:WIN51IP.SP1 set CDROM=N:
IF EXIST O:WIN51IP.SP1 set CDROM=O:
IF EXIST P:WIN51IP.SP1 set CDROM=P:
IF EXIST Q:WIN51IP.SP1 set CDROM=Q:
IF EXIST R:WIN51IP.SP1 set CDROM=R:
IF EXIST S:WIN51IP.SP1 set CDROM=S:
IF EXIST T:WIN51IP.SP1 set CDROM=T:
IF EXIST U:WIN51IP.SP1 set CDROM=U:
IF EXIST V:WIN51IP.SP1 set CDROM=V:
IF EXIST W:WIN51IP.SP1 set CDROM=W:
IF EXIST X:WIN51IP.SP1 set CDROM=X:
IF EXIST Y:WIN51IP.SP1 set CDROM=Y:
IF EXIST Z:WIN51IP.SP1 set CDROM=Z:
ECHO Please wait, Recovery Console is being installed locally.
%CDROM%i386winnt32.exe /dudisable /cmdcons /unattend
md %systemroot%Sourcei386
ECHO Please wait, source files are being copied.  This may take several minutes.
xcopy /Y /e %CDROM%i386*.* %systemroot%Sourcei386
ECHO Adding registry entries.
regedit.exe /s Source.reg
ECHO Done.
exit

--copy above to source.bat------

In the same folder make Source.reg.  In this file add the following:  

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionSetup]
\"SourcePath\"=\"%systemroot%Source\"
\"ServicePackSourcePath\"=\"%systemroot%Source\"


So in this example, the drive letter is saved as a variable.  In this example, i used the variable to make a flat (local source) of the xp files and installed recovery console silently.  Obviously you could modify the batch file to do whatever you want to do.

-GOSH
Title: [GuiRunOnce]
Post by: ali6 on March 11, 2003, 07:49:27 AM
Hello Zentinel

It didn’t work any other suggestions.

By the way I need that for booth Win 2k&XP.

My 2k CD is Win2k+SP4.27 & XP CD is WinXP+SP1

Thankz