[GH-ISSUE #4475] Register autostart entry for the NetBird UI from within the app #8729

Open
opened 2026-08-05 01:19:19 -04:00 by saavagebueno · 8 comments
Owner

Originally created by @nazarewk on GitHub (Sep 10, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/4475

Is your feature request related to a problem? Please describe.
from the public Slack:

Settings > Connect on Startup in the Windows client (v0.56.1) works as intended after a reboot, but the NetBird GUI isn't active/launched in the system tray icons. Feature request to create a Settings checkbox that does Start NetBird at Login

Windows apps were/are commonly registering their own autostart entries, sounds reasonable to have something similar for NetBird UI process.

Describe the solution you'd like

N/A

Describe alternatives you've considered

N/A

Additional context
was somewhat mentioned as a part of https://github.com/netbirdio/netbird/issues/3634

Originally created by @nazarewk on GitHub (Sep 10, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/4475 **Is your feature request related to a problem? Please describe.** from the public Slack: > Settings > Connect on Startup in the Windows client (v0.56.1) works as intended after a reboot, but the NetBird GUI isn't active/launched in the system tray icons. Feature request to create a Settings checkbox that does Start NetBird at Login Windows apps were/are commonly registering their own autostart entries, sounds reasonable to have something similar for NetBird UI process. **Describe the solution you'd like** N/A **Describe alternatives you've considered** N/A **Additional context** was somewhat mentioned as a part of https://github.com/netbirdio/netbird/issues/3634
saavagebueno added the feature-requestUXclient-uigui labels 2026-08-05 01:19:19 -04:00
Author
Owner

@austin-rh commented on GitHub (Sep 10, 2025):

This was mentioned in https://github.com/netbirdio/netbird/issues/2692, but the issue was closed. Is there any update to include this option in the MSI installer?
Image

<!-- gh-comment-id:3275784429 --> @austin-rh commented on GitHub (Sep 10, 2025): This was mentioned in https://github.com/netbirdio/netbird/issues/2692, but the issue was closed. Is there any update to include this option in the MSI installer? <img width="499" height="388" alt="Image" src="https://github.com/user-attachments/assets/56191e80-5e28-4742-afe6-ce4493a79db3" />
Author
Owner

@2-click commented on GitHub (Oct 1, 2025):

Really sad that there's no such option in the MSI :(

<!-- gh-comment-id:3357254810 --> @2-click commented on GitHub (Oct 1, 2025): Really sad that there's no such option in the MSI :(
Author
Owner

@lixmal commented on GitHub (Oct 1, 2025):

You can run

New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "Netbird" -Value "C:\Program Files\Netbird\Netbird-ui.exe" -PropertyType String -Force

to make it autostart

<!-- gh-comment-id:3357358387 --> @lixmal commented on GitHub (Oct 1, 2025): You can run ```ps1 New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "Netbird" -Value "C:\Program Files\Netbird\Netbird-ui.exe" -PropertyType String -Force ``` to make it autostart
Author
Owner

@2-click commented on GitHub (Oct 2, 2025):

The MSI gets installed as system for all users, so this command would be a better workaround:

New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" `
  -Name "Netbird" `
  -Value "C:\Program Files\Netbird\Netbird-ui.exe" `
  -PropertyType String `
  -Force

Still, a native solution would be better since lots of admins deploy NetBird as an MSI because it's easy to upload in MDMs like Intune, but you can't specify additional commands. So in this case you need to deploy an MSI-App in intune together with a platform script. Or bundle it as a win32 app. Would be way easier if the MSI would create the autorun entry automatically. Bonus points for providing a MSI paramter to disable autorun registration.

<!-- gh-comment-id:3360129166 --> @2-click commented on GitHub (Oct 2, 2025): The MSI gets installed as system for all users, so this command would be a better workaround: ``` New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" ` -Name "Netbird" ` -Value "C:\Program Files\Netbird\Netbird-ui.exe" ` -PropertyType String ` -Force ``` Still, a native solution would be better since lots of admins deploy NetBird as an MSI because it's easy to upload in MDMs like Intune, but you can't specify additional commands. So in this case you need to deploy an MSI-App in intune together with a platform script. Or bundle it as a win32 app. Would be way easier if the MSI would create the autorun entry automatically. Bonus points for providing a MSI paramter to disable autorun registration.
Author
Owner

@flotpg commented on GitHub (Nov 7, 2025):

@lixmal
7be2c2bb61
I have a question: Can you please clarify if this available as a silent / unattended switch?
Is this still only available for the setup.exe?
Whats the difference between setup.exe and MSI?

Thank you very much.

<!-- gh-comment-id:3501573924 --> @flotpg commented on GitHub (Nov 7, 2025): @lixmal https://github.com/netbirdio/netbird/pull/3469/commits/7be2c2bb613189a1e1e3b00f7507def7b35e78d9 I have a question: Can you please clarify if this available as a silent / unattended switch? Is this still only available for the setup.exe? Whats the difference between setup.exe and MSI? Thank you very much.
Author
Owner

@si458 commented on GitHub (Feb 26, 2026):

i also encountered this problem
the msi doesnt seem to add the Run entry at all, but the exe does
and sadly i use UniGetUI to update software and they use WinGet and the main repos use MSI so its quite a big problem
so having to go to each machine remotely (so way some how) and run the command to add the line when the MSI should do it by default OR at least give us the ability to add the entry using the UI like above with the connect on startup

<!-- gh-comment-id:3966646806 --> @si458 commented on GitHub (Feb 26, 2026): i also encountered this problem the msi doesnt seem to add the Run entry at all, but the exe does and sadly i use `UniGetUI` to update software and they use `WinGet` and the main repos use MSI so its quite a big problem so having to go to each machine remotely (so way some how) and run the command to add the line when the MSI should do it by default OR at least give us the ability to add the entry using the UI like above with the `connect on startup`
Author
Owner

@Greystone-Jake commented on GitHub (Mar 10, 2026):

I think this is an issue when you run the installer as a non admin user, the installer will ask for elevated privileges using UAC. The installer then runs in the context of a different user (i.e. administrator) and adds the HKCU run key to that user.
You can check if this is the issue if you check your registry HKEY_USERS\S-1-12-1{<Administrator User SID}\Software\Microsoft\Windows\CurrentVersion\Run and see and entry for Netbird.

This should be fixable in client/installer.nsis by changing line 250
WriteRegStr HKCU "${AUTOSTART_REG_KEY}" "${APP_NAME}" "$INSTDIR\${UI_APP_EXE}.exe"
to
WriteRegStr HKLM "${AUTOSTART_REG_KEY}" "${APP_NAME}" "$INSTDIR\${UI_APP_EXE}.exe"
which will change the reg key to autorun for all users.

The other option is to possibly set SetShellVarContext current so that the installer knows to use the current user as the context not the executing user, but I'm not familiar enough with NSIS installers to know if that is right.

As a bit of an aside the reg key sets an unquoted path which can lead to exploitation if the path contains spaces in it, see here for more information https://devblogs.microsoft.com/oldnewthing/20240723-00/?p=110032.
It should be able to be fixed by changing the path to '"$INSTDIR\${UI_APP_EXE}.exe"'

<!-- gh-comment-id:4029907547 --> @Greystone-Jake commented on GitHub (Mar 10, 2026): I think this is an issue when you run the installer as a non admin user, the installer will ask for elevated privileges using UAC. The installer then runs in the context of a different user (i.e. administrator) and adds the HKCU run key to that user. You can check if this is the issue if you check your registry `HKEY_USERS\S-1-12-1{<Administrator User SID}\Software\Microsoft\Windows\CurrentVersion\Run` and see and entry for Netbird. This should be fixable in `client/installer.nsis` by changing line 250 `WriteRegStr HKCU "${AUTOSTART_REG_KEY}" "${APP_NAME}" "$INSTDIR\${UI_APP_EXE}.exe"` to `WriteRegStr HKLM "${AUTOSTART_REG_KEY}" "${APP_NAME}" "$INSTDIR\${UI_APP_EXE}.exe"` which will change the reg key to autorun for all users. The other option is to possibly set `SetShellVarContext current` so that the installer knows to use the current user as the context not the executing user, but I'm not familiar enough with NSIS installers to know if that is right. As a bit of an aside the reg key sets an unquoted path which can lead to exploitation if the path contains spaces in it, see here for more information [https://devblogs.microsoft.com/oldnewthing/20240723-00/?p=110032](https://devblogs.microsoft.com/oldnewthing/20240723-00/?p=110032). It should be able to be fixed by changing the path to `'"$INSTDIR\${UI_APP_EXE}.exe"'`
Author
Owner

@schabpiotr commented on GitHub (Jul 29, 2026):

Unfortunately this is still not working, I have to add the autostart registry key manually even after last manual install of latest update.

<!-- gh-comment-id:5117238391 --> @schabpiotr commented on GitHub (Jul 29, 2026): Unfortunately this is still not working, I have to add the autostart registry key manually even after last manual install of latest update.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#8729