Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Closed Thread
 
LinkBack Thread Tools
Old March 21st, 2005, 09:38 AM   #1
New Member
 

Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Sid_21 is on a distinguished road
launch an application from Indexfile's hyperlink

Dear members,
My requirement is the following:
I must have an Index.htm file on a CD. The file contains a link which when clicked executes an application which is located on the CD. The application is present in a folder that is at the root level of the CD. From the href of the link I redirect to a Jscript function I wrote, where I call Exec method of a WScript.Shell object to launch the application on the CD. My problems are:
1. I could not find a nice way of passing the application path to the Exec method. My current code looks like:
var filepath = new String (fso.GetParentFolderName(document.location.pathnam e) + "\\Foldername\\ApplicationName.exe");
var substring = filepath.substr(filepath.indexOf(":") - 1);
ws.Exec(substring);
Thats because /fso.GetParentFolderName(document.location.pathname ) returns "/[Drive]:<rest of the path>", and the string passed to Exec() should appear exactly as it would if you typed it at the command prompt.
2. I do a "var ws = new ActiveXObject("WScript.Shell");". This throws an ActiveX alert dialog on my browser. Can this user interaction be avoided without changing IE security settings? (PS I must have an Index.htm on the CD).

Thanks in advance!
Sid_21 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 21st, 2005, 09:54 AM   #2
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,126
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
Hi Sid....

Personally, I would launch the default page in your own exe file.... a custom built browser... you can then monitor for that link click and handle it without the user interaction.

A simple Visual Basic browser application set to autorun is all you need.
__________________
Rob - Webforumz Founder
Web Designer Support Network || Personal Project: Sanctuary for Student Midwives
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 21st, 2005, 10:58 AM   #3
Most Reputable Member
 
spinal007's Avatar
 

Join Date: Mar 2004
Location: Good Ol'London
Age: 24
Posts: 1,684
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
Rep Altering Power: 0 spinal007 has a spectacular aura about spinal007 has a spectacular aura about
yeah, what rob said...

but if you don't have VB, this is the best way:
http://www.sharewareconnection.com/t...e-compiler.htm
__________________
Diego - Web-Developer & London SEO Expert
jQuery Plugins: Multiple File Upload, Star Rating, FCKEditor | NEW: XML to JSON
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 21st, 2005, 11:08 AM   #4
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,126
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
Quote:
Originally Posted by spinal007
yeah, what rob said...

but if you don't have VB, this is the best way:
http://www.sharewareconnection.com/t...e-compiler.htm
.... but that aint gonna help him spinal unless he can tell the compiler to watch for that link click action.
__________________
Rob - Webforumz Founder
Web Designer Support Network || Personal Project: Sanctuary for Student Midwives
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 21st, 2005, 12:50 PM   #5
Most Reputable Member
 
spinal007's Avatar
 

Join Date: Mar 2004
Location: Good Ol'London
Age: 24
Posts: 1,684
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
Rep Altering Power: 0 spinal007 has a spectacular aura about spinal007 has a spectacular aura about
it should....

I used a compiler before (shame I can't remember what its called) and it had a tool to do just that, call another application.

when you compiled the site (into an .EXE file), it just worked like any other program.
__________________
Diego - Web-Developer & London SEO Expert
jQuery Plugins: Multiple File Upload, Star Rating, FCKEditor | NEW: XML to JSON
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 21st, 2005, 11:37 PM   #6
New Member
 

Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Sid_21 is on a distinguished road
Hi Rob and Spinal,
Thanks for your replies. I cannot however repackage the html into an exe which is autolaunched. Thats because certain guidelines I work with state that autolaunch of exe's from the cd should be avoided (user could be exposed to viruses). Hence the html file should be what the user interacts with. But thanks for making me aware of those shareware tools..they seem quite cool.

I would have used Click
But this displays a File open/save warning which looks a bit nasty. Any IE setting I can use to avoid that, and at the same time not reduce the system's security when exposed on the internet?
Sid_21 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 22nd, 2005, 04:08 AM   #7
WebForumz Admin Badge
 

Join Date: Jul 2003
Posts: 1,848
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 118 Webforumz Staff is on a distinguished road
So you want a html page with a link to start an .exe file on the CD but your guidelines won't allow you to just start with the .exe itself? To be honest that makes no sense to me (no offense).

Any method of doing it rather than using an autorun.inf to run an exe is just going to create more security problems.

Without knowing exactly what you're trying to do I can only say these things are usually built with DemoShield or Macromedia Director.
Webforumz Staff is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 22nd, 2005, 04:10 AM   #8
Highly Reputable Member
 

Join Date: Jul 2003
Location: Ipswich, UK
Posts: 686
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Smokie will become famous soon enough
almost all CD ROMs launch an EXE using an autorun file, unless the EXE actually contains a virus then there shouldnt be a problem....
Smokie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 22nd, 2005, 04:49 AM   #9
New Member
 

Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Sid_21 is on a distinguished road
Our application is to be used in a hospital scenario. It is governed by pretty strict IHE (Integrating the health Enterprise) guidelines. The CD which I talk about is actually created when the hospital interacts with my application (not the application to be written on the cd..but another one). It is at this point that my application writes the index.htm and the executable to the CD. So thats the basic scenario.
So I dont "directly" control the application that is going onto the CD. Hence if the CD user runs the cd at another machine, and the autorun application turns out to be a virus, the hospital (and us) are in trouble. Hence the IHE guideline recommends that such CDs dont autolaunch an application, rather display a html, giving the user an option.
I Hope this presents the problem in a better perspective.
Sid_21 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 22nd, 2005, 07:29 AM   #10
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,126
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
You simply cannot get round the security dialog.
Well.... there is in fact one way.

Autorun an exe file thats invisible to the user. Disable the security settings.

Just kidding.

I think you are stuck mate.
__________________
Rob - Webforumz Founder
Web Designer Support Network || Personal Project: Sanctuary for Student Midwives
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 23rd, 2005, 04:38 AM   #11
Most Reputable Member
 
spinal007's Avatar
 

Join Date: Mar 2004
Location: Good Ol'London
Age: 24
Posts: 1,684
Blog Entries: 1
Thanks: 1
Thanked 4 Times in 4 Posts
Rep Altering Power: 0 spinal007 has a spectacular aura about spinal007 has a spectacular aura about
I think the whole thing contradicts itself. sorry but I really cant understand the guidelines.

the autorun exe is just as if not less likelly to be a virus as anything else on the CD. html files can also cause some damage with a few lines of JScript....

you may as well just open a HTML file that tells the user how to use "run" to open the application.

but then, that could still be a virus.......
__________________
Diego - Web-Developer & London SEO Expert
jQuery Plugins: Multiple File Upload, Star Rating, FCKEditor | NEW: XML to JSON
spinal007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Old March 23rd, 2005, 05:08 AM   #12
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,126
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
I dont understand either, but hey.

I tried to answer your question, but it just cant be done mate.
__________________
Rob - Webforumz Founder
Web Designer Support Network || Personal Project: Sanctuary for Student Midwives
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Bookmarks

Tags
launch , application , indexfiles , hyperlink


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adobe Air Launch etoxin Flash and ActionScript 0 March 8th, 2008 08:22 AM
Help With launch simonb The Café 24 July 11th, 2007 11:46 AM


Search Engine Optimization by vBSEO 3.2.0 RC8