mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-07 07:21:27 +02:00
- **Wails v3 application** (`client/ui`) with a React + TypeScript + Tailwind frontend replacing the Fyne UI: main connection view, exit-node switcher, networks/peers browser with detail panels, profile management, settings (general, network, SSH, security, troubleshooting, appearance), debug-bundle creation, and a first-run welcome flow. - **Internationalization**: go-i18n bundle with 9 locales (en, de, es, fr, hu, it, pt, ru, zh-CN) shared between the tray and the frontend. - **New system tray** implementation with per-platform theme-aware icons, including a native XEmbed host for Linux (`xembed_tray_linux.c`) and a Linux theme watcher. - **Session handling**: auth session watcher (`client/internal/auth/sessionwatch`), pending login flow, session-expiration dialog and tray notifications, and `netbird login` improvements. - **Daemon API extensions** (`daemon.proto`): status stream subscription, event stream, networks/exit-node selection endpoints, and richer full status — with probe throttling on the daemon side to protect against UI-driven request storms. - **UI preferences store** persisted per profile, autostart management via the daemon (single source of truth in HKCU on Windows). - **Build system**: Taskfile-based builds per platform (macOS, Linux, Windows), Docker cross-compilation images, MSIX/NSIS/nfpm/AppImage packaging, and a new `frontend-ui` CI workflow. Co-authored-by: Zoltan Papp <zoltan.pmail@gmail.com> Co-authored-by: Eduard Gert <kontakt@eduardgert.de> Co-authored-by: braginini <bangvalo@gmail.com> Co-authored-by: Pascal Fischer <32096965+pascal-fischer@users.noreply.github.com> Co-authored-by: riccardom <riccardomanfrin@gmail.com>
236 lines
7.4 KiB
NSIS
236 lines
7.4 KiB
NSIS
# DO NOT EDIT - Generated automatically by `wails build`
|
|
|
|
!include "x64.nsh"
|
|
!include "WinVer.nsh"
|
|
!include "FileFunc.nsh"
|
|
|
|
!ifndef INFO_PROJECTNAME
|
|
!define INFO_PROJECTNAME "netbird-ui"
|
|
!endif
|
|
!ifndef INFO_COMPANYNAME
|
|
!define INFO_COMPANYNAME "NetBird"
|
|
!endif
|
|
!ifndef INFO_PRODUCTNAME
|
|
!define INFO_PRODUCTNAME "NetBird"
|
|
!endif
|
|
!ifndef INFO_PRODUCTVERSION
|
|
!define INFO_PRODUCTVERSION "0.0.1"
|
|
!endif
|
|
!ifndef INFO_COPYRIGHT
|
|
!define INFO_COPYRIGHT "NetBird GmbH"
|
|
!endif
|
|
!ifndef PRODUCT_EXECUTABLE
|
|
!define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe"
|
|
!endif
|
|
!ifndef UNINST_KEY_NAME
|
|
!define UNINST_KEY_NAME "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}"
|
|
!endif
|
|
!define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${UNINST_KEY_NAME}"
|
|
|
|
!ifndef REQUEST_EXECUTION_LEVEL
|
|
!define REQUEST_EXECUTION_LEVEL "admin"
|
|
!endif
|
|
|
|
RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}"
|
|
|
|
!ifdef ARG_WAILS_AMD64_BINARY
|
|
!define SUPPORTS_AMD64
|
|
!endif
|
|
|
|
!ifdef ARG_WAILS_ARM64_BINARY
|
|
!define SUPPORTS_ARM64
|
|
!endif
|
|
|
|
!ifdef SUPPORTS_AMD64
|
|
!ifdef SUPPORTS_ARM64
|
|
!define ARCH "amd64_arm64"
|
|
!else
|
|
!define ARCH "amd64"
|
|
!endif
|
|
!else
|
|
!ifdef SUPPORTS_ARM64
|
|
!define ARCH "arm64"
|
|
!else
|
|
!error "Wails: Undefined ARCH, please provide at least one of ARG_WAILS_AMD64_BINARY or ARG_WAILS_ARM64_BINARY"
|
|
!endif
|
|
!endif
|
|
|
|
!macro wails.checkArchitecture
|
|
!ifndef WAILS_WIN10_REQUIRED
|
|
!define WAILS_WIN10_REQUIRED "This product is only supported on Windows 10 (Server 2016) and later."
|
|
!endif
|
|
|
|
!ifndef WAILS_ARCHITECTURE_NOT_SUPPORTED
|
|
!define WAILS_ARCHITECTURE_NOT_SUPPORTED "This product can't be installed on the current Windows architecture. Supports: ${ARCH}"
|
|
!endif
|
|
|
|
${If} ${AtLeastWin10}
|
|
!ifdef SUPPORTS_AMD64
|
|
${if} ${IsNativeAMD64}
|
|
Goto ok
|
|
${EndIf}
|
|
!endif
|
|
|
|
!ifdef SUPPORTS_ARM64
|
|
${if} ${IsNativeARM64}
|
|
Goto ok
|
|
${EndIf}
|
|
!endif
|
|
|
|
IfSilent silentArch notSilentArch
|
|
silentArch:
|
|
SetErrorLevel 65
|
|
Abort
|
|
notSilentArch:
|
|
MessageBox MB_OK "${WAILS_ARCHITECTURE_NOT_SUPPORTED}"
|
|
Quit
|
|
${else}
|
|
IfSilent silentWin notSilentWin
|
|
silentWin:
|
|
SetErrorLevel 64
|
|
Abort
|
|
notSilentWin:
|
|
MessageBox MB_OK "${WAILS_WIN10_REQUIRED}"
|
|
Quit
|
|
${EndIf}
|
|
|
|
ok:
|
|
!macroend
|
|
|
|
!macro wails.files
|
|
!ifdef SUPPORTS_AMD64
|
|
${if} ${IsNativeAMD64}
|
|
File "/oname=${PRODUCT_EXECUTABLE}" "${ARG_WAILS_AMD64_BINARY}"
|
|
${EndIf}
|
|
!endif
|
|
|
|
!ifdef SUPPORTS_ARM64
|
|
${if} ${IsNativeARM64}
|
|
File "/oname=${PRODUCT_EXECUTABLE}" "${ARG_WAILS_ARM64_BINARY}"
|
|
${EndIf}
|
|
!endif
|
|
!macroend
|
|
|
|
!macro wails.writeUninstaller
|
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
|
|
|
SetRegView 64
|
|
WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "${INFO_COMPANYNAME}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "${INFO_PRODUCTNAME}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${INFO_PRODUCTVERSION}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRODUCT_EXECUTABLE}"
|
|
WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
|
WriteRegStr HKLM "${UNINST_KEY}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
|
|
|
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
|
IntFmt $0 "0x%08X" $0
|
|
WriteRegDWORD HKLM "${UNINST_KEY}" "EstimatedSize" "$0"
|
|
!macroend
|
|
|
|
!macro wails.deleteUninstaller
|
|
Delete "$INSTDIR\uninstall.exe"
|
|
|
|
SetRegView 64
|
|
DeleteRegKey HKLM "${UNINST_KEY}"
|
|
!macroend
|
|
|
|
!macro wails.setShellContext
|
|
${If} ${REQUEST_EXECUTION_LEVEL} == "admin"
|
|
SetShellVarContext all
|
|
${else}
|
|
SetShellVarContext current
|
|
${EndIf}
|
|
!macroend
|
|
|
|
# Install webview2 by launching the bootstrapper
|
|
# See https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#online-only-deployment
|
|
!macro wails.webview2runtime
|
|
!ifndef WAILS_INSTALL_WEBVIEW_DETAILPRINT
|
|
!define WAILS_INSTALL_WEBVIEW_DETAILPRINT "Installing: WebView2 Runtime"
|
|
!endif
|
|
|
|
SetRegView 64
|
|
# If the admin key exists and is not empty then webview2 is already installed
|
|
ReadRegStr $0 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv"
|
|
${If} $0 != ""
|
|
Goto ok
|
|
${EndIf}
|
|
|
|
${If} ${REQUEST_EXECUTION_LEVEL} == "user"
|
|
# If the installer is run in user level, check the user specific key exists and is not empty then webview2 is already installed
|
|
ReadRegStr $0 HKCU "Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv"
|
|
${If} $0 != ""
|
|
Goto ok
|
|
${EndIf}
|
|
${EndIf}
|
|
|
|
SetDetailsPrint both
|
|
DetailPrint "${WAILS_INSTALL_WEBVIEW_DETAILPRINT}"
|
|
SetDetailsPrint listonly
|
|
|
|
InitPluginsDir
|
|
CreateDirectory "$pluginsdir\webview2bootstrapper"
|
|
SetOutPath "$pluginsdir\webview2bootstrapper"
|
|
File "MicrosoftEdgeWebview2Setup.exe"
|
|
ExecWait '"$pluginsdir\webview2bootstrapper\MicrosoftEdgeWebview2Setup.exe" /silent /install'
|
|
|
|
SetDetailsPrint both
|
|
ok:
|
|
!macroend
|
|
|
|
# Copy of APP_ASSOCIATE and APP_UNASSOCIATE macros from here https://gist.github.com/nikku/281d0ef126dbc215dd58bfd5b3a5cd5b
|
|
!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND
|
|
; Backup the previously associated file class
|
|
ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" ""
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0"
|
|
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "${FILECLASS}"
|
|
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}" "" `${DESCRIPTION}`
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\DefaultIcon" "" `${ICON}`
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell" "" "open"
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\open" "" `${COMMANDTEXT}`
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${FILECLASS}\shell\open\command" "" `${COMMAND}`
|
|
!macroend
|
|
|
|
!macro APP_UNASSOCIATE EXT FILECLASS
|
|
; Backup the previously associated file class
|
|
ReadRegStr $R0 SHELL_CONTEXT "Software\Classes\.${EXT}" `${FILECLASS}_backup`
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\.${EXT}" "" "$R0"
|
|
|
|
DeleteRegKey SHELL_CONTEXT `Software\Classes\${FILECLASS}`
|
|
!macroend
|
|
|
|
!macro wails.associateFiles
|
|
; Create file associations
|
|
|
|
!macroend
|
|
|
|
!macro wails.unassociateFiles
|
|
; Delete app associations
|
|
|
|
!macroend
|
|
|
|
!macro CUSTOM_PROTOCOL_ASSOCIATE PROTOCOL DESCRIPTION ICON COMMAND
|
|
DeleteRegKey SHELL_CONTEXT "Software\Classes\${PROTOCOL}"
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "" "${DESCRIPTION}"
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}" "URL Protocol" ""
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\DefaultIcon" "" "${ICON}"
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell" "" ""
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open" "" ""
|
|
WriteRegStr SHELL_CONTEXT "Software\Classes\${PROTOCOL}\shell\open\command" "" "${COMMAND}"
|
|
!macroend
|
|
|
|
!macro CUSTOM_PROTOCOL_UNASSOCIATE PROTOCOL
|
|
DeleteRegKey SHELL_CONTEXT "Software\Classes\${PROTOCOL}"
|
|
!macroend
|
|
|
|
!macro wails.associateCustomProtocols
|
|
; Create custom protocols associations
|
|
|
|
!macroend
|
|
|
|
!macro wails.unassociateCustomProtocols
|
|
; Delete app custom protocol associations
|
|
|
|
!macroend |