From e1ff342fcea2fb33adbd6c69dbc99d23d5268f1b Mon Sep 17 00:00:00 2001 From: Josh Mudge Date: Mon, 11 Nov 2019 21:24:15 -0700 Subject: [PATCH] New Broken code --- All/Sign Using OV Cert.md | 4 ++-- All/server.go | 4 ++-- All/setup.go | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/All/Sign Using OV Cert.md b/All/Sign Using OV Cert.md index 40f1915..99cbc35 100644 --- a/All/Sign Using OV Cert.md +++ b/All/Sign Using OV Cert.md @@ -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 diff --git a/All/server.go b/All/server.go index 6baa37e..5312eca 100644 --- a/All/server.go +++ b/All/server.go @@ -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)) } diff --git a/All/setup.go b/All/setup.go index b2931b5..82f47c2 100644 --- a/All/setup.go +++ b/All/setup.go @@ -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) + } }