mirror of https://github.com/gogits/gogs.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
365 B
20 lines
365 B
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 |
|
}
|
|
|