mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-01 02:59:08 +02:00
The daemon runs as SYSTEM and writes the bundle into C:\Windows\SystemTemp, whose ACL denies the logged-in user, so a plain 'explorer /select' could not open it. The Windows reveal now elevates via ShellExecuteW with the runas verb, falling back to an unelevated reveal of the parent dir on decline.
21 lines
402 B
Go
21 lines
402 B
Go
//go:build !android && !ios && !freebsd && !js && !windows
|
|
|
|
package services
|
|
|
|
import (
|
|
"os/exec"
|
|
"path/filepath"
|
|
"runtime"
|
|
)
|
|
|
|
// revealFile opens the OS file manager focused on path.
|
|
func revealFile(path string) error {
|
|
var cmd *exec.Cmd
|
|
if runtime.GOOS == "darwin" {
|
|
cmd = exec.Command("open", "-R", path)
|
|
} else {
|
|
cmd = exec.Command("xdg-open", filepath.Dir(path))
|
|
}
|
|
return cmd.Start()
|
|
}
|