Browse Source

Not optimal, but workable.

master
Josh Mudge 5 years ago
parent
commit
ccd254cd99
  1. 7
      All/setup.go

7
All/setup.go

@ -47,10 +47,11 @@ 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")
cmdinstance2 := exec.Command("cmd", "/C", "start", "http://localhost:8100")
cmdinstance2.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} // Make it silent.
cmdinstance3 := exec.Command("cmd", "start", "server.exe")
cmdinstance3.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} // Make it silent.
cmdoutput, cmderr := cmdinstance.Output()
if cmderr != nil {
fmt.Println(cmderr)

Loading…
Cancel
Save