New Broken code

This commit is contained in:
Josh Mudge 2019-11-11 21:24:15 -07:00
parent efe0b21d7b
commit e1ff342fce
3 changed files with 18 additions and 4 deletions

View File

@ -55,7 +55,7 @@ You can purchase a code-signing certificate here: https://cheapsslsecurity.com/c
### Signing the File
[Screenshot] Next, you will need to install Visual Studio. You can download Visual Studio here: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16
Next, you will need to install Visual Studio. You can download Visual Studio here: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community
In the install process, you will be greeted with this screen:
@ -120,7 +120,7 @@ This will create a folder named `static` with a file in it. You will then need t
go build -o setup.exe -ldflags "-s -w -H=windowsgui"
```
Refer back to the instructions on [How to Sign a File](#signing-the-setup -file) to sign your setup file as well. Then you're done!
Refer back to the instructions on [How to Sign a File](#signing-the-file) to sign your setup file as well. Then you're done! Just run `setup.exe`.
## WIP: Service

View File

@ -25,6 +25,6 @@ func main() {
http.Handle("/", http.FileServer(http.Dir(*directory)))
log.Printf("Serving %s on HTTP port: %s\n", *directory, *port)
log.Fatal(http.ListenAndServe(":"+*port, nil))
//log.Printf("Serving %s on HTTP port: %s\n", *directory, *port)
//log.Fatal(http.ListenAndServe(":"+*port, nil))
}

View File

@ -47,9 +47,23 @@ func main() {
//Create firewall rule
cmdinstance := exec.Command("powershell.exe", "-WindowStyle", "Hidden", "-Command", "New-NetFirewallRule", "-DisplayName", "'Go Web Server'", "-Direction", "Inbound", file, "-Action", "Allow")
cmdinstance.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} // Make it silent.
cmdinstance2 := exec.Command("start", "cmd", "/C", "start", "server.exe")
cmdinstance2.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} // Make it silent.
cmdinstance3 := exec.Command("cmd", "/C", "start", "http://localhost:8100")
cmdinstance3.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} // Make it silent.
cmdoutput, cmderr := cmdinstance.Output()
if cmderr != nil {
fmt.Println(cmderr)
fmt.Println(cmdoutput)
}
cmdoutput2, cmderr2 := cmdinstance2.Output()
if cmderr != nil {
fmt.Println(cmderr2)
fmt.Println(cmdoutput2)
}
cmdoutput3, cmderr3 := cmdinstance3.Output()
if cmderr != nil {
fmt.Println(cmderr3)
fmt.Println(cmdoutput3)
}
}