diff --git a/cmd/launcher/main.go b/cmd/launcher/main.go index 773e475..10ab992 100644 --- a/cmd/launcher/main.go +++ b/cmd/launcher/main.go @@ -47,6 +47,8 @@ func init() { // On MacOS, only the first thread created by the OS is allowed to be the main GUI thread. // Also, on Windows, OLE code needs to run on the main thread, which we rely on when creating shortcuts. runtime.LockOSThread() // This call must be in init(). + + postInit() } func main() { diff --git a/cmd/launcher/post_init_unix.go b/cmd/launcher/post_init_unix.go new file mode 100644 index 0000000..10db0aa --- /dev/null +++ b/cmd/launcher/post_init_unix.go @@ -0,0 +1,7 @@ +//go:build linux || darwin +// +build linux darwin + +package main + +func postInit() { +} diff --git a/cmd/launcher/post_init_windows.go b/cmd/launcher/post_init_windows.go new file mode 100644 index 0000000..dead0b2 --- /dev/null +++ b/cmd/launcher/post_init_windows.go @@ -0,0 +1,10 @@ +package main + +import "golang.org/x/sys/windows" + +func postInit() { + err := windows.SetDllDirectory("") + if err != nil { + panic(err) + } +}