From d3c7abb7eba8658667b0962cacc6ecd3526fc792 Mon Sep 17 00:00:00 2001
From: kali <kali@win>
Date: Fri, 30 Oct 2020 22:11:20 +0100
Subject: [PATCH] [bug] remove debug console in windows

squashed in this commit: reintroduce the dummy autostart_win implementation that was
removed by mistake. I did not manage to get autostart working in
windows, this is pending to be re-worked. see https://0xacab.org/leap/bitmask-vpn/-/issues/389
---
 bitmask.pro                  |  2 +-
 docs/build.windows.rst       |  3 ---
 gui/build.sh                 |  5 -----
 pkg/bitmask/autostart_win.go | 23 +++++++++++++++++++++++
 4 files changed, 24 insertions(+), 9 deletions(-)
 create mode 100644 pkg/bitmask/autostart_win.go

diff --git a/bitmask.pro b/bitmask.pro
index c9e95c6b..e9b40db4 100644
--- a/bitmask.pro
+++ b/bitmask.pro
@@ -1,7 +1,7 @@
 #TARGET = $$BINARY_NAME
 
 CONFIG += qt staticlib
-windows:CONFIG += console
+windows:CONFIG -= console
 unix:DEBUG:CONFIG += debug
 lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5")
 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
diff --git a/docs/build.windows.rst b/docs/build.windows.rst
index 9ea13602..93e9d419 100644
--- a/docs/build.windows.rst
+++ b/docs/build.windows.rst
@@ -33,9 +33,6 @@ ask again.
 
 adding metadata to binaries
 ---------------------------
-TODO: add metadata properly
-https://github.com/electron/rcedit/releases/tag/v1.1.1
-https://stackoverflow.com/questions/284258/how-do-i-set-the-version-information-for-an-existing-exe-dll
 
 the steps to do release signatures are::
 
diff --git a/gui/build.sh b/gui/build.sh
index 17f76d41..c8433c16 100755
--- a/gui/build.sh
+++ b/gui/build.sh
@@ -58,11 +58,6 @@ function buildGoLib {
         CGO_LDFLAGS="-g -O2 -mmacosx-version-min=$OSX_TARGET"
     fi
 
-    #if [ "$PLATFORM" == "MINGW64_NT-10.0" ]
-    #then
-    #    LDFLAGS="-H windowsgui"
-    #fi
-
     if [ "$XBUILD" == "no" ]
     then
         echo "[+] Building Go library with standard Go compiler"
diff --git a/pkg/bitmask/autostart_win.go b/pkg/bitmask/autostart_win.go
new file mode 100644
index 00000000..51ac0cd4
--- /dev/null
+++ b/pkg/bitmask/autostart_win.go
@@ -0,0 +1,23 @@
+// +build windows
+package bitmask
+
+// Workaround for broken autostart package on windows.
+
+type DummyAutostart struct{}
+
+func (a *DummyAutostart) Disable() error {
+	return nil
+}
+
+func (a *DummyAutostart) Enable() error {
+	return nil
+}
+
+type Autostart interface {
+	Disable() error
+	Enable() error
+}
+
+func NewAutostart(appName string, iconPath string) Autostart {
+	return &DummyAutostart{}
+}
-- 
GitLab