Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

What To Change In Wpi.cmd For Hd Install


Recommended Posts

I was wondering what I needed to change in the wpi.cmd script that came with WPI in order to get it to run from C:\Install\WPI instead of off a CD? The cd and font part have me really confused.

What do I need to change in here:

REM Example, how to look for CDROM-drive. Must have a file called WIN51 in its root.

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:

echo Found CD-Rom as drive %CDROM%

REM Determine the WPI startup path.

set WPIPATH=%SystemDrive%\Install\WPI

echo WPI will run from %WPIPATH%

REM Font installation - the easy way

for /R %%i in ( *.ttf ) do (

echo Installing font %%~ni.ttf

copy /Y "%%~fi" "%windir%\Fonts" > nul

"%WPIPATH%\common\installfont.exe" "%windir%\Fonts\%%~ni.ttf" > nul

)

Any help would be very much appreciated! Thanks :)

Link to post
Share on other sites

REM Example, how to look for CDROM-drive. Must have a file called WIN51 in its root.
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:
echo Found CD-Rom as drive %CDROM%

thats only searching for a file on a drive, just tell it a different file, or give it a different path to search instead of each drive letter, u could have it search folders or anything

type FOR /? in command prompt :)

Link to post
Share on other sites

so should I just point it to C or a certain file on C: ? Will the Font part of the WPI.cmd work ok the way it is now if its going to run off of the C: drive? :huh:

Does anyone who has run it from their hard drive have an example of their wpi.cmd file that they could post. If I can see an example, then I will be able to figure it out.

Link to post
Share on other sites

The example wpi.cmd:

REM Determine the WPI startup path. 
REM If WPI should run off the CD the replace %dp0 with %CDROM%\PathToWPI
set WPIPATH=%~dp0
echo WPI will run from %WPIPATH%

This cryptic %~dp0 says "directory from where this skript (wpi.cmd) is run". The commentDO NOT WANT to run it from CD.

I (WPI author) do not run it from CD, and the original wpi.cmd does it for my purposes. The whole CDROM-thing is just for demonstration. You can also COMPLETELY IGNORE the fnt and registry thing.

If we cut it down, the skript will say:

set WPIPATH=%~dp0    --> = current wpi.cmd's drive:\directory !
for /F "delims=: tokens=1" %%i in ("%WPIPATH%") DO %%i: --> change to that drive
cd "%WPIPATH%"   --> change directory
start /wait WPI.hta

I know it's cryptic, but that's the way with shell skripts. As long as WPIPATH gets set correctly, you wouldn't have to care for anything else.

Link to post
Share on other sites

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