Getting links to open another instance of PWB?

For general issues related to PWB v2.

Moderators: Tyler, Scott, PWB v2 Moderator

Post Reply
Jaysun
Provider
Provider
Posts: 47
Joined: Sun Jun 08, 2003 6:12 pm
Location: Eugene, OR
Contact:

Getting links to open another instance of PWB?

Post by Jaysun »

I need to be able to have links on a page be able to open other instances of PWB using different ini files. I have tried doing so via PWBExecute, but soon found that I can not send parameters to the executable so I could not open pwb.exe with a url and ini specified. Having to create .lnk files for each url and ini combination would be rather tedious. Is there some other way to have a link in a page open another instance of PWB using a specified url and/or ini file?

It may help for me to explain what I am trying to accomplish. I want to be able to use PWB as the shell on our public computers. Some of the computers are "Database" computers that provide access to only specific websites. So the shell instance of PWB will be displaying a page of links that open the various web databases, but these databases need to be opened using different ini files. Using shell buttons is not an option because I need to make the shell page look like a web page.

Thanks,

Jason
Jason Weinstein
Application Support Technicain
Eugene Public Library
Eugene, OR

GregP
Benefactor
Benefactor
Posts: 90
Joined: Thu Mar 13, 2003 12:34 am
Location: QLD Australia

Post by GregP »

Hi Jason,

Have you read this...

http://www.teamsoftwaresolutions.com/ph ... .php?t=514

It touches on an issue like yours.

The main difference I can see is that you don't want to use different .lnk files. The only obvious alternative I can see is if you had batch files swap the ini file you need into a generic name:

copy dbA.ini pwb.ini
pwb.exe

or

copy dbB.ini pwb.ini
pwb.exe

You still need seperate files for each database however, so its fairly similar to .lnk files. Until you can can include arguments for PWBExecute you won't be able to do it inside the javascript. (Although I'm happy to be proven wrong. It would help me too.)

GregP

GregP
Benefactor
Benefactor
Posts: 90
Joined: Thu Mar 13, 2003 12:34 am
Location: QLD Australia

Post by GregP »

I thought for a moment about what I just said, and in the interests of proving myself wrong (before anyone else does :lol: ) I thing I found a solution.

Basically you use an ActiveX object to dynamically write the batch file for you inside the javascript. Below is a rather inelegant example which I haven't tried yet, but it's a starting point for you.

var shell = new ActiveXObject("WScript.Shell");
shell.Run("echo @echo off > dbA.bat", 0, true);
shell.Run("echo PWB C:\\Browser\\Local.html /INI=\"C:\\Browser\\PWB.INI\\" >> dbA.bat", 0, true);
shell.Run("dbA.bat", 0, true);

Double check whether I've escaped the appropriate characters.

GregP

Jaysun
Provider
Provider
Posts: 47
Joined: Sun Jun 08, 2003 6:12 pm
Location: Eugene, OR
Contact:

Post by Jaysun »

How about I just reword this as a feature request to Scott:

Please make it so PWBExecute can accept parameters along with the executable.

Thanks much,

Jason
Jason Weinstein
Application Support Technicain
Eugene Public Library
Eugene, OR

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Post by Scott »

In the new version of PWB v2.08.1, which will be released this week barring any major problems, includes added support for command line arguments in the Dynamic External Java Execute command.

http://www.teamsoftwaresolutions.com/beta/PWBv208r1.zip

Here is an example of the command using multiple command line arguments.

function OnClickExecute()
{
window.external.PWBExecute( "E:/PWB/PWB.exe", "/INI=E:/PWB/PWBa.INI www.google.com" )
}

Please let me know if you have any questions.

--Scott

GregP
Benefactor
Benefactor
Posts: 90
Joined: Thu Mar 13, 2003 12:34 am
Location: QLD Australia

Post by GregP »

Most Excellent :)

Jaysun
Provider
Provider
Posts: 47
Joined: Sun Jun 08, 2003 6:12 pm
Location: Eugene, OR
Contact:

Post by Jaysun »

Awesome! Scott, you rock!

My job of creating our new patron interfate is now is going to be so much simpler/easier.

-Jason
Jason Weinstein
Application Support Technicain
Eugene Public Library
Eugene, OR

Post Reply