gemino Posted August 21, 2005 Share Posted August 21, 2005 i thought i could define my own pathvariables in the wpi.cmd like this:set mypath = .......but when i use it in the command x line nothing happens.even if i used the predefined %CDROM% variable the setup files for my programs are always searched in the folder where i run the wpi.cmd file....thats really strange because i can see that %CDROM% points to my cdromdrive in the commandline, but instead when the installation window pops up %CDROM% seems to be the path where wpi is called.... Link to comment Share on other sites More sharing options...
gemino Posted August 21, 2005 Author Share Posted August 21, 2005 (edited) ok sorry, just found out that i edited the WPI.ico line in the cmd file, so i just had to change the generate.js file too.....but how do i define my own variables? just defining them in the wpi.cmd doesn't seem to be enough.... Edited August 21, 2005 by gemino Link to comment Share on other sites More sharing options...
Doc Symbiosis Posted August 23, 2005 Share Posted August 23, 2005 I think the variables in WPI.cmd have nothing to do with the rest of the program. I solved this problem this way:1) In the WPI.cmd I write the value of the variable to the registry.2) Then in the generate.js, which is there to replace variables used in the config.js, this value is read and the variable replaced.So here is my wpi.cmd:@echo off&setlocal enableextensionsREM put the sharename and the application directory into variablesset share=\\mpg-bpc-s2\software$set appdir=softwareinstall\install\englischfor %%a 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 (fsutil fsinfo drivetype %%a:|find "No such Root Directory">nul 2>&1&&call :check %%a:)REM Connect the softwareshare to drvlet net use %drvlet% %share%REM Write the app-path to the regsitryREG ADD HKCU\SOFTWARE\WPI /v SWPATH /t REG_EXPAND_SZ /d "%drvlet%\%Appdir%" /fREM Determine the WPI startup path. set wpipath=%~dp0REM Font installation - the smooth and customizable way.start /wait %wpipath%\Tools\fonts\fontinstaller.exeREM Force resolution to needed size for wpi interface.start %wpipath%\Tools\VideoChanger.exe 1024x768x32@85 -qREM 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 Delete the Key from the registryREG DELETE HKCU\Software\WPI /fREM Disconnect the network driveNET USE /DELETE %drvlet%endlocal&goto :eof:checkif not defined drvlet set drvlet=%1&goto :eof------------------------------------------------------------------------------------------To the generate.js I added the function:function FindSWPath(){ position = "generate.js" swpath = WshShell.regRead("HKCU\\Software\\WPI\\SWPath"); swpath = swpath +'\\' return swpath;}and to the function replpath(u) I added the following line within the other replace commandsrs = rs.replace(/%swpath%/gi, swdir);So now in the config.js, I can use the following prog[pn]=['Adaware 6']uid[pn]=['ADAWARE']desc[pn]=['Installs Adaware 6 Personal.']cmd1[pn]=['%SWPATH%\\adaware6.exe /silent']ordr[pn]=[505]dflt[pn]=['no']cat[pn]=['Antivir']pn++ Link to comment Share on other sites More sharing options...
g-alex Posted August 24, 2005 Share Posted August 24, 2005 I think the variables in WPI.cmd have nothing to do with the rest of the program. I solved this problem this way:1) In the WPI.cmd I write the value of the variable to the registry.2) Then in the generate.js, which is there to replace variables used in the config.js, this value is read and the variable replaced.So here is my wpi.cmd:@echo off&setlocal enableextensionsREM put the sharename and the application directory into variablesset share=\\mpg-bpc-s2\software$set appdir=softwareinstall\install\englischfor %%a 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 (fsutil fsinfo drivetype %%a:|find "No such Root Directory">nul 2>&1&&call :check %%a:)REM Connect the softwareshare to drvlet net use %drvlet% %share%REM Write the app-path to the regsitryREG ADD HKCU\SOFTWARE\WPI /v SWPATH /t REG_EXPAND_SZ /d "%drvlet%\%Appdir%" /fREM Determine the WPI startup path. set wpipath=%~dp0REM Font installation - the smooth and customizable way.start /wait %wpipath%\Tools\fonts\fontinstaller.exeREM Force resolution to needed size for wpi interface.start %wpipath%\Tools\VideoChanger.exe 1024x768x32@85 -qREM 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 Delete the Key from the registryREG DELETE HKCU\Software\WPI /fREM Disconnect the network driveNET USE /DELETE %drvlet%endlocal&goto :eof:checkif not defined drvlet set drvlet=%1&goto :eof------------------------------------------------------------------------------------------To the generate.js I added the function:function FindSWPath(){ position = "generate.js" swpath = WshShell.regRead("HKCU\\Software\\WPI\\SWPath"); swpath = swpath +'\\' return swpath;}and to the function replpath(u) I added the following line within the other replace commandsrs = rs.replace(/%swpath%/gi, swdir);So now in the config.js, I can use the following prog[pn]=['Adaware 6']uid[pn]=['ADAWARE']desc[pn]=['Installs Adaware 6 Personal.']cmd1[pn]=['%SWPATH%\\adaware6.exe /silent']ordr[pn]=[505]dflt[pn]=['no']cat[pn]=['Antivir']pn++<{POST_SNAPBACK}>Im interested to have WPI folder in the root folder of the cd or hdd and inside wpi the folder install (applications) so it will work either from cd or hddis all these necessary or I can do it with more easy waythanks Link to comment Share on other sites More sharing options...
kaje_ovo Posted August 24, 2005 Share Posted August 24, 2005 If from CD. If you have standard REM Example, how to look for CDROM-drive. Must have WPI.ico at the root of the CD.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%Then with %CDROM%\install\apps -> will installing from CD.If you put %systemdrive%\install\apps -> will install from HDD partition on which are current Windows running.! Link to comment Share on other sites More sharing options...
g-alex Posted August 24, 2005 Share Posted August 24, 2005 If from CD. If you have standard REM Example, how to look for CDROM-drive. Must have WPI.ico at the root of the CD.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%Then with %CDROM%\install\apps -> will installing from CD.If you put %systemdrive%\install\apps -> will install from HDD partition on which are current Windows running.!<{POST_SNAPBACK}>I know that, but I want to do the following.I want to have the folder WPI in the root directory of my hdd or in the root dir of a cd disk, inside the wpi folder I want to have a 'install' folder which will have the applications. So in my config file I want to have a path like '\\wpi\\install\app...' so it will no matter if the drive is c: or d: or anything else. I've tried the above but WPI doesn't recognize the path.thanks Link to comment Share on other sites More sharing options...
Doc Symbiosis Posted August 26, 2005 Share Posted August 26, 2005 Perhaps try the following:Add the following line to the WPI.cmdREM Determine the WPI startup path. set wpipath=%~dp0Then in the config.js you should be able to use %WPIPATH%\Install as installation path.I think I used this way a few months ago and it worked fine, but perhaps I forgot something right now. Link to comment Share on other sites More sharing options...
g-alex Posted August 26, 2005 Share Posted August 26, 2005 Doc Symbiosis, thanks again.I've tried the example you gave me but WPI doesn't recognize %wpipath% in config.js.I've tried also to copy wpi.ico in the systemdrive and use the variable %cdrom% but also no result.Maybe I have to to use the example you gave us in the 3rd post in this topic, but I cannot understand it fully, also I don't want to use network shares.thanks a lot 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