Jump to content

Howto run WPI from a network share


Recommended Posts

[edit]

This is just one BIG EDIT and so these edit quotes will never appear again. I mixed the whole thing a little bit up, so now from scratch.

[\edit]

Hi there,

I thought, this might interst someone. This is a guide howto run WPI from a network share (works with 3.6 and 4.3.5 combined with XPSP2):

Assuming you have a fileserver named "server" a share on it named "software". Further one folder "swinstall" with two subfolders "WPI" and "setupfiles".

Follow these instructions to be able to run wpi i.e. out of command line or runonceex.cmd with "\\server\software\wpi\wpi.cmd".

I think it is system-language-independent, works at least with englisch and german system language.I attached both files I modified.

At first use the attached WPI.cmd and just change the names of the networkshare, the setup-files-directory and the WPI-directory (lines 4-6) and perhaps make other modifications for your special needs.

By the way in the WPI.cmd in the comment connect to the "last" free drive and write it to drvlet, means that windows searches for free driveletters backwards and those letters to which a local device was assigned anytime ago, are left out for the first.

Second thing is to use the attached generate.js or to add to your generate.js the following function:

function FindSWPath()
{
position = "generate.js"
swpath = WshShell.regRead("HKCU\\Software\\WPI\\SWPath");
swpath = swpath +'\\'
return swpath;
}

and to the function replpath in generate.js you add the lines

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

the second one of course placed after

rs = new String();
rs = u;

That's it, now you can use %SWPATH% in your config.js as path to your setupfiles, e.g.

prog[pn]=['Mozilla 1.7.11']
uid[pn]=['MOZILLA']
desc[pn]=['Installs Mozilla 1.7.11']
ordr[pn]=[405]
cmd1[pn]=['%SWPATH%\\Mozilla.exe -ma -ira']
dflt[pn]=['yes']
cat[pn]=['Apps']
pn++

generate.js

WPI.cmd

Edited by Doc Symbiosis
Link to comment
Share on other sites


Hi,

FSUTIL does not work with Windows 2k is there a alt i can use.

'fsutil' is not recognized as an internal or external command,
operable program or batch file.

Basically I wanna make a windows 2k install with all software in a wpi with the software running from our server here in office.

Edited by Earthcoder
Link to comment
Share on other sites

  • 1 month later...

Hello,

I am trying to get the changes in the first post to work although i am having no such luck with 4.3.5

If i run WPI through a virtual machine that has a mapping to a read/write share i keep receiving the following error message:

edit: ok i didnt map to the share but since i have i receive the following error

message: 'swdir' is undefined

url: file//Y:\WPI_4.3.5\WPI.hta

file: api.js

line: 135

and when i run it a second time i receive

message: 'swdir' is undefined

url: file//Y:\WPI_4.3.5\WPI.hta

file: generate.js

line: 135

If i run WPI on the local machine with a network mapping to itself WPI seems to hang and not install anything.

Do these instructions even work with WPI 4.x.x versions ?

If they do can someone confirm where the extra function and line of code should go in generate.js file. eg. which lines.

---

Lastly, i have searched and searched and searched but cannot find any definitive guide on how to use WPI using network shares. Instead of creating a new thread I would greatly love and appreciate anyone able to point me in the right direction on how to set this up properly !!! :thumbup

Thanks in advance and keep up the good work ! :)

Edited by Krim
Link to comment
Share on other sites

Hi there,

I'm sorry, but I missed one line:

In the generate.js in the function replpath(u) you've got to insert the following line:

swdir = FindSWPath();

With this it should work.

Thanks for the hint. I edited my first post.

Hiya,

Thanks for the reply.

I thought that was it but i cannot get it to work that way either using that function.

If i specify a static drive like so:

swdir = "W:";

WPI will install the application correctly.

If i use:

swdir = FindSWPath();

doesnt work ...

Any ideas, something in my wpi.cmd ?

Cheers,

Krim.

Link to comment
Share on other sites

