mirror of
https://github.com/netbirdio/systray.git
synced 2026-05-22 17:08:41 -07:00
Merge pull request #19 from luckcolors/master
Added support for windows 64. Added static builds of the dlls.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
+8
-5
@@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/getlantern/filepersist"
|
||||
@@ -14,7 +15,9 @@ import (
|
||||
var (
|
||||
iconFiles = make([]*os.File, 0)
|
||||
dllDir = filepath.Join(os.Getenv("APPDATA"), "systray")
|
||||
dllFile = filepath.Join(dllDir, "systray.dll")
|
||||
dllFileName = "systray" + runtime.GOARCH + ".dll"
|
||||
dllFile = filepath.Join(dllDir, dllFileName)
|
||||
|
||||
|
||||
mod = syscall.NewLazyDLL(dllFile)
|
||||
_nativeLoop = mod.NewProc("nativeLoop")
|
||||
@@ -27,19 +30,19 @@ var (
|
||||
|
||||
func init() {
|
||||
// Write DLL to file
|
||||
b, err := Asset("systray.dll")
|
||||
b, err := Asset(dllFileName)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("Unable to read systray.dll: %v", err))
|
||||
panic(fmt.Errorf("Unable to read " + dllFileName + ": %v", err))
|
||||
}
|
||||
|
||||
err = os.MkdirAll(dllDir, 0755)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("Unable to create directory %v to hold systray.dll: %v", dllDir, err))
|
||||
panic(fmt.Errorf("Unable to create directory %v to hold " + dllFileName + ": %v", dllDir, err))
|
||||
}
|
||||
|
||||
err = filepersist.Save(dllFile, b, 0644)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("Unable to save systray.dll to %v: %v", dllFile, err))
|
||||
panic(fmt.Errorf("Unable to save " + dllFileName + " to %v: %v", dllFile, err))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+98
-83
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user