1

I want to create JavaScript exe file. On clicking of exe file, It should open my reactJS web application in web browser. From JS exe file, I have to pass query param to Web application. Please help me with code.

2
  • You do understand how Web applications work, do you? Commented Nov 9, 2016 at 5:56
  • you can package it as an Electron app. Commented Nov 9, 2016 at 5:57

4 Answers 4

3

You can create a shell script to launch the browser with a link to your web application that is on your local machine. You haven't given much details, but in general it's pretty easy.

cat > launch.exe
#!/bin/bash
$BROWSER http://localhost

chmod +x launch.exe
./launch.exe
Sign up to request clarification or add additional context in comments.

7 Comments

Also state that he can't create a JS exe file. I assume he expected it to be possible.
He can create a JavaScript file with the .exe extension. He can make it executable easily. The first line would indicate the interpreter to use.
By interpreter do you mean the Javascript engine? If so, it is already used by the browser to execute JS within the web page itself. Your solution suffices because I presume he meant that he wanted to open directly the web application through a browser by just clicking an executable. +1
yes, he can execute javascript using a runtime like v8 or spidermonkey typically it would be node.js
Yup, but that's a different story. All he wanted to do was just create a shortcut to open his web app. :)
|
2

If this is to be compiled and run on Windows installations only then here's your answer: https://msdn.microsoft.com/en-us/library/7435xtz6(v=vs.100).aspx

Comments

1

Java code is different from JavaScript. They might both be Object Oriented Programming (OOP), but JavaScript is specifically a scripting language. Its impossible to make a .exe file out of JavaScript.

1 Comment

nothing is impossible. You can make an EXE with machine language that interprets JavaScript, much like a web browser
0

You should try jsc.exe (under Windows only), NWJS or Electron.

The latest two are surely your best pick.

Edit: I would add NeutralinoJs to my previous suggestion. It's nice, simple and useful.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.