Jump to content

[GuiRunOnce] - Batch From CD-ROM?


Recommended Posts

Hi,

I am totally anal about not having anything copied over to the harddrive, even if it is later deleted.

I've managed to get all of my programs to install from CD, and my drivers to install from CD.

The only stupid thing that gets copied is one batch file, which I need to run from [GuiRunOnce] in winnt.sif.

Right now, its:

[GuiRunOnce]
%systemdrive%\Install\Install.cmd

Is there any way to get this batch file to run from CD within winnt.sif?

(Under DetachedProgram I know I can via:

DetachedProgram=".\system32\cmd.exe"
Arguments="/Q /C FOR /F %I IN (%SystemRoot%\SYSTEM32\$WINNT$.INF) DO (FOR %J IN (%I$OEM$) DO (IF EXIST %J (start /min /D%J Drivers.cmd)))"

I cannot run my install.cmd file from anywhere else besided GuiRunOnce (so please don't answer about using cmdlines.txt). I am trying to find a method to run a batch file that is located on my CD at the GuiRunOnce stage.

Thanks!

Link to comment
Share on other sites


what's wrong w/ detached program?

basically, at that stage of the install, the system doesn't know where your cd-rom is yet, so it can't call a file if it doesn't know where it is.

you could always hide it in your system32 directory, or you could call a cleanup file that sleeps for 5 seconds, then deletes the install.cmd file (sleeping gives the install.cmd file a chance to unload from memory, allowing it to be deleted).

Link to comment
Share on other sites

Can you not use RunOnce or RunOnceEx

[GuiUnattended]
DetachedProgram = CMD.EXE
Arguments = "/Q /C FOR /F %? IN ('%SYSTEMROOT%\SYSTEM32\MOUNTVOL.EXE^|FINDSTR :\') DO IF EXIST %?WIN51 CALL %?ROOT_DIR\DIR\MyBatch.cmd"

Where you place MyBatch.cmd in a folder called DIR which in turn is placed inside a directory in the root of the CD named ROOT_DIR. MyBatch.cmd can then contain or call, the drivers stuff already mentioned plus your RunOnce or RunOnceEx stuff using .\ or %~d0 references for your CD-ROM drive letter.

Edited by Yzöwl
Link to comment
Share on other sites

if GuiRunOnce accepts program/arguments, this should work. only tried in command prompt in working system, never tried on CD.

[GuiRunOnce]
%SystemRoot%\system32\cmd.exe /Q /C FOR /F %I IN ('%SystemRoot%\system32\findstr.exe dospath= %SystemRoot%\system32\$WINNT$.INF') DO (FOR %J IN (%I$OEM$) DO (IF EXIST %J (%~dJ\Install\Install.cmd)))

IMHO, GuiRunOnce == RunOnceEx injeted from CMDLINES.txt, dunno why you don't do that there.

Edited by idle.newbie
Link to comment
Share on other sites

IMHO, GuiRunOnce == RunOnceEx injeted from CMDLINES.txt, dunno why you don't do that there.

let me explain further.

i use W.A.I.T. to install programs. to run correctly, WAIT needs to be called like so:

start /wait %CDROM%\$OEM$\WAIT\WAIT.exe

the key is the "start /wait" - without it, the program gets messed up.

I do this currently by calling install.cmd (which contains the above code) from GuiRunOnce.

cmdow @ /HID

@ECHO OFF

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:\WIN51 set CDROM=%%i:

start /wait %CDROM%\$OEM$\WAIT\WAIT.exe

EXIT

If this can be called in some other way from CD, let me know! :whistle:

Link to comment
Share on other sites

according to DeployTools.cab\ref.chm\Unattend.txt\[GuiRunOnce]

Commands called in the [GuiRunOnce]section process synchronously. Each application runs in the order listed in this section, and each command must finish before you run the next command.
it waits until program finished.

got Word/Excel Viewer 2003 etc. in my disc, RunOnceEx injected @T-12, they always install one by one.

maybe that's caused by your wrapping program WAIT.exe, which forks another process to do app install. e.g. when i do "nircmd.exe exec hide app.exe", nircmd.exe forks a new process to run app.exe, the app.exe still running, but nircmd.exe's task is over so it terminate itself.

anyway, tho your script works, just don't care the 1k less script copied to hd, or kill itself after WAIT.exe terminated(DEL /F /Q %~f0).

Link to comment
Share on other sites

  • 1 month 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...