mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-12 19:59:56 +00:00
Wails3 uses the WebKit-style WebView2 runtime instead of Fyne's OpenGL backend, so the Mesa3D opengl32.dll payload that the Fyne build needed for RDP/VM rendering can leave the .exe and .msi installers. Add a WebView2 bootstrap step that probes the EdgeUpdate registry markers (both HKLM\WOW6432Node and HKCU) and silently runs MicrosoftEdgeWebview2Setup.exe only if the runtime is missing. NSIS uses an inline macro adapted from Wails3's wails_tools.nsh; WiX uses a deferred CustomAction gated on RegistrySearch properties. Both expect the bootstrapper payload at client/MicrosoftEdgeWebview2Setup.exe, which the sign-pipelines build step generates with `wails3 generate webview2bootstrapper`. The matching sign-pipelines change lives in that repo's PR. The uninstall section keeps an unconditional `Delete opengl32.dll` so upgrades from older Fyne builds clean up the leftover file.
109 lines
5.4 KiB
XML
109 lines
5.4 KiB
XML
<Wix
|
|
xmlns="http://wixtoolset.org/schemas/v4/wxs"
|
|
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
|
|
<Package Name="NetBird" Version="$(env.NETBIRD_VERSION)" Manufacturer="NetBird GmbH" Language="1033" UpgradeCode="6456ec4e-3ad6-4b9b-a2be-98e81cb21ccf"
|
|
InstallerVersion="500" Compressed="yes" Codepage="utf-8" >
|
|
|
|
|
|
<MediaTemplate EmbedCab="yes" />
|
|
|
|
<Feature Id="NetbirdFeature" Title="Netbird" Level="1">
|
|
<ComponentGroupRef Id="NetbirdFilesComponent" />
|
|
</Feature>
|
|
|
|
<MajorUpgrade AllowSameVersionUpgrades='yes' DowngradeErrorMessage="A newer version of [ProductName] is already installed. Setup will now exit."/>
|
|
|
|
<StandardDirectory Id="ProgramFiles64Folder">
|
|
<Directory Id="NetbirdInstallDir" Name="Netbird">
|
|
<Component Id="NetbirdFiles" Guid="db3165de-cc6e-4922-8396-9d892950e23e" Bitness="always64">
|
|
<File ProcessorArchitecture="$(var.ProcessorArchitecture)" Source=".\dist\netbird_windows_$(var.ArchSuffix)\netbird.exe" KeyPath="yes" />
|
|
<File ProcessorArchitecture="$(var.ProcessorArchitecture)" Source=".\dist\netbird_windows_$(var.ArchSuffix)\netbird-ui.exe">
|
|
<Shortcut Id="NetbirdDesktopShortcut" Directory="DesktopFolder" Name="NetBird" WorkingDirectory="NetbirdInstallDir" Icon="NetbirdIcon">
|
|
<ShortcutProperty Key="System.AppUserModel.ID" Value="NetBird" />
|
|
<ShortcutProperty Key="System.AppUserModel.ToastActivatorCLSID" Value="{0E1B4DE7-E148-432B-9814-544F941826EC}" />
|
|
</Shortcut>
|
|
<Shortcut Id="NetbirdStartMenuShortcut" Directory="StartMenuFolder" Name="NetBird" WorkingDirectory="NetbirdInstallDir" Icon="NetbirdIcon">
|
|
<ShortcutProperty Key="System.AppUserModel.ID" Value="NetBird" />
|
|
<ShortcutProperty Key="System.AppUserModel.ToastActivatorCLSID" Value="{0E1B4DE7-E148-432B-9814-544F941826EC}" />
|
|
</Shortcut>
|
|
</File>
|
|
<File ProcessorArchitecture="$(var.ProcessorArchitecture)" Source=".\dist\netbird_windows_$(var.ArchSuffix)\wintun.dll" />
|
|
<File Id="NetbirdToastIcon" Name="netbird.png" Source=".\client\ui\assets\netbird.png" />
|
|
|
|
<ServiceInstall
|
|
Id="NetBirdService"
|
|
Name="NetBird"
|
|
DisplayName="NetBird"
|
|
Description="Connect your devices into a secure WireGuard-based overlay network with SSO, MFA and granular access controls."
|
|
Start="auto" Type="ownProcess"
|
|
ErrorControl="normal"
|
|
Account="LocalSystem"
|
|
Vital="yes"
|
|
Interactive="no"
|
|
Arguments='service run config [CommonAppDataFolder]Netbird\config.json log-level info'
|
|
/>
|
|
<ServiceControl Id="NetBirdService" Name="NetBird" Start="install" Stop="both" Remove="uninstall" Wait="yes" />
|
|
|
|
<Environment Id="UpdatePath" Name="PATH" Value="[NetbirdInstallDir]" Part="last" Action="set" System="yes" />
|
|
|
|
</Component>
|
|
</Directory>
|
|
</StandardDirectory>
|
|
|
|
<!-- Per-user component: HKCU keypath (auto GUID via "*"), separate from
|
|
the per-machine NetbirdFiles component to satisfy ICE57. -->
|
|
<StandardDirectory Id="ProgramMenuFolder">
|
|
<Component Id="NetbirdAumidRegistry" Guid="*">
|
|
<RegistryKey Root="HKCU" Key="Software\Classes\AppUserModelId\NetBird" ForceDeleteOnUninstall="yes">
|
|
<RegistryValue Name="InstalledByMSI" Type="integer" Value="1" KeyPath="yes" />
|
|
</RegistryKey>
|
|
</Component>
|
|
</StandardDirectory>
|
|
|
|
<ComponentGroup Id="NetbirdFilesComponent">
|
|
<ComponentRef Id="NetbirdFiles" />
|
|
<ComponentRef Id="NetbirdAumidRegistry" />
|
|
</ComponentGroup>
|
|
|
|
<util:CloseApplication Id="CloseNetBird" CloseMessage="no" Target="netbird.exe" RebootPrompt="no" />
|
|
<util:CloseApplication Id="CloseNetBirdUI" CloseMessage="no" Target="netbird-ui.exe" RebootPrompt="no" TerminateProcess="0" />
|
|
|
|
<!-- WebView2 evergreen runtime detection.
|
|
Probe both the per-machine and per-user EdgeUpdate keys; if either
|
|
reports a non-empty `pv` value the runtime is already installed
|
|
and we skip the bootstrapper. -->
|
|
<Property Id="WEBVIEW2_VERSION_HKLM">
|
|
<RegistrySearch Id="WV2HKLM" Root="HKLM"
|
|
Key="SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}"
|
|
Name="pv" Type="raw" Bitness="always64" />
|
|
</Property>
|
|
<Property Id="WEBVIEW2_VERSION_HKCU">
|
|
<RegistrySearch Id="WV2HKCU" Root="HKCU"
|
|
Key="Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}"
|
|
Name="pv" Type="raw" />
|
|
</Property>
|
|
|
|
<!-- Embed the bootstrapper payload. Path is relative to the WiX
|
|
working directory; sign-pipelines stages it next to client/
|
|
via `wails3 generate webview2bootstrapper`. -->
|
|
<Binary Id="WebView2Bootstrapper" SourceFile=".\client\MicrosoftEdgeWebview2Setup.exe" />
|
|
|
|
<CustomAction Id="InstallWebView2"
|
|
BinaryRef="WebView2Bootstrapper"
|
|
ExeCommand="/silent /install"
|
|
Execute="deferred"
|
|
Impersonate="no"
|
|
Return="check" />
|
|
|
|
<InstallExecuteSequence>
|
|
<Custom Action="InstallWebView2" Before="InstallFinalize"
|
|
Condition="NOT WEBVIEW2_VERSION_HKLM AND NOT WEBVIEW2_VERSION_HKCU AND NOT REMOVE" />
|
|
</InstallExecuteSequence>
|
|
|
|
<!-- Icons -->
|
|
<Icon Id="NetbirdIcon" SourceFile=".\client\ui\assets\netbird.ico" />
|
|
<Property Id="ARPPRODUCTICON" Value="NetbirdIcon" />
|
|
|
|
</Package>
|
|
</Wix>
|