The function FindSWPath() reads your softwarepath out of the following regkey: HKCU\Software\WPI\SWPath. So in your WPI.cmd you have to ensure, that you write the SWpath to the registry, which is done in my example with the following line

REG ADD HKCU\SOFTWARE\WPI /v SWPATH /t REG_EXPAND_SZ /d "%drvlet%\%Appdir%" /f

Hope this helps, if not, don't hesitate to ask again.

Link to comment
Share on other sites

The function FindSWPath() reads your softwarepath out of the following regkey: HKCU\Software\WPI\SWPath. So in your WPI.cmd you have to ensure, that you write the SWpath to the registry, which is done in my example with the following line

REG ADD HKCU\SOFTWARE\WPI /v SWPATH /t REG_EXPAND_SZ /d "%drvlet%\%Appdir%" /f

Hope this helps, if not, don't hesitate to ask again.

hi doc,

I changed your line to:

REG ADD HKEY_CURRENT_USER\SOFTWARE\WPI /v SWPATH /t REG_EXPAND_SZ /d "%drvlet%\%Appdir%" /f

I can now see the reg key appear in the registry location as expected although WPI still seems to do nothing when i click begin install.

Any other ideas?

Could you send me a copy/post on here your WPI files?

edit:

I ran the following in its own .cmd file:

REM put the sharename and the application directory into variables
set share=\\IBM-99TWCXV\software$
set appdir=

REM detect the first free drive letter and set it to drvlet
for %%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 regsitry
REG ADD HKEY_CURRENT_USER\SOFTWARE\WPI /v SWPATH /t REG_EXPAND_SZ /d "%drvlet%\%Appdir%" /f

ECHO done

It populates the registry key SWPATH with the contents following:

" /f

That aint right ?! :)

edit 2:

I guess the question is, what should be the correct contents of the SWPATH key in registry as it seems the automatic assigning of a drive letter isnt working in my situation. A workaround is to hard code it but id rather use your l337 method of dynamic drive assignment :)

edit 3:

sorry for so many edits but im sure this is the final thing that is stopping it from working. When running the above code for each iteration of the loop i receive:

The system cannot find the batch label specified - check

Edited by Krim
Link to comment
Share on other sites

Which system language do you use? I ask, because the command to find the first free drive letter only works on english systems. Check, if "No such Root Directory" is contained in the output, when you use "fsutil fsinfo drivetype x: " with a not existing drive x:.

I'm working right now on a way to make it independent from the system language.

therefo, you can use net use * \\server\share, which automatically uses the first free drive letter to connect the share to, but I till now, I can't get the drive letter out of the output of the command.

Should be solved in a few hours at most days.

Link to comment
Share on other sites

Hey again,

I am using Windows XP english version.

If i change:

fsutil fsinfo drivetype %%a:|find "No such Root Directory">nul

to

fsutil fsinfo drivetype %%a:|find "No such Root Directory">null

(notice the extra l on null)

If i dont include the extra l the file doesnt get produced. Should a file named 'null' and 'call' be produced when you run the command?

---

I still dont understand what this part of the command is doing:

2>&1&&call :check %%a:

Is that even right with all the ampersands in there? (&1&&)

---

I get this for the fsutil command:

C:\Documents and Settings\Administrator>fsutil fsinfo drivetype x:

x: - No such Root Directory

---

Hey doc, still havent received your wpi.cmd via email yet. Did you send ? :)

Edited by Krim
Link to comment
Share on other sites

hiya,

I blame it on 4hrs of sleep and 15hr days !!!

Ive been running wpi.cmd and wpi.hta like it was the same thing.

It just clicked that wpi.cmd is calling wpi.hta and not vice versa.

No wonder ive had so many problems !!!

It may have been worth it as i think its important to add to the original post that you need to map any drive to where WPI is located and run the wpi.cmd from there.

If you use start->run to connect to the shared drive it will give you errors.

Now your seperation of WPI and appplication storage makes much more sense !!

Thanks for all your patience in this thread. You will now be seeing alot of posts from me regarding full software automation/unattended installs :thumbup

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