Skip to content

Commit

Permalink
Fixed pathing of systray.dll
Browse files Browse the repository at this point in the history
  • Loading branch information
oxtoacart committed Feb 25, 2015
1 parent 691776d commit c7c4934
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/github.com/getlantern/systray/systray_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"syscall"
"unsafe"

"github.com/getlantern/filepersist"
)

var (
iconFiles = make([]*os.File, 0)
dllDir = path.Join(os.Getenv("APPDATA"), "systray")
dllFile = path.Join(dllDir, "systray.dll")
dllDir = filepath.Join(os.Getenv("APPDATA"), "systray")
dllFile = filepath.Join(dllDir, "systray.dll")

mod = syscall.NewLazyDLL(dllFile)
_nativeLoop = mod.NewProc("nativeLoop")
Expand All @@ -35,7 +37,7 @@ func init() {
panic(fmt.Errorf("Unable to create directory %v to hold systray.dll: %v", dllDir, err))
}

err = ioutil.WriteFile(dllFile, b, 0644)
err = filepersist.Save(dllFile, b, 0644)
if err != nil {
panic(fmt.Errorf("Unable to save systray.dll to %v: %v", dllFile, err))
}
Expand Down

0 comments on commit c7c4934

Please sign in to comment.