Browse Source

Added support for XP

pull/103/head
Unknown 11 years ago
parent
commit
76fb6dc6b1
  1. 10
      cmd/helper_windows.go
  2. 2
      gopm.go

10
cmd/helper_windows.go

@ -2,9 +2,19 @@ package cmd
import (
"os/exec"
"syscall"
)
func makeLink(oldPath, newPath string) error {
// Check if Windows version is XP.
cmd := exec.Command("cmd", "/c", "mklink", "/j", newPath, oldPath)
return cmd.Run()
}
func getWindowsVersion() int {
dll := syscall.MustLoadDLL("kernel32.dll")
p := dll.MustFindProc("GetVersion")
v, _, _ := p.Call()
return v
}

2
gopm.go

@ -18,6 +18,7 @@ package main
import (
"os"
"runtime"
"time"
"github.com/codegangsta/cli"
@ -60,5 +61,6 @@ func main() {
cmd.CmdInstall,
//cmd.CmdTest,
}
app.Compiled = time.Now()
app.Run(os.Args)
}

Loading…
Cancel
Save