Running external program from web page

For general issues related to PWB v2.

Moderators: Tyler, Scott, PWB v2 Moderator

Post Reply
LesH
Participant
Participant
Posts: 11
Joined: Fri May 20, 2005 1:01 pm

Running external program from web page

Post by LesH »

We've been using PWB 2.05 for some time operating as Windows shell on W2k. The machines are very locked down and the user can access about six approved systems (various servers and web pages in our organization) from their home page.

We now have a request to add an additional, local program to the machines. I figured we can just install the program on the local HD and add a link to the home page (file://c:/program/program.exe).

This works fine if I launch from a shellbar icon, but I get the "Access denied due to restrictions in effect on this computer" message if I try to launch the app from the home page. (it will launch fine from plain IE but not from PWB).

I have OnlyAccessHTTP=False and DisableFileDownload=False now (they were true before) but no difference. We would like to be able to launch the app from a link on the home page.

Help?
Les

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

Post by Scott »

If you run IE on the same computer you do not get the error message?

I would use the PWB Dynamic External Java Command JavaExecute to launch the application. Please see the following forum post.

http://teamsoftwaresolutions.com/phpBB2 ... .php?t=278

There is an example on this web page.

http://www.teamsoftwaresolutions.com/beta/external.htm

Please let me know if you have any questions.

--Scott

LesH
Participant
Participant
Posts: 11
Joined: Fri May 20, 2005 1:01 pm

Post by LesH »

Looks promising - can you provide an example of calling OnClickExecute from a link rather than a button?

And also, where in PWB is it being restricted from just being able to run the executable directly from a link?

Thanks,
Les

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

Post by Scott »

You could use a line similar to the following.

<A HREF="NOTEPAD" OnClick="window.external.PWBExecute( 'NotePad.exe' )">Notepad</a>

After setting the following in the PWB INI file.

[Java]
EnableExternalJava=True
JavaExecute=PWBExecute
...

The "EnableExternalJava=True" is not used in the older versions of PWB.

To re-enable the file download, which would allow you to run an application from a link, you will need to open the Internet Options Control Panel applet and enable the File Download on the Security tab in the Internet and Local Intranet zones. This is not done by PWB when you enable file downalods in the INI file.

--Scott

LesH
Participant
Participant
Posts: 11
Joined: Fri May 20, 2005 1:01 pm

Post by LesH »

Still having trouble with this. Here's a bit from the home page:

<script language="JavaScript" type="text/JavaScript">
<!--

function OnClickDummy()
{
window.external.PWBDummy
}

function OnClickExecute()
{
window.external.PWBExecute( 'c:\skylight\skylight.exe' )
}


//-->
</script>

<p><A href="c:\skylight\skylight.exe">SKYLIGHT PREPAID</A></p>

<p><A HREF="c:\skylight\skylight.exe" OnClick="window.external.PWBExecute( 'c:\skylight\skylight.exe' )">Skylight via Java link</a></p>

Both links, when clicked, give me the "access denied due to restrictions in effect on this computer" under PWB. Under plain IE they both work fine.

Some pieces of the PWB.INI:

[Java]
EnableExternalJava=True
JavaExecute=PWBExecute

Also:
DisableFileDownload=False
OnlyAccessHTTP=False

The application launches fine from a shellbar icon, but that's not where we want to put it - we'd like to have a link on the page just like all the other pages they need to use.

Thanks,
Les

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

Post by Scott »

Running IE on the same computer the this link works?

<p><A href="c:\skylight\skylight.exe">SKYLIGHT PREPAID</A></p>

--Scott

LesH
Participant
Participant
Posts: 11
Joined: Fri May 20, 2005 1:01 pm

Post by LesH »

Yes, I get the prompt for a download (Open, Save, etc) click OPEN, and the app opens.

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

Post by Scott »

Please send an attached copy of your INI file to support@teamsoftwaresolutions. This may help in determining the problem.

--Scott

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

Post by Scott »

Are you using a run list through the Windows Group Policy for the user?

This error message is the same message given when trying to run an unapproved application is launched.

I did not see anything in your INI file that would cause a problem, and on my test systems the links seem to work as expected.

Did you test run IE when logged on as the same user as is logged on when PWB is running?

The disable file download in the PWB INI is set in the current user Registry hive. Did you reset the File Download in the Internet Options Control Panel applet when logged on to the computer as the same user that is logged on when PWB is running?

Here is a small registry script that will reset the downlaods for the user curently logged on.

http://www.team2s.com/new/EnableDownload.zip

--Scott

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

Post by Scott »

Have you tried PWB v2.08.4? Do you still have the problem with this newer version?

--Scott

LesH
Participant
Participant
Posts: 11
Joined: Fri May 20, 2005 1:01 pm

Post by LesH »

As per Scott:

"The problem is with the URL filter. Even though you have "+file://" in the URL filter, the IE web browser control is presenting PWB with "C:\WINDOWS\Notepad.exe" as the URL. With "-all" in the URL filter file PWB is going to deny access to it unless it is specifically allowed. You should add the following to your URL filter file to allow PWB to access the link.

+C:\\Windows\\Notepad.exe

Please note the double backslashes. This is because in Regular Expressions the backslash has a special meaning and you must have a double backslash for a literal backslash.

You should move the "-all" to the top of the URL filter file. This will allow PWB to start with the "-all" option on for all URLs.

To run the application without prompting you can use the PWB Dynamic External Java Commands."

Scott;
That works fine (thanks!) as a direct link, although I still see the download prompts.

When I use this Java command though, in an effort to bypass the download prompts:

<script language="JavaScript" type="text/JavaScript">
<!--

function OnClickExecute()
{
window.external.PWBExecute( 'c:\windows\notepad.exe' )
}

//-->
</script>

<p><A HREF="c:\windows\notepad.exe" OnClick="window.external.PWBExecute( 'c:\windows\notepad.exe' )">Notepad via Java link</a></p>

I still get prompted to open/save; then also get the dialog about opening an unsigned executable. I know I can turn this stuff off in IE. My understanding was that using the Java commands would bypass these dialogs?

Les

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

Post by Scott »

You need to have the Dynamic External Java Commands enabled and the Java Execute command defined.

[Java]
EnableExternalJava=True
JavaExecute=PWBExecute
...

Then you need to change your link to reference the Java Command.

<p><A HREF="JavaScript:OnClickExecute()">Notepad via Java link</a></p>

The way you have it setup PWB is still trying to download the file because the reference is pointing to the executable.
function OnClickExecute()
{
window.external.PWBExecute( 'c:\windows\notepad.exe' )
}

//-->
</script>

<p><A HREF="c:\windows\notepad.exe" OnClick="window.external.PWBExecute( 'c:\windows\notepad.exe' )">Notepad via Java link</a></p>
Please let me know if you have any questions.

--Scott

LesH
Participant
Participant
Posts: 11
Joined: Fri May 20, 2005 1:01 pm

Post by LesH »

Works! And easy enough to modify to support multiple executables. Thanks!

Les

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

Post by Scott »

I just noticed one thing, you should use either a double backslash or a forward slash in the path to the EXE file.

function OnClickExecute()
{
window.external.PWBExecute( 'C:/windows/notepad.exe' )
}

Using a single backslash can cause PWB not to find the file because the single backslash can have special meaning.

--Scott

Post Reply