Merge pull request #19 from luckcolors/master

Added support for windows 64. Added static builds of the dlls.
This commit is contained in:
fffw
2016-08-30 08:00:03 +08:00
committed by GitHub
5 changed files with 106 additions and 88 deletions
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+8 -5
View File
@@ -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
View File
File diff suppressed because one or more lines are too long