Skip to content

Conversation

ppawlowski
Copy link
Contributor

@ppawlowski ppawlowski commented May 9, 2025

Description

This pull request adds support for Windows system to Device Agent Installer.

Related Issue(s)

Closes #383

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Includes a DB migration? -> add the area:migration label

Co-authored-by: Stephen McLaughlin <[email protected]>
@Steve-Mcl
Copy link
Contributor

Steve-Mcl commented Jun 4, 2025

3. Mismatched path causing install issue:

This is now resolved by 799a92c - thanks


New issue: Because of previous installs (inconsistent state) I am now stuck. The installer stopped the service but later failed to install the service due to it already being present.

C:\Users\xxx\repos\github\flowfuse\dev-env\packages\device-agent\installer\go\out\windows>flowfuse-device-installerr-windows-amd64.exe -o spirit-up-additional -u https://app.flowfuse.com
Logger initialized.
****************************************************************
*            FlowFuse Device Agent Installer                   *
*                                                              *
* This installer will set up the FlowFuse Device Agent on your *
* system and configure it to run as a system service.          *
*                                                              *
****************************************************************
Installing FlowFuse Device Agent...                                                                                     
The working directory c:\opt\flowfuse-device exists and contains Device Agent configuration file                        
Do you want to remove it and continue installation? (Y/n) y                                                             
Stopping service flowfuse-device-agent                                                                                  
Removing contents of c:\opt\flowfuse-device ...                                                                         
Checking Node.js installation...
Installing Node.js 20.19.1...
Node.js installed successfully!
Installing FlowFuse Device Agent package...
FlowFuse Device Agent installed successfully!
Configuring FlowFuse Device Agent...
ℹ Starting Device setup...
✔ Success! This Device can be launched at any time using the following command:
  flowfuse-device-agent
✔ Import existing Node-RED flows? C:\Users\sdmcl\.node-red
✔ Select a flows file: flows.json
ℹ Importing credentials 'C:\Users\sdmcl\.node-red\flows_cred.json'...
ℹ Importing package 'C:\Users\sdmcl\.node-red\package.json'...
↑ Uploading snapshot as the target for this Device...
✔ Success
Configuration completed successfully!
Configuring FlowFuse Device Agent to run as system service...
Installing service flowfuse-device-agent for windows
[ERROR] Service setup failed: failed to create service: exit status 5
Output: Error creating service!
CreateService(): The specified service already exists.


[ERROR] Installation failed: service setup failed: failed to create service: exit status 5
Output: Error creating service!
CreateService(): The specified service already exists.

EDIT:
This is not a new issue - was raised last week:

the installer (nicely) checks the service exists and attempts to stop it before installation, however it then fails to re-install the service (as it already exists)

@ppawlowski
Copy link
Contributor Author

983ab2a fixes last issue with incorrect path to device-agent binary in service configuration.

Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected now. Great stuff.

Base automatically changed from feat-device-linux-installer to main June 25, 2025 12:00
@ppawlowski ppawlowski changed the title feat: add support for Windows OS to Device Agent Installer feat(installer): add support for Windows OS to Device Agent Installer Jun 25, 2025
@ppawlowski ppawlowski merged commit 50765bb into main Jun 25, 2025
4 checks passed
@ppawlowski ppawlowski deleted the feat-device-win-installer branch June 25, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Windows environment

2 participants