mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-08 14:39:09 +02:00
The build/config.yml that wails3 init scaffolded shipped with 'My Company',
'My Product', 'com.mycompany.myproduct' and '(c) 2025, My Company' template
defaults. The per-platform assets generated from it (Info.plist,
Info.dev.plist, info.json, nsis/wails_tools.nsh) carried the same strings,
which were visible in macOS Finder Get Info, Windows .exe Properties and
the NSIS installer.
Updated to the NetBird identity used by the legacy Fyne UI on main:
- companyName / copyright -> 'NetBird GmbH' (matches main release.yml's
COPYRIGHT env passed to goversioninfo)
- productName -> 'NetBird'
- productIdentifier -> 'io.netbird.client' (matches CFBundleIdentifier)
- description -> 'NetBird desktop client'
- darwin NSHumanReadableCopyright -> 'NetBird GmbH'
- windows LegalCopyright -> 'NetBird GmbH'
- nsis INFO_COPYRIGHT -> 'NetBird GmbH'
Version fields (0.0.1) are left in place: release builds get the real
version via goversioninfo (Windows) and sign-pipelines (macOS .app),
so the placeholder is only visible in local task package / task run
output and doesn't reach release artifacts.
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 |