Jump to content

Recommended Posts

Posted (edited)

Okay after a lot of work and some great help I have a command file that gives two boxes one before wpi runs for info and warnings and then one after wpi runs asking if you want to reboot and if you say yes it will automatically reboot.

The code reads=

@ECHO OFF

REM
REM WPI startup module.
REM

REM 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=%CDROM%

REM Hide this command window.
"%wpipath%\common\cmdow.exe" @ /hid

REM Font installation - the smooth and customizable way.
start /wait %wpipath%\common\fonts\fontinstaller.exe

REM 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 Ask if WPI really is wanted to run.
echo Dim WshShell, oExec>%tmp%\WPI.vbs
echo Set WshShell = CreateObject("WScript.Shell")>>%tmp%\WPI.vbs
echo answer = Msgbox("At times during the install process some of the programs will" + vbCRLF + "use the cursor and answer the boxes automatically. So it is" + vbCRLF + "suggested that you start WPI and then leave your PC alone until" + vbCRLF + "the installation process has completed." + vbCRLF + "" + vbCRLF + "Also the screen resolution will be changed to 1280x1024 for the" + vbCRLF + "interface to be displayed properly. You may need to return it to" + vbCRLF + "the settings you prefer when WPI is finished." + vbCRLF + "" + vbCRLF + "Do you wish to continue?",VBYesNo,"Windows Post Installation Wizard")>>%tmp%\WPI.vbs
echo if answer = 6 then>>%tmp%\WPI.vbs
echo oExec = WshShell.Run("common\VideoChanger.exe 1280x1024x32@85 -q", 1, true)>>%tmp%\WPI.vbs
echo oExec = WshShell.Run("wpi.hta", 1, true)>>%tmp%\WPI.vbs
echo end if>>%tmp%\WPI.vbs
echo set WshShell = nothing>>%tmp%\WPI.vbs
%tmp%\WPI.vbs
del /q %tmp%\WPI.vbs

REM Cleaning up the desktop.
del /s/q "%userprofile%\desktop\*.lnk"

REM Confirming a reboot...
echo Dim WshShell, oExec>%tmp%\WPI.vbs
echo Set WshShell = CreateObject("WScript.Shell")>>%tmp%\WPI.vbs
echo answer = Msgbox("The installation process has finished. Do you wish to reboot now?",VBYesNo,"Windows Post Installation Wizard")>>%tmp%\WPI.vbs
echo if answer = 6 then>>%tmp%\WPI.vbs
echo oExec = WshShell.Run("SHUTDOWN -r -t 0", 1, true)>>%tmp%\WPI.vbs
echo end if>>%tmp%\WPI.vbs
echo set WshShell = nothing>>%tmp%\WPI.vbs
%tmp%\WPI.vbs
del /q %tmp%\WPI.vbs

exit

:end

the messages are easy to customize.

SO all of you guys should I change the official version to have this in it??

For those of you who may want it I made an .exe file from this and am attaching it here.

SMALL ISSUE IN THE CODING OF THE FIRST ONE SORRY NEW ONE IS HERE>

Edited by kelsenellenelvian

Posted

Hi

I would say that this new version both is complex and breaks the unattended way of usage.

An idea could be, to make this a whole new seperate file, and have the autorun run this file, and still have the WPI to work in unattended installs with the original.

Posted

I agree with these guys' point as well...

also, 1 request.... while I understand you enjoy converting your batch files to exe's, please continue to soley use batch files in the official releases of WPI so that those of us who know what there doing can stil make modifications to the script and not have to worry about converting it back from an exe...

thanks! and keep up the great work!

Posted

Of course we will keep the cmd file in the official WPI too many people change it to fit their needs.

Peersonally I have 2 exe files in mine one for wpi from cd and one for wpi from drive.

Posted
Peersonally I have 2 exe files in mine one for wpi from cd and one for wpi from drive.

btw, not sure if you caught it or not, but I posted up a method of being able to launch wpi, without the need of placing files on your hard drive here if youre interested.

Posted

Interesting but for my personal system (Which I also keep, update and develop WPI on) I use a secondary drive as my main backup feature so for me most of the time WPI is already on the drive.

The CD version is for when I am making a house-call or for my peeps. :D

Posted

Ah.. thats actually what I mean to do on my next update of WPI. I have a 2nd storage drive and I keep all of my installers to the progs I use anyway on it, it just makes way more sense to use them directly and keep wpi on that drive too so I can just update it whenever and dont need to worry about burning a new cd.

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