Jump to content

Recommended Posts

Posted

Hi there,

yesterday I came across the problem, that I wanted to run WPI from everywhere, not only from a CD and always came across the error "..windows cannot find....", especially when I tried to run a windows command (e.g. "net use..").

Took me some time to come to a solution and so I thought, I might interest someone else. So here it is. I changed the following to the files:

--------------------------------------------------------------------------------------------------

my WPI.cmd ( basically added the REG ADD and REG DELETE line )

--------------------------------------------

@ECHO OFF

REM Determine the WPI startup path.

set wpipath=%~dp0

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 Write the actual path to the registry

REG ADD HKCU\Software\WPI /v SWPath /t REG_EXPAND_SZ /d %wpipath% /f

REM Start WPI and wait for its end

start /wait WPI.hta

REM Delete the Key from the registry

REG DELETE HKCU\Software\WPI

exit

:end

---------------------------------------------------------------------------------------------

Then in generate.js I added the following function:

-----------------------------------------------------------

function FindSWPath()

{

position = "generate.js"

swpath = WshShell.regRead("HKCU\Software\WPI\SWPath");

return swpath;

}

----------------------------------------------------------------------------------------

I also added in generate.js the following lines to the function replpath

------------------------------------------------

softwarepathwpath = FindSWPath();

rs = rs.replace(/%swpath%/gi, softwarepath);

---------------------------------------------------------------------------------------------

Now I can use in config.js for example

cmd1[pn]=['%swpath%\\Install\\Mozilla\\setup.exe -ma -ira']

Now there's nothing else for it, but to say:

WPI is really a REALLY GREAT TOOL!

Keep at it!!!


Posted

****, windows commands doesn't really run with these changes when I start WPI.cmd with a doubleclick and I can't figure out why.

When I call WPI.cmd from commandline, everything works fine.

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