Not optimal, but workable.
This commit is contained in:
parent
e1ff342fce
commit
ccd254cd99
|
@ -47,10 +47,11 @@ func main() {
|
||||||
//Create firewall rule
|
//Create firewall rule
|
||||||
cmdinstance := exec.Command("powershell.exe", "-WindowStyle", "Hidden", "-Command", "New-NetFirewallRule", "-DisplayName", "'Go Web Server'", "-Direction", "Inbound", file, "-Action", "Allow")
|
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.
|
cmdinstance.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} // Make it silent.
|
||||||
cmdinstance2 := exec.Command("start", "cmd", "/C", "start", "server.exe")
|
cmdinstance2 := exec.Command("cmd", "/C", "start", "http://localhost:8100")
|
||||||
cmdinstance2.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} // Make it silent.
|
cmdinstance2.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} // Make it silent.
|
||||||
cmdinstance3 := exec.Command("cmd", "/C", "start", "http://localhost:8100")
|
cmdinstance3 := exec.Command("cmd", "start", "server.exe")
|
||||||
cmdinstance3.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} // Make it silent.
|
cmdinstance3.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} // Make it silent.
|
||||||
|
|
||||||
cmdoutput, cmderr := cmdinstance.Output()
|
cmdoutput, cmderr := cmdinstance.Output()
|
||||||
if cmderr != nil {
|
if cmderr != nil {
|
||||||
fmt.Println(cmderr)
|
fmt.Println(cmderr)
|
||||||
|
|
Loading…
Reference in New Issue