0

I developed a bot with nodejs, this bot is a cli application with some inputs and some actions based on the inputs.

this is my bot screen:

Bot

What i need to do now, is use electron (or another library) to transform it in a exe or something executable in windows and .sh to linux.

But this project dont contain any html file, its just a .js file calling another .js files.

There's a way to do it?

Thanks

c0nf1ck
  • 359
  • 3
  • 14
  • Did you try search StackOverflow? See https://stackoverflow.com/questions/8173232/how-to-make-exe-files-from-a-node-js-app and comments. – sigurd Aug 24 '17 at 04:20
  • you can just use a empty index, and don't display it with electron, just run it hide. – Paulo Galdo Sandoval Aug 24 '17 at 04:30
  • @Paulo yes I know I can do it, but how to interact with the user inputs ? Because it'll show only in the console when it executes. – c0nf1ck Aug 24 '17 at 04:42
  • your application excutes some html or any interface? not only the console – Paulo Galdo Sandoval Aug 24 '17 at 04:48
  • @Paulo Just console – c0nf1ck Aug 24 '17 at 05:06
  • Then i don't see any problem, just launch your application in the same script from electron like a proceess in background. i did that, i'd launch an expressjs, a couple of function for a printer and some events for install electron for windows. – Paulo Galdo Sandoval Aug 24 '17 at 05:14
  • @Paulo but where I'll display the options for the user select ? Because it's only based in console logs.. I know I can run it in background but it'll not show anything – c0nf1ck Aug 24 '17 at 11:41
  • Ehmm, where you usually displays it? in that case you must make some interface. Is your application finished? (i mean, just need to package ir?) – Paulo Galdo Sandoval Aug 24 '17 at 13:57
  • @PauloGaldoSandoval let me explain it.. it's a bot.. it make some actions based on user selections.. it displays on the console.. I run it with node index.js and it displays this screen that I posted.. I use inquirrerjs for the questions – c0nf1ck Aug 24 '17 at 13:59
  • Ok let me see if i understand it right, you run your index.js and shows a console to interact with your bot, and nothing more right? – Paulo Galdo Sandoval Aug 24 '17 at 14:07
  • @PauloGaldoSandoval yes that's exactly – c0nf1ck Aug 24 '17 at 14:24
  • Soo when you'll run it, you want to show up your console e.g. from a shortcut on your desktop. Well, it's the same as i said, in the same script of electron runs, put your console, and when you run electron will start normally your bot because it's in the main thread of electron. You can launch whatever you want inside the script of electron, it's not required to show something inside electron. or interact with it – Paulo Galdo Sandoval Aug 24 '17 at 14:42
  • @PauloGaldoSandoval Sorry for the late reply.. but how do I display the terminal/cmd when the user open up my bot ? There's a way to do it ? – c0nf1ck Aug 25 '17 at 13:12
  • When the electron scripts run, should launch your application or whatever is inside it, because electron just make `node yourfile.js` to run – Paulo Galdo Sandoval Aug 25 '17 at 13:54
  • @PauloGaldoSandoval ok I understand that.. so in my bot I have to open the terminal/cmd on my own ? – c0nf1ck Aug 25 '17 at 13:56
  • Nop, electron will execute it for you when it runs – Paulo Galdo Sandoval Aug 25 '17 at 14:25

0 Answers0