Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launching an executable from a website?

We're developing a site that will only run on the intranet, and computers with access to this intranet will have this executable installed. We can't have any "Would you like to open [filename].exe?" prompts. Click a link and the program begins running.

I realize that giving websites the ability to run executables on the client machine is very, very bad, but management refuses to budge on this.

Machines will have Windows (XP or up) with Firefox 3.

like image 928
Tinister Avatar asked Dec 10 '22 22:12

Tinister


1 Answers

We're developing a site that will only run on the intranet, and computers with access to this intranet will have this executable installed.

Does this mean the EXE is already installed on the desktop? You just want to launch it from the website?

If so, you can associate the EXE with a MIME Content Type and when the user clicks it, it will launch.

Pick a Content Type and a file extension, for your EXE name, for instance:

CauseChaos.exe
Associated with .chaos file extenstion
Content Type will be: application/chaos

Associate the file extension with your EXE via the EXE install. I show it here, using InnoSetup

[Registry]
Root: HKCR; Subkey: .chaos; ValueType: string; ValueData: CauseChaos; Flags: uninsdeletekey
Root: HKCR; Subkey: CauseChaos; ValueType: string; ValueData: CauseChaos Tool; Flags: uninsdeletekey 
Root: HKCR; Subkey: CauseChaos\DefaultIcon; ValueType: string; ValueData: {app}\CauseChaos.exe,0; Flags: uninsdeletekey
Root: HKCR; Subkey: CauseChaos\shell\open\command; ValueType: string; ValueData: "{app}\CauseChaos.exe ""%1"""; Flags: uninsdeletekey

Associate the MIME content type with the file extension, through the EXE install.

[Registry] (continued...)
Root: HKCR; Subkey: HKCR\Mime\Database\Content Type\application/chaos; ValueType: string; ValueName: Extension; ValueData: .chaos; Flags: uninsdeletevalue
like image 98
Jason Avatar answered Dec 19 '22 23:12

Jason