Jump to content

%CDROM% path


Recommended Posts

I can't get the cdrom path to work.

I'm using this code in my wpi.cmd

REM Example, how to look for CDROM-drive. Must have a file called WIN51 in its root.
for %%i in (C 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.
REM If WPI should run off the CD the replace %dp0 with %CDROM%\PathToWPI
set WPIPATH=%CDROM%\
echo WPI will run from %WPIPATH%

When I run the installer, it looks in D:\ (hdd partition), instead of the cdrom

What is wrong? I tried different files instead of WIN51, but nothing seems to work...

Link to comment
Share on other sites


  • 2 weeks later...

I'm using this code:

@ECHO on

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:

set WPIPATH=%CDROM%\SETUP\WPI

set bla=%WPIPATH:~0,1%
if %bla%==\ set WPIPATH=%WPIPATH:~1%

%WPIPATH%\common\cmdow.exe @ /HID

start %WPIPATH%\common\Music.exe
ping -n 5 localhost > NUL

regedit /S %WPIPATH%\common\wpi.reg

for /F "delims=: tokens=1" %%i in (%WPIPATH%) DO %%i:
cd %WPIPATH%
start /wait WPI.hta
exit

I removed the fonts part (don't use it anyway) and added a line so that if I'm running it from hdd (for testing purposes) it will also work. I also added a line to start UAP2 (aka music.exe) and a pause of +- 5 seconds (or else, the player will appear on top of wpi).

Link to comment
Share on other sites

This is not really the problem. The cmd file works great and WPI is being started. BUT: When I choose any application and click install, it always says "Can't find D:\install\someprogram\setup.exe". Well, WPI is being started from drive E: though :confused:

So it seems that the variable %WPIPATH% or %CDROM% are not given over to WPI.

Got, what my problem is about? :(

cu

FuNKeR

Link to comment
Share on other sites

this is my cmd:

@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:

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




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
)


REM Hide this command window
REM "%WPIPATH%\common\cmdow.exe" @ /HID

REM Special registry tweak needed
regedit /S "%WPIPATH%\common\wpi.reg"


REM Make WPI driectory the current directory
for /F "delims=: tokens=1" %%i in ("%WPIPATH%") DO %%i:
cd "%WPIPATH%"


REM Start WPI and wait for its end
start /wait WPI.hta


REM call any cleanup code here, or after this script.
exit

Link to comment
Share on other sites

I'm sorry, but the solution must be something different! I searched many threads, but all I got is a bunch of informations about the wpi.CMD :(

Why isn't the variable given over to the WPI program? I think, it does not have anything to do with the cmd file. Simply the fact, that WPI does not "accept" the contents of the DOS variables.

cu

FuNKeR

Link to comment
Share on other sites

This is my .cmd file:

@ECHO OFF
REM
REM WPI startup something.
REM

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:\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=%~dp0
echo WPI will run from %WPIPATH%

REM Hide this command window
"%WPIPATH%\common\cmdow.exe" @ /HID

REM Special registry tweaks needed
start %WPIPATH%\common\fontinst.exe
regedit /s "%WPIPATH%\common\killinstallerwarning.reg"
regedit /S "%WPIPATH%\common\wpi.reg"

REM Make WPI driectory the current directory
for /F "delims=: tokens=1" %%i in ("%WPIPATH%") DO %%i:
cd "%WPIPATH%"

REM Start WPI and wait for its end
start /wait WPI.hta

REM call any cleanup code here, or after this script.
del /F %SYSTEMDRIVE%\WPI.CMD

exit

:end

I use this code for starting from a HD or a PocketDrive and with a minor adjustment a cd.

REM If WPI should run off the CD the replace %~dp0 with %CDROM%

try mine just remove these 2 lines=

start %WPIPATH%\common\fontinst.exe

regedit /s "%WPIPATH%\common\killinstallerwarning.reg"

Link to comment
Share on other sites

  • 1 month later...

FuNKeR,

I had the same problem. If you using another file to identify you cdrom drive (not WIN51), here is a solution:

1. Open your generate.js in wpiscripts directory

2. Find function FindCDRom() replace WIN51 (it's using twice in this function) with your file name.

That's all. :)

Link to comment
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...