4

So I'm trying to make a projects hub for Windows (run locally with Localhost) that will open different apps (e.g. a CAD program) at the click of a button. Is this insecure? If not, how would I do it? If so, is there an alternative? Thanks!

Chip Thrasher
  • 332
  • 2
  • 4
  • 15
  • 2
    Possible duplicate of [Launch application from a browser](http://stackoverflow.com/questions/3057576/launch-application-from-a-browser) – Aurora0001 Nov 15 '16 at 17:10
  • 1
    Running application direct from browser is going to give you fair few security blocks. One idea is to use something like nw.js, Atom.io, brackets.io use this to create there editors, here you then have full control of the PC from the embedded browser. Basically the back end is node.js, so whatever you can do with node you could do here too. – Keith Nov 15 '16 at 17:17

1 Answers1

7

A URI (Uniform Resource Identifier) will provide for the best user experience. A URI is a schema that can launch an application as well as pass data into the application. The most common example of a URI is the mailto: for launching a computer's mail client from a website.

Creating a URI involves editing the registry. Here is some Microsoft Documentation on how to do it. Looking at other examples in the registry like mailto: https://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx

Lastly, I have seen people use <a href="path.lnk"> to shortcut links that works ok in Internet Explorer. You will still get a prompt to open or save; however, its the simplest solution.

gigaduck
  • 1,537
  • 2
  • 9
  • 9
  • I'm new to javascript so to execute I'm using window.open(uri); Is there a better way? – ThomasRones Sep 05 '18 at 08:48
  • 2
    You can use window.open(uri).... but on the client side( i.e. the customer's computer), there needs to be something in the computer's 'registry'. For security reasons, a general computer will not allow you to launch a program. In a corporate environment, one can have the registry updated in order to allow for proper launching of applications. – gigaduck Sep 05 '18 at 17:04