Creating a innosetup executable that would install nodejs on a windows system

996 views
Skip to first unread message

Christopher Braafhart

unread,
Apr 7, 2014, 6:38:56 AM4/7/14
to nod...@googlegroups.com
Good day everyone, i was wondering if someone already made a innosetup script that can/ could install node js and run it as a service on a windows system.
I found out, there was someone that made something like it on the internet but his method was not understandable for me. What I'm trying to do, is just make a simple executable that can install nodejs on a windows pc, and with this same setup make it possible to uninstall it also(Install and uninstall features). If there is someone who already made a innosetup script like this it would help me alot to get a birdseye view what i have to put in my script to make it work.

Hope someone could help me with this problem.

Thank you in advanced

Peter Rust

unread,
Apr 8, 2014, 10:18:11 AM4/8/14
to nod...@googlegroups.com
Assuming you actually want/need to run node *as a service*, it looks like your best bet is the module that this stackoverflow answer links to: http://stackoverflow.com/a/20724855.

If you were to write something like that yourself, from scratch, you could follow the advice in this thread and write a simple service in C# (google "C# create service" for examples) and have that start your node.js process (google "C# start process" for examples). But it looks like someone has already done that work (or something similar, but written in node directly), as mentioned in the stackoverflow answer in the above paragraph.

It's worth mentioning that the node.js exe file is standalone, it can be "installed" on a system by simply copying the file over.

If you need it to run on startup and you don't care whether it runs as a service or not (services are trickier to get setup, but they are more bulletproof; they start running even before the user logs in and they continue running between user sessions), the simpler approach is to make a batch file that runs your node script with the node executable and to put that batch file in the user's startup/autostart folder, as mentioned in the other stackoverflow answers.

As far as the innosetup details, you'll need to do some googling to figure out the exact syntax to copy files or put them in the user's startup folder, etc. If you do decide to create a windows service, it looks like googling "innosetup service" yields some examples of how to configure innosetup to install the service.

-- peter
Reply all
Reply to author
Forward
0 new messages