MSFN Forum: [GuiRunOnce] - Batch From CD-ROM? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[GuiRunOnce] - Batch From CD-ROM? Rate Topic: -----

#1 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 22 November 2005 - 07:32 PM

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!


#2 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 23 November 2005 - 06:33 PM

bump

#3 User is online   rendrag 

  • grrrrrr
  • PipPipPipPip
  • Group: Members
  • Posts: 687
  • Joined: 28-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 23 November 2005 - 07:20 PM

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

#4 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 24 November 2005 - 07:32 AM

detached program is too early. this batch starts my software selector installer program. i need it to load on first boot...

#5 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 24 November 2005 - 07:43 AM

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.

This post has been edited by Yzöwl: 24 November 2005 - 07:43 AM


#6 User is offline   idle.newbie 

  • Junior
  • Pip
  • Group: Banned
  • Posts: 93
  • Joined: 01-August 04

Posted 27 November 2005 - 11:16 AM

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.

This post has been edited by idle.newbie: 27 November 2005 - 11:26 AM


#7 User is offline   a06lp 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 976
  • Joined: 19-August 04

Posted 27 November 2005 - 01:17 PM

View Postidle.newbie, on Nov 27 2005, 01:16 PM, said:

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.

install.cmd said:

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:

#8 User is offline   idle.newbie 

  • Junior
  • Pip
  • Group: Banned
  • Posts: 93
  • Joined: 01-August 04

Posted 27 November 2005 - 05:03 PM

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

Quote

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

#9 User is offline   zzzz 

  • Intermediate
  • Group: Members
  • Posts: 44
  • Joined: 06-March 05

Posted 27 December 2005 - 05:24 PM

EDIT: seems that RunOnceEx can do the trick

This post has been edited by zzzz: 27 December 2005 - 07:16 PM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy