Skip to content

Commit d81b67b

Browse files
committed
Fix windows build & ignore win/ output dir
1 parent 61ec0bc commit d81b67b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11

2-
# Executable
2+
# build output
33
linux_installer
44
go-installer
55
installer
6+
win/
67

78
# goland project files
89
.idea/

install_windows.go

+10-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ package linux_installer
55
// this code is untested!!
66

77
import (
8+
"errors"
9+
"log"
810
"os"
11+
"os/exec"
912
"path/filepath"
1013
"syscall"
1114
"unsafe"
@@ -44,15 +47,18 @@ func osDiskSpace(path string) (availableBytes int64) {
4447
return
4548
}
4649

47-
func osRunHookIfExists(scriptFile string) error {
48-
if _, err := os.Stat(scriptFile + ".bat"); os.IsNotExist(err) {
50+
func osCreateLauncherEntry(variables ...StringMap) (desktopFilepath string, err error) { return }
51+
func osCreateUninstaller(installDir string, variables ...StringMap) (err error) { return }
52+
53+
func osRunHookIfExists(scriptFile string) (err error) {
54+
if _, err = os.Stat(scriptFile + ".bat"); os.IsNotExist(err) {
4955
return
5056
}
5157
out, err := exec.Command(scriptFile + ".bat").Output()
5258
log.Println("hook output:\n", string(out[:]))
5359
if err != nil {
54-
if exitErr, ok := (*exec.ExitError)(err); ok {
55-
return errors.New(err.Stderr)
60+
if exitErr, ok := err.(*exec.ExitError); ok {
61+
return errors.New(string(exitErr.Stderr))
5662
} else {
5763
return err
5864
}

0 commit comments

Comments
 (0)