Vecna Posted May 13, 2005 Share Posted May 13, 2005 Im pretty new to this but my question is simple for most of you I think.My problem is that i made my unattended setup using nlite, everything works fine.I installed WPI and added ALL my programs, everything works fine testing with Virtual Machine.The problem I cant seem to solve is HOW do I call a cleanup.cmd AFTER all the programs are installed?Is it just that simple to add "%systemdrive%/wpi/cleanup.cmd" to my winnt.sif file under [GuiRunOnce], will it be executed last then or is there a way to call it in WPI and be sure it is called last? I havent found a solution for that...I also havent found out how to implent cmdow.exe, reboot.vbs, resourses.exe and restoff.reg, the last two are files ive seen in an unattended version ive used to look at as an example to build my own. If anyone could explain to me I would be very happy and please don't flame me because I have searched the forum but I just cant seem to find the answer, maybe the explanations give isnt clear enought for me Link to comment Share on other sites More sharing options...
Benzal Posted June 17, 2005 Share Posted June 17, 2005 The problem I cant seem to solve is HOW do I call a cleanup.cmd AFTER all the programs are installed?I have the same problemin winnt.sif file I have this:GUIRunOnce]command1 = "%systemdrive%\install\wpi\wpi.cmd"command2 = "%SystemDrive%\D\BTS_DPs_finish.cmd"command999 = "%SystemDrive%\install\start.cmd"My cleanup script is in the start.cmdAnd i that I have the following I have this:CLS@echo offTITLE Welcome To The PredatorECHO.ECHO **************Finishing the installation****************ECHOECHO ***********************Enjoy !**************************ECHO.ECHO Restarting the PC in 1 minute...shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute, this will give enough time for the shortcuts to update and for the shell to fully load before its ready to restart!"ECHO.ECHO Deleting Temp Installation Files...RD /S /Q %systemdrive%\installEXITWhat happens here is that the computer reboots b4 WPI has finished installing all the programs instructed...Can anybody help??? Link to comment Share on other sites More sharing options...
BrandonS_Mil Posted June 17, 2005 Share Posted June 17, 2005 Increase your shutdown time....Iknow, I know, your go "duh, i knew that", but really. Give it about 2 1/2 minutes before shutdown, that way if you use your disk on a "slower" machine or have a pesky program that needs just a little more time to finish, then it will work.Hope this helps Link to comment Share on other sites More sharing options...
Benzal Posted June 17, 2005 Share Posted June 17, 2005 I did that and it worked but its annoying that the shutdown activates when WPI still has about 4 progs to install, which take about 5 minutes. Link to comment Share on other sites More sharing options...
Benzal Posted June 19, 2005 Share Posted June 19, 2005 (edited) Correction, it worked but the last 4 programs would not install as the cleanup batch deletes all the installation files...Is there a way to make the cleanup batch start l8er or include it in WPI??? Edited June 19, 2005 by Benzal Link to comment Share on other sites More sharing options...
Achdine Posted June 20, 2005 Share Posted June 20, 2005 @BenzalIf your computer is shutting down from the cleanup script before WPI finishes, that means there is a problem with WPI.cmd. WPI.cmd should have a line that goes "Start /wait WPI.hta," which prevents WINNT.sif from moving on to the next command until WPI.hta is finished installing all your programs. If the /wait was removed, then WINNT.sif would whip through the WPI.cmd file, starting the installation process, then finish installing the BTS driverpacks, and then run your cleanup. Basically you'd have multiple programs running at the same time, and the cleanup script would interfere with the WPI script. Check and make sure that you didn't accidently remove the /wait.Increasing your shutdown time as Brandon suggested should have no effect, because that cleanup script shouldn't be running the same time as WPI anyway. It just needs to have a long enough wait to have time to delete the files in %ystemdrive%\install (which should not take very long, unless it is a LOT of files).@VecnaYou can put your cleanup script in GuiRunOnce as the last command, but I prefer to have it in WPI.cmd. Just make sure it is after the "Start /wait WPI.hta" line, so that it runs after WPI installs your programs. I would also recommend running WPI.cmd last in GuiRunOnce, so that your cleanup script does not interfere with anything else you run through WINNT.sif.Also, I'm not sure what reboot.vbs, resourses.exe and restoff.reg are, it would depend on where they are mentioned in the guide. Show us where they are mentioned in the guide and someone may be able to give more info.Implementing CMDow.exe is easy enough though. Just call it at the beginning of a batch/cmd file with cmdow.exe @ /HID to hide the window, or use NirCMD (which is much better, in so many ways) when you call the batch file itself to prevent the window from opening at all. Link to comment Share on other sites More sharing options...
blinkdt Posted June 20, 2005 Share Posted June 20, 2005 How about appending an AutoIt script to the end of GUIRunOnce to take care of the cleanup job after WPI is completed:AutoItSetOption("TrayIconHide", 1)AutoItSetOption("WinTitleMatchMode", 4)BlockInput(1)ProcessWaitClose("mashta.exe")Run( @ScriptDir & "\cleanup.cmd", "", @SW_HIDE)Compile the script and put it in the same directory as your cleanup batch. As an added benefit, you will not see any cmd window courtesy of the @SW_HIDE feature. I haven't tested it, but it should work. Link to comment Share on other sites More sharing options...
Benzal Posted June 21, 2005 Share Posted June 21, 2005 I do have Start /wait WPI.hta....This is a copy of my wpi.cmd:CLS@ECHO OFFEcho Changing the windows resolutionEcho please wait...start /wait 1365VidChng.exe 1024x768x32@85 -qREM Example, how to look for CDROM-drive. Must have a file to identify in its root (like WIN51 or WPI.ico).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%REM Determine the WPI startup path. REM if wpi should run off the cd the replace %~dp0 with %cdrom%.set wpipath=%~dp0REM Force resolution to needed size for wpi interface.--start %wpipath%\common\VideoChanger.exe 1280x1024x32@85 -qREM Hide this command window."%wpipath%\common\cmdow.exe" @ /hidREM Font installation - the smooth and customizable way.start /wait %wpipath%\common\fonts\fontinstaller.exeREM Special registry tweak needed.regedit /s "%wpipath%\common\wpi.reg"REM Make WPI directory the current directory.for /f "delims=: tokens=1" %%i in ("%wpipath%") do %%i:cd "%wpipath%"REM Start WPI and wait for its endstart /wait WPI.htaREM Cleaning up the desktop.del /s/q "%userprofile%\desktop\*.lnk"REM Rebooting the sytem to finalize the installation process.--shutdown.exe -r -f -t 10 -c "Reboot in 10 sec..."exit:endAccording to this there is already a reboot sequence but it doesn't seem to work... Link to comment Share on other sites More sharing options...
oioldman Posted June 21, 2005 Share Posted June 21, 2005 The shutdown sequence will work if you remove the two (2) hypens (--) and so will the VideoChanger.exe command. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now