@@ -17,14 +17,14 @@ import (
1717
1818const (
1919 daemonName = "netbird"
20- uiName = "netbird-ui"
2120 updaterBinary = "updater"
2221
2322 defaultTempDir = "/var/lib/netbird/tmp-install"
2423
2524 pkgDownloadURL = "https://github.com/netbirdio/netbird/releases/download/v%version/netbird_%version_darwin_%arch.pkg"
2625
27- updaterSrcPath = "/Applications/NetBird.app/Contents/MacOS/netbird-ui"
26+ //updaterSrcPath = "/Applications/NetBird.app/Contents/MacOS/netbird-ui"
27+ updaterSrcPath = "/Users/pzoli/Desktop/NetBird.app/Contents/MacOS/netbird-ui"
2828)
2929
3030var (
@@ -53,6 +53,7 @@ func (u *Installer) Setup(ctx context.Context, dryRun bool, targetVersion string
5353 }()
5454
5555 if dryRun {
56+ time .Sleep (10 * time .Second )
5657 log .Infof ("dry-run mode enabled, skipping actual installation" )
5758 resultErr = fmt .Errorf ("dry-run mode enabled" )
5859 return
@@ -100,8 +101,7 @@ func (u *Installer) startDaemon(daemonFolder string) error {
100101}
101102
102103func (u * Installer ) startUIAsUser (daemonFolder string ) error {
103- uiPath := filepath .Join (daemonFolder , uiName )
104- log .Infof ("starting netbird-ui: %s" , uiPath )
104+ log .Infof ("starting netbird-ui: %s" , updaterSrcPath )
105105
106106 // Get the current console user
107107 cmd := exec .Command ("stat" , "-f" , "%Su" , "/dev/console" )
@@ -125,8 +125,8 @@ func (u *Installer) startUIAsUser(daemonFolder string) error {
125125
126126 // Start the UI process as the console user using launchctl
127127 // This ensures the app runs in the user's context with proper GUI access
128- launchCmd := exec .Command ("launchctl" , "asuser" , userInfo .Uid , "sudo " , "-u " , username , uiPath )
129-
128+ launchCmd := exec .Command ("launchctl" , "asuser" , userInfo .Uid , "open " , "-a " , updaterSrcPath )
129+ log . Infof ( "launchCmd: %s" , launchCmd . String ())
130130 // Set the user's home directory for proper macOS app behavior
131131 launchCmd .Env = append (os .Environ (), "HOME=" + userInfo .HomeDir )
132132
0 commit comments