Skip to content

Conversation

ppawlowski
Copy link
Contributor

@ppawlowski ppawlowski commented Aug 18, 2025

Description

This pull request adds possibility to instal the device agent in a custom directory via the device agent installer.

Related Issue(s)

Closes #404
Dependent upon #446 shipping first

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

…' of github.com:FlowFuse/device-agent into feat-dai-custom-workdir
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.

first run works great - installed to my specified dir however uninstalling did not work:

Install

flowfuse-device-installer-windows-amd64.exe -d c:\da1
One time code has not been provided. The Device Agent automatic configuration is not possible.
Do you want to continue with the installation? (y/N): y  
--<snip-for-brevity>--
FlowFuse Device Agent installation completed successfully!
The Device Agent has been installed but it is not configured.
To complete the setup:
 1. Create a device.yml configuration file in c:\da1 directory
 2. Start the Device Agent service
For information on how to manage the FlowFuse Device Agent,
  please refer to the documentation at https://github.com/FlowFuse/device-agent/blob/main/installer/README.md

uninstall attempt #1

flowfuse-device-installer-windows-amd64.exe --uninstall
****************************************************************
*            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.          *
*                                                              *
****************************************************************
[ERROR] Uninstall validation failed: c:\opt\flowfuse-device is not the FlowFuse Device Agent directory. If you installed it in a custom directory, please specify it using `--dir` flag

So I understand why this occurred but it adds credence to my prior suggestions of copying the installer local and adding uninstaller batch scripts that the user can discover/run AND the windows registry can use for a windows familiar admin.

uninstall attempt #2

flowfuse-device-installer-windows-amd64.exe -d c:\da1 --uninstall
****************************************************************
*            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.          *
*                                                              *
****************************************************************
[ERROR] Uninstall validation failed: c:\da1 is not the FlowFuse Device Agent directory. If you installed it in a custom directory, please specify it using `--dir` flag

uninstall attempt #3

flowfuse-device-installer-windows-amd64.exe --uninstall  -d c:\da1
****************************************************************
*            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.          *
*                                                              *
****************************************************************
[ERROR] Uninstall validation failed: c:\da1 is not the FlowFuse Device Agent directory. If you installed it in a custom directory, please specify it using `--dir` flag

uninstall attempt #4

flowfuse-device-installer-windows-amd64.exe --dir c:\da1 --uninstall
****************************************************************
*            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.          *
*                                                              *
****************************************************************
[ERROR] Uninstall validation failed: c:\da1 is not the FlowFuse Device Agent directory. If you installed it in a custom directory, please specify it using `--dir` flag

uninstall attempt #5

flowfuse-device-installer-windows-amd64.exe --uninstall --dir c:\da1
****************************************************************
*            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.          *
*                                                              *
****************************************************************
[ERROR] Uninstall validation failed: c:\da1 is not the FlowFuse Device Agent directory. If you installed it in a custom directory, please specify it using `--dir` flag

Content of HDD

Image

@ppawlowski
Copy link
Contributor Author

@Steve-Mcl Directory validation function improved.

@ppawlowski ppawlowski requested a review from Steve-Mcl August 20, 2025 11:12
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.

windows local testing all good.

@hardillb
Copy link
Contributor

Testing both install directory and no otc on Linux.

I get the following prompt:

You can either:
  1. Install the device agent only (you'll need to configure it manually later)
  2. Provide a device configuration file now
Do you want to provide a device agent configuration now? (Y/n)

This appears to be presenting a 1 or 2 but then asks a yes / no question about option 1. I feel it would be more natural to ask for path 1 or 2

@hardillb
Copy link
Contributor

Also not 100% related, but if you choose to use an existing user (the current user) when uninstalling it tries to remove that user without asking.

Copy link
Contributor

@hardillb hardillb left a comment

Choose a reason for hiding this comment

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

Approved with comments in main body of PR.

Happy to ship but needs follow up PR about user removal and possibly the setup question.

Base automatically changed from feat-dai-no-otc-install to main August 28, 2025 08:31
@ppawlowski ppawlowski marked this pull request as draft August 28, 2025 10:27
@ppawlowski ppawlowski marked this pull request as ready for review August 28, 2025 13:48
@ppawlowski ppawlowski requested a review from Steve-Mcl August 28, 2025 13:48
@ppawlowski ppawlowski marked this pull request as draft August 29, 2025 09:41
@ppawlowski ppawlowski marked this pull request as ready for review August 29, 2025 10:16
@joepavitt
Copy link
Contributor

@ppawlowski can I get a status update here please?

@ppawlowski
Copy link
Contributor Author

@ppawlowski can I get a status update here please?

It's pending a review after a recent bug discovery in the Windows installation.

@Steve-Mcl
Copy link
Contributor

Steve-Mcl commented Aug 29, 2025

From My POV @joepavitt, this item was called out on my standup. I was mid testing it when another commit (Fix nssm appParameter) landed. I have just pulled it and will be doing re-review momentarily. Hold tight :)

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.

tested install/uninstall with/without OTC, with/without -d, --dir (spaces and no spaces in dir name)

All good.

@ppawlowski ppawlowski merged commit ce7e5ae into main Sep 1, 2025
7 checks passed
@ppawlowski ppawlowski deleted the feat-dai-custom-workdir branch September 1, 2025 08:39
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.

Installer: Add possibility to install device agent in custom directory

4 participants