Run EXE from client side

后端 未结 7 1205
醉梦人生
醉梦人生 2020-12-03 23:58

I need run an exe file from client side. The Exe file exist in my C:\\ Directory. I need run this exe file from my WEB site.

How can I co this?

相关标签:
7条回答
  • 2020-12-04 00:16
    <script>
       var myApp = {};
       myApp.runExecutable = function(fileLocation, callback) {
          var exeLoader = window.getSystemContext();
          exeLoader.execute(fileLocation, callback)
       }
       myApp.runExecutable('C:\\program.exe', function() {
           alert('complete.');
       });
    </script>
    
    0 讨论(0)
  • 2020-12-04 00:24

    To run an .exe file in a browser, you would either need to cross-compile the file to JavaScript or emulate it using a virtual machine, such as v86. It might be possible to decompile an executable file and then compile to JavaScript using Emscripten.

    0 讨论(0)
  • 2020-12-04 00:25

    Put your entire application in a DLL library, upload it to some static IP address server and read about WebDAV technology. All you need is a small DLL loader that will load the library from the network. It's all built-in windows since Win2000 if i remember correctly.

    It works like this, in import table you specify IP address and web resource from where you want to load your library (usualy it's filled with stuff like KERNEL32.dll USER32.dll etc.)

    So you need to patch your exe loader and change your library name from eg.

    MYLIB.dll to

    \xxx.xxx.xxx.xxx\MYLIB (no extension required)

    where xxx is the static IP address (doesn't work with the hostname). Windows will take care of the rest :)

    Have fun.

    0 讨论(0)
  • 2020-12-04 00:26

    Actually, I'm ashamed to admit that I have implemented this in response to a specific requirement.

    The way to do it is to make the user run an installer for your app on their machine, which implies that they agree to run your app. The installer associates a specific file extension with your app or a "helper" app, and the web site sends a file with that extension when it wants to start the app. The user has to interact at that point, opening the file with "YourHelperApp".

    You can also do it with no UI intervention if you use a signed browser plugin, which is allowed to do basically anything, but of course that's browser- and platform-specific.

    0 讨论(0)
  • 2020-12-04 00:29

    HTML page instructing the user to click on a link that points to a local file?

    0 讨论(0)
  • 2020-12-04 00:29

    You need to run it on the server or on the client? For security reasons neither is possible out of the box.

    but with a proper configuration it is possible for both scenarios. To run it server side you will have to request proper permissions for your web app. To do it client side you will have to have the user to agree to download and install certain code which will do it

    0 讨论(0)
提交回复
热议问题