summaryrefslogtreecommitdiff
path: root/icon/make_icon.bat
diff options
context:
space:
mode:
Diffstat (limited to 'icon/make_icon.bat')
-rw-r--r--icon/make_icon.bat41
1 files changed, 41 insertions, 0 deletions
diff --git a/icon/make_icon.bat b/icon/make_icon.bat
new file mode 100644
index 0000000..598deca
--- /dev/null
+++ b/icon/make_icon.bat
@@ -0,0 +1,41 @@
+@ECHO OFF
+
+IF "%GOPATH%"=="" GOTO NOGO
+IF NOT EXIST %GOPATH%\bin\2goarray.exe GOTO INSTALL
+:POSTINSTALL
+call :create_go on On
+call :create_go off Off
+call :create_go blocked Blocked
+call :create_go wait_0 Wait0
+call :create_go wait_1 Wait1
+call :create_go wait_2 Wait2
+call :create_go wait_3 Wait3
+GOTO DONE
+
+:create_go
+ECHO Creating %1_win.go
+ECHO //+build windows > %1_win.go
+ECHO. >> %1_win.go
+TYPE ico\black\vpn_%1.ico | %GOPATH%\bin\2goarray %2 icon >> %1_win.go
+EXIT /B
+
+:CREATEFAIL
+ECHO Unable to create output file
+GOTO DONE
+
+:INSTALL
+ECHO Installing 2goarray...
+go get github.com/cratonica/2goarray
+IF ERRORLEVEL 1 GOTO GETFAIL
+GOTO POSTINSTALL
+
+:GETFAIL
+ECHO Failure running go get github.com/cratonica/2goarray. Ensure that go and git are in PATH
+GOTO DONE
+
+:NOGO
+ECHO GOPATH environment variable not set
+GOTO DONE
+
+:DONE
+