summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali <kali@win>2018-07-03 01:52:06 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2018-07-03 01:59:58 +0200
commitebe388f57a4f39748f4814b7d37544bcd8f76afc (patch)
treea97689535431ed85419331ca9f0a97cdd42d8a84
parentade90be44d10cad7f43fd89130bb99b019f6545e (diff)
add tap-installer
-rwxr-xr-xMakefile7
-rwxr-xr-xwin/RiseupVPN-installer.nsi83
-rwxr-xr-xwin/payload/install3
-rwxr-xr-xwin/payload/uninstall1
-rwxr-xr-xwin/template.nsi73
5 files changed, 92 insertions, 75 deletions
diff --git a/Makefile b/Makefile
index 3700872..3a6cebe 100755
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,8 @@ deps_win:
choco install -y golang python upx nssm nsis wget 7zip
openvpn_win:
mkdir staging\openvpn
+ wget https://build.openvpn.net/downloads/releases/latest/tap-windows-latest-stable.exe -O staging/openvpn/tap-windows.exe
+ # eventually, this should be built statically and cross compiled in the same pipeline that we build the installer.
wget https://downloads.leap.se/thirdparty/windows/openvpn-x86_64-w64-mingw32.tar.bz2 -O staging/openvpn/openvpn.tar.bz2
7z e -y -ostaging/openvpn/ staging/openvpn/openvpn.tar.bz2
7z e -y -r -ostaging/openvpn/ staging/openvpn/openvpn.tar *.dll
@@ -18,11 +20,12 @@ systray_win:
go get -u $(SYSTRAY)
go build -tags "standalone" -ldflags "-H windowsgui -s -w" -o $(STAGING)/bitmask-systray.exe $(SYSTRAY)
build_win: helper_win systray_win
+ # since it's tedious, I assume you did bootstrap openvpn_win manually already.
echo "[+] building windows"
if not exist dist mkdir dist
make -C win
"C:\Program Files (x86)\NSIS\makensis.exe" win/RiseupVPN-installer.nsi
build_osx:
- echo "[+] building osx"
+ echo "[+] building osx..."
build_snap:
- echo "[+] building snap"
+ echo "[+] building snap..."
diff --git a/win/RiseupVPN-installer.nsi b/win/RiseupVPN-installer.nsi
index e1fc135..5c17018 100755
--- a/win/RiseupVPN-installer.nsi
+++ b/win/RiseupVPN-installer.nsi
@@ -1,4 +1,7 @@
-!include "MUI.nsh"
+SetCompressor /SOLID lzma
+
+!define PRODUCT_PUBLISHER "LEAP Encryption Access Project"
+!include "MUI2.nsh"
Name "RiseupVPN"
Outfile "..\dist\RiseupVPN-installer.exe"
@@ -6,53 +9,40 @@ Outfile "..\dist\RiseupVPN-installer.exe"
InstallDir "C:\Program Files\RiseupVPN\"
RequestExecutionLevel admin
+!include FileFunc.nsh
+!insertmacro GetParameters
+!insertmacro GetOptions
+
+;Macros
+
+!macro SelectByParameter SECT PARAMETER DEFAULT
+ ${GetOptions} $R0 "/${PARAMETER}=" $0
+ ${If} ${DEFAULT} == 0
+ ${If} $0 == 1
+ !insertmacro SelectSection ${SECT}
+ ${EndIf}
+ ${Else}
+ ${If} $0 != 0
+ !insertmacro SelectSection ${SECT}
+ ${EndIf}
+ ${EndIf}
+!macroend
+
!define BITMAP_FILE riseupvpn.bmp
-!define MUI_PAGE_CUSTOMFUNCTION_PRE WelcomePageSetupLinkPre
-!define MUI_PAGE_CUSTOMFUNCTION_SHOW WelcomePageSetupLinkShow
!define MUI_ICON "..\assets\riseupvpn.ico"
!define MUI_UNICON "..\assets\riseupvpn.ico"
!define MUI_WELCOMEPAGE_TITLE "RiseupVPN"
-!define MUI_WELCOMEPAGE_TEXT "This will install RiseupVPN in your computer. RiseupVPN is a simple VPN Client, powered by Bitmask."
+!define MUI_WELCOMEPAGE_TEXT "This will install RiseupVPN in your computer. RiseupVPN is a simple, fast and secure VPN Client, powered by Bitmask. \n This VPN service is run by donations from people like you."
#!define MUI_WELCOMEFINISHPAGE_BITMAP "riseup.png"
!insertmacro MUI_PAGE_WELCOME
-#!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
-Function WelcomePageSetupLinkPre
- File "..\assets\riseupvpn.png"
- File "..\assets\riseupvpn.ico"
-
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "Numfields" "4" ; increase counter
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "122" ; limit size of the upper label
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Type" "Link"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Text" "https://riseup.net"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "State" "https://riseup.net"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Left" "120"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Right" "315"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "123"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "132"
-FunctionEnd
-
-Function WelcomePageSetupLinkShow
- ; Thanks to pengyou
- ; Fix colors of added link control
- ; See http://forums.winamp.com/showthread.php?s=&threadid=205674
- Push $0
-
- GetDlgItem $0 $MUI_HWND 1203
- SetCtlColors $0 "0000FF" "FFFFFF"
- ; underline font
- CreateFont $1 "$(^Font)" "$(^FontSize)" "400" /UNDERLINE
- SendMessage $0 ${WM_SETFONT} $1 1
- Pop $0
-
-FunctionEnd
Section "InstallFiles"
SetOutPath $INSTDIR
@@ -69,12 +59,13 @@ Section "InstallFiles"
File ..\staging\bitmask_helper.exe
File ..\staging\bitmask-systray.exe
- File ..\staging\openssl.exe
- File ..\staging\openvpn.exe
- File ..\staging\ssleay32.dll
- File ..\staging\libeay32.dll
+ File ..\staging\libcrypto-1_1-x64.dll
File ..\staging\liblzo2-2.dll
File ..\staging\libpkcs11-helper-1.dll
+ File ..\staging\libssl-1_1-x64.dll
+ File ..\staging\padlock.dll
+ File ..\staging\openvpn\openvpn.exe
+ File ..\staging\openvpn\tap-windows.exe
SectionEnd
@@ -91,6 +82,17 @@ Section "InstallService"
Delete "C:\riseupvpn.png"
SectionEnd
+Section /o "TAP Virtual Ethernet Adapter" SecTAP
+ ; Adapted from the windows nsis installer from OpenVPN (openvpn-build repo).
+ DetailPrint "Installing TAP (may need confirmation)..."
+ ExecWait '"$INSTDIR\tap-windows.exe" /SELECT_UTILITIES=1'
+ ;Making it explicit for now. It looks like the /S flag is "silent", isn't it?
+ ;ExecWait '"$INSTDIR\tap-windows.exe" /S /SELECT_UTILITIES=1'
+ Pop $R0 # return value/error/timeout
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\RiseupVPN" "tap" "installed"
+ DetailPrint "TAP installed!"
+SectionEnd
+
Section "Uninstall"
ExecWait '"$INSTDIR"\nssm.exe stop riseupvpn-helper'
ExecWait '"$INSTDIR"\nssm.exe remove riseupvpn-helper confirm'
@@ -108,12 +110,17 @@ Section "Uninstall"
Delete $INSTDIR\libpkcs11-helper-1.dll
Delete $INSTDIR\bitmask_helper.exe
Delete $INSTDIR\bitmask-systray.exe
+ Delete $INSTDIR\tap-windows.exe
; uninstaller must be always the last thing to remove
Delete $INSTDIR\uninstall.exe
SectionEnd
+Function .onInit
+ !insertmacro SelectByParameter ${SecTAP} SELECT_TAP 1
+FunctionEnd
+
;----------------------------------------
;Languages
diff --git a/win/payload/install b/win/payload/install
index 465491d..637c24c 100755
--- a/win/payload/install
+++ b/win/payload/install
@@ -4,5 +4,6 @@
..\staging\liblzo2-2.dll
..\staging\libpkcs11-helper-1.dll
..\staging\libssl-1_1-x64.dll
-..\staging\openvpn.exe
..\staging\padlock.dll
+..\staging\openvpn\openvpn.exe
+..\staging\openvpn\tap-windows.exe
diff --git a/win/payload/uninstall b/win/payload/uninstall
index ad3c6b4..d12d525 100755
--- a/win/payload/uninstall
+++ b/win/payload/uninstall
@@ -7,3 +7,4 @@ liblzo2-2.dll
libpkcs11-helper-1.dll
bitmask_helper.exe
bitmask-systray.exe
+tap-windows.exe
diff --git a/win/template.nsi b/win/template.nsi
index 7870606..1abe472 100755
--- a/win/template.nsi
+++ b/win/template.nsi
@@ -1,4 +1,7 @@
-!include "MUI.nsh"
+SetCompressor /SOLID lzma
+
+!define PRODUCT_PUBLISHER "LEAP Encryption Access Project"
+!include "MUI2.nsh"
Name "$app_name"
Outfile "..\dist\$app_name-installer.exe"
@@ -6,53 +9,40 @@ Outfile "..\dist\$app_name-installer.exe"
InstallDir "C:\Program Files\$app_name\"
RequestExecutionLevel admin
+!include FileFunc.nsh
+!insertmacro GetParameters
+!insertmacro GetOptions
+
+;Macros
+
+!macro SelectByParameter SECT PARAMETER DEFAULT
+ ${GetOptions} $R0 "/${PARAMETER}=" $0
+ ${If} ${DEFAULT} == 0
+ ${If} $0 == 1
+ !insertmacro SelectSection ${SECT}
+ ${EndIf}
+ ${Else}
+ ${If} $0 != 0
+ !insertmacro SelectSection ${SECT}
+ ${EndIf}
+ ${EndIf}
+!macroend
+
!define BITMAP_FILE riseupvpn.bmp
-!define MUI_PAGE_CUSTOMFUNCTION_PRE WelcomePageSetupLinkPre
-!define MUI_PAGE_CUSTOMFUNCTION_SHOW WelcomePageSetupLinkShow
!define MUI_ICON "..\assets\$app_name_lower.ico"
!define MUI_UNICON "..\assets\$app_name_lower.ico"
!define MUI_WELCOMEPAGE_TITLE "$app_name"
-!define MUI_WELCOMEPAGE_TEXT "This will install $app_name in your computer. $app_name is a simple VPN Client, powered by Bitmask."
+!define MUI_WELCOMEPAGE_TEXT "This will install $app_name in your computer. $app_name is a simple, fast and secure VPN Client, powered by Bitmask. \n This VPN service is run by donations from people like you."
#!define MUI_WELCOMEFINISHPAGE_BITMAP "riseup.png"
!insertmacro MUI_PAGE_WELCOME
-#!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
-Function WelcomePageSetupLinkPre
- File "..\assets\$app_name_lower.png"
- File "..\assets\$app_name_lower.ico"
-
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "Numfields" "4" ; increase counter
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "122" ; limit size of the upper label
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Type" "Link"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Text" "$url"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "State" "$url"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Left" "120"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Right" "315"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "123"
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "132"
-FunctionEnd
-
-Function WelcomePageSetupLinkShow
- ; Thanks to pengyou
- ; Fix colors of added link control
- ; See http://forums.winamp.com/showthread.php?s=&threadid=205674
- Push $0
-
- GetDlgItem $0 $MUI_HWND 1203
- SetCtlColors $0 "0000FF" "FFFFFF"
- ; underline font
- CreateFont $1 "$(^Font)" "$(^FontSize)" "400" /UNDERLINE
- SendMessage $0 ${WM_SETFONT} $1 1
- Pop $0
-
-FunctionEnd
Section "InstallFiles"
SetOutPath $INSTDIR
@@ -82,6 +72,17 @@ Section "InstallService"
Delete "C:\$app_name_lower.png"
SectionEnd
+Section /o "TAP Virtual Ethernet Adapter" SecTAP
+ ; Adapted from the windows nsis installer from OpenVPN (openvpn-build repo).
+ DetailPrint "Installing TAP (may need confirmation)..."
+ ExecWait '"$INSTDIR\tap-windows.exe" /SELECT_UTILITIES=1'
+ ;Making it explicit for now. It looks like the /S flag is "silent", isn't it?
+ ;ExecWait '"$INSTDIR\tap-windows.exe" /S /SELECT_UTILITIES=1'
+ Pop $R0 # return value/error/timeout
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$app_name" "tap" "installed"
+ DetailPrint "TAP installed!"
+SectionEnd
+
Section "Uninstall"
ExecWait '"$INSTDIR"\nssm.exe stop $app_name_lower-helper'
ExecWait '"$INSTDIR"\nssm.exe remove $app_name_lower-helper confirm'
@@ -95,6 +96,10 @@ Section "Uninstall"
Delete $INSTDIR\uninstall.exe
SectionEnd
+Function .onInit
+ !insertmacro SelectByParameter ${SecTAP} SELECT_TAP 1
+FunctionEnd
+
;----------------------------------------
;Languages