Comments (7)
I think it is entirely possible to do this already, with some effort. I'm not sure what we should do on this here, other than perhaps a wiki page describing the process?
Do you fancy drafting a guide for setting this up?
I think the process will be to:
- install companion like normal
- Use some tool (not sure if there is anything builtin to windows for this, or if something needs to be found) to create the service
- This should run
c:\program files\companion\resources\node-runtime\node.exe c:\program files\companion\resources\main.js
- Some arguments will be needed to that command.
- Possibly just
--config-dir c:\some-dir-here
using some directory that this service will have write access to and should use to store the config --admin-address
or--admin-interface
may want to be set, depending on your needs
- Possibly just
- The service may need to be run as a specific user, probably doesnt need to be an administrator
- This should run
It is also worth noting, that this companion will not appear in the tray, but the interface will be accessible in a browser at http://localhost:8000 like normal
from companion.
Thanks - will try that
from companion.
@brianteeman where you able to get this to work as a service in windows?
from companion.
Also interested in if you were able to get this to work.
from companion.
Hey ... i think i found a solution/workaround...
As far as I've read it's not possible to run node as a native windows service. But ...
You can use a wrapper like WinSW (https://github.com/winsw/winsw) to run companion as Service. I used the following steps:
- Download and install Companion as usual. Disable companion's Autostart in your user if already enabled.
- Create a folder to store the wrapper and the companion config data ->
C:\ProgramData\companion
- Download Winsw to
C:\ProgramData\companion
and rename it tocompanion.exe
- Create the winsw config file
C:\ProgramData\companion\companion.xml
. I've uploaded mine with this Comment. - Start a cmd with admin privileges and cd into
C:\ProgramData\companion
. - Run
companion.exe install
... This now creates the service calledcompanion
which can be found in theservices.msc
. - Now run
companion.exe start
to start the service. At this point you should be able to openhttp://127.0.0.1:8000/
with your web browser :)
My companion.xml
:
<service>
<id>companion</id>
<name>Companion</name>
<description>Run Bitfocus Companion as Service</description>
<executable>"c:\program files\companion\resources\node-runtime\node.exe"</executable>
<arguments>"c:\program files\companion\resources\main.js" "--config-dir" "C:\ProgramData\companion" "--admin-address" "127.0.0.1"</arguments>
</service>
For more info on WinSW have a look at their Readme and the doc folder inside the project.
from companion.
Really sorry about the delay in replying. Life got in the way - these are my notes from doing it using nssm
Download the latest version and extract the contents to a directory of your choice.
-
Open a Command Prompt with Administrator Privileges:
-
Navigate to the NSSM Directory:
-
Install the Node.js Service:
nssm install YourServiceName "C:\Program Files\Companion\Resources\node-runtime\node.exe" "C:\Program Files\Companion\Resources\main.js"
Replace YourServiceName with the desired name for your service. -
Configure Service Parameters:
A graphical interface will appear. Here, you can configure parameters like startup directory, dependencies, etc. Make sure to set the correct paths and settings for your Node.js script. -
Save Configuration:
-
Click on the "Install Service" button to save your configuration and install the service.
-
Start the Service:
net start YourServiceName
Replace YourServiceName with the name you provided before.
Now, your Node.js script should be running as a service on your Windows 11 system. You can manage the service using the "Services" application (services.msc) or other service management tools.
from companion.
@Julusian, @swamiforlife2, @lfrisk, @brianteeman
I'm not sure if Companion is running as a service, but here are the steps I do to have Companion start with a machine running Windows.
- Install Companion as normal.
- Uncheck the Run at Login box (to avoid the error Companion is already running).
- Change the GUI interface dropdown to All Interfaces 0.0.0.0.
- Open Task Scheduler.
- Create a Task
- Choose a task trigger as "At startup". (Choose a delay if you have services or connections that need to run on that machine before starting Companion).
- Choose to start a program from a location such as "C:\Program Files\Companion\Companion.exe".
- Modify Conditions or Settings as needed. I suggest checking "Allow task to be run on demand", and "If the running task does not end when requested, force it to stop".
- After creating the task, modify the General properties to select "Run whether the user is logged on or not. You don't have to use as password unless you would need Companion to access more resources than normal.
Notes: Companion does not show up in the system tray. If you need to change the GUI interface, you will need to stop the Companion task from inside task schedular and start Companion from the app list/program location.
from companion.
Related Issues (20)
- [BUG] Navigation buttons disappear HOT 3
- API Create/Delete Button and Set Button Actions HOT 2
- Ability to record a delay time within the Action Recorder HOT 14
- Internal linear interpolation function
- Allow Action Step Name and Action/Feedback Headline to be defined in Presets HOT 2
- Windows on ARM (ARM64) Support - Companion AND Satellite HOT 3
- Export a PDF Guide of Configurations for training crew, volunteers, clients
- Add support for Mountain Displaypad HOT 2
- Respect module action/feedback/preset order HOT 5
- [BUG] Variable Tab absent from Buttons view HOT 1
- Add ability actually add or remove pages, not preassign 99 by default? HOT 2
- [BUG] Cursor in settings textinput jumps to end of input after each change HOT 1
- Add option to merge presets HOT 1
- Module Log View - Show Module Connection Status
- Installation as non-admin HOT 2
- Imported buttons showing as empty HOT 2
- Contour ShuttleXpress - Improve integration HOT 3
- Support Rise 02 Vision Streamdeck clone
- [BUG] Triggers wont (Append to existing) HOT 1
- Config Autosave
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from companion.