summaryrefslogtreecommitdiff
path: root/branding/templates/windows
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-10-13 19:40:09 +0200
committerkali kaneko (leap communications) <kali@leap.se>2020-10-23 23:21:57 +0200
commite9c95064992bffb331be71a89152bb3f4de763f5 (patch)
treebfb6c575f4aeb7ef8beb28bb36f2baef93bac4b8 /branding/templates/windows
parent93a0668a02b3a280919c4881db9085d5f2a912af (diff)
[pkg] remove unused templates & scripts
Diffstat (limited to 'branding/templates/windows')
-rwxr-xr-xbranding/templates/windows/generate.py44
-rwxr-xr-xbranding/templates/windows/payload/install9
-rwxr-xr-xbranding/templates/windows/payload/uninstall14
-rw-r--r--branding/templates/windows/readme.txt1
-rwxr-xr-xbranding/templates/windows/template.nsi194
5 files changed, 0 insertions, 262 deletions
diff --git a/branding/templates/windows/generate.py b/branding/templates/windows/generate.py
deleted file mode 100755
index 552f1a9..0000000
--- a/branding/templates/windows/generate.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env python3
-"""
-generate.py
-
-Generate a NSI installer for a given provider.
-"""
-
-import json
-import os
-from string import Template
-
-
-TEMPLATE = 'template.nsi'
-
-
-def get_files(which):
- files = "\n"
- if which == 'install':
- action = "File "
- elif which == 'uninstall':
- action = "Delete $INSTDIR\\"
- else:
- action = ""
-
- # TODO get relative path
- for item in open('payload/' + which).readlines():
- files += " {action}{item}".format(
- action=action, item=item)
- return files
-
-
-here = os.path.split(os.path.realpath(__file__))[0]
-data = json.load(open(os.path.join(here, 'data.json')))
-data['extra_install_files'] = get_files('install')
-data['extra_uninstall_files'] = get_files('uninstall')
-
-INSTALLER = data['applicationName'] + '-installer.nsi'
-
-
-template = Template(open(TEMPLATE).read())
-with open(INSTALLER, 'w') as output:
- output.write(template.safe_substitute(data))
-
-print("[+] NSIS installer script written to {path}".format(path=INSTALLER))
diff --git a/branding/templates/windows/payload/install b/branding/templates/windows/payload/install
deleted file mode 100755
index 280703a..0000000
--- a/branding/templates/windows/payload/install
+++ /dev/null
@@ -1,9 +0,0 @@
-..\staging\helper.exe
-..\staging\bitmask-vpn.exe
-..\staging\libcrypto-1_1-x64.dll
-..\staging\liblzo2-2.dll
-..\staging\libpkcs11-helper-1.dll
-..\staging\libssl-1_1-x64.dll
-..\staging\padlock.dll
-..\staging\openvpn\openvpn.exe
-..\staging\openvpn\tap-windows.exe
diff --git a/branding/templates/windows/payload/uninstall b/branding/templates/windows/payload/uninstall
deleted file mode 100755
index bb6cf39..0000000
--- a/branding/templates/windows/payload/uninstall
+++ /dev/null
@@ -1,14 +0,0 @@
-icon.ico
-openssl.exe
-openvpn.exe
-ssleay32.dll
-libeay32.dll
-liblzo2-2.dll
-libpkcs11-helper-1.dll
-libcrypto-1_1-x64.dll
-libssl-1_1-x64.dll
-padlock.dll
-bitmask_helper.exe
-bitmask-vpn.exe
-tap-windows.exe
-helper.exe
diff --git a/branding/templates/windows/readme.txt b/branding/templates/windows/readme.txt
deleted file mode 100644
index a519f1a..0000000
--- a/branding/templates/windows/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-BitmaskVPN for Windows.
diff --git a/branding/templates/windows/template.nsi b/branding/templates/windows/template.nsi
deleted file mode 100755
index ee72009..0000000
--- a/branding/templates/windows/template.nsi
+++ /dev/null
@@ -1,194 +0,0 @@
-!ifdef UNINSTALLER
- !echo "Stage 1: building uninstaller"
- ; we don't care about this installer, in this step we just pick the uninstaller
- ; to be able to sign it.
- OutFile "..\dist\produce-bitmask-uninstaller.exe"
- SetCompress off
-!else
- !echo "Stage 2: building main installer"
- Outfile "..\dist\$applicationName-$version.exe"
- SetCompressor /SOLID lzma
-!endif
-
-!define PRODUCT_PUBLISHER "LEAP Encryption Access Project"
-!include "MUI2.nsh"
-
-Name "$applicationName"
-;TODO make the installdir configurable - and set it in the registry.
-InstallDir "C:\Program Files\$applicationName\"
-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 icon.bmp
-
-!define MUI_ICON "..\assets\icon.ico"
-!define MUI_UNICON "..\assets\icon.ico"
-
-!define MUI_WELCOMEPAGE_TITLE "$applicationName"
-!define MUI_WELCOMEPAGE_TEXT "This will install $applicationName in your computer. $applicationName 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_INSTFILES
-!insertmacro MUI_PAGE_FINISH
-
-
-
-Section "InstallFiles"
- ; first we try to delete the helper (it can be the old one or a previous version of the new one)
- DetailPrint "Trying to uninstall new helper..."
- IfFileExists $INSTDIR\helper.exe 0 +4
- ExecWait '"$INSTDIR\helper.exe" stop'
- ExecWait '"$INSTDIR\helper.exe" remove'
- Delete 'C:\Program Files\$applicationName\helper.exe'
-
- ; uninstalling old nssm helper - could fail if it isn't there, or if nssm is not there...
- ClearErrors
- DetailPrint "Trying to uninstall an old style helper..."
- IfFileExists $INSTDIR\bitmask_helper.exe 0 +8
- ExecWait '"$INSTDIR\nssm.exe" stop $applicationNameLower-helper'
- ExecWait '"$INSTDIR\nssm.exe" remove $applicationNameLower-helper confirm'
- ClearErrors
- Sleep 1000
- Delete 'C:\Program Files\$applicationName\bitmask_helper.exe'
- IfErrors 0 +2
- DetailPrint "Failed to delete nssm-style helper, maybe it was not there"
-
- ; let's try to stop it in case it's the new style helper -- we need to do it to be able to overwrite it.
- ; we don't care about errors because if we're upgrading from 0.20.1 this will not work.
- ClearErrors
- DetailPrint "Trying to uninstall a new style helper..."
- IfFileExists $INSTDIR\bitmask_helper.exe 0 +4
- Exec '"$INSTDIR\bitmask_helper.exe" stop'
- IfErrors 0 noErrorHelper
- DetailPrint "old-style bitmask_helper.exe not present"
- GoTo +2
- DetailPrint "cannot stop old-style bitmask_helper.exe"
- noErrorHelper:
-
- ; now we try to delete the systray, locked by the app - just to know if another instance of FoobarVPN is running.
- ClearErrors
- DetailPrint "Checking for a running systray..."
-
- Delete 'C:\Program Files\$applicationName\bitmask-vpn.exe'
- IfErrors 0 noDelError
-
- ; Error handling
- MessageBox MB_OK|MB_ICONEXCLAMATION "$applicationName is Running. Please close it, and then run this installer again."
- Abort
-
- noDelError:
-
- SetOutPath $INSTDIR
-
- ; Add ourselves to Add/remove programs
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$applicationNameLower" "DisplayName" "$applicationName"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$applicationNameLower" "UninstallString" '"$INSTDIR\uninstall.exe"'
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$applicationNameLower" "InstallLocation" "$INSTDIR"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$applicationNameLower" "DisplayIcon" "$INSTDIR\icon.ico"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$applicationNameLower" "Readme" "$INSTDIR\readme.txt"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$applicationNameLower" "DisplayVersion" "$version"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$applicationNameLower" "Publisher" "LEAP Encryption Access Project"
- WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$applicationNameLower" "NoModify" 1
- WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$applicationNameLower" "NoRepair" 1
-
- ;Start Menu
- createDirectory "$SMPROGRAMS\$applicationName\"
- createShortCut "$SMPROGRAMS\$applicationName\$applicationName.lnk" "$INSTDIR\bitmask-vpn.exe" "" "$INSTDIR\icon.ico"
-
- File "readme.txt"
- File "uninstall.exe"
- File "/oname=icon.ico" "..\assets\icon.ico"
-
- $extra_install_files
-
-SectionEnd
-
-Section "InstallService"
- DetailPrint "Trying to uninstall previous versions of the (new) helper..."
- ClearErrors
- ExecWait '"$INSTDIR\helper.exe" stop'
- ExecWait '"$INSTDIR\helper.exe" remove'
- IfErrors 0 noError
- DetailPrint "Could not uninstall a previous version of the (new) helper!"
-
- noError:
- ExecWait '"$INSTDIR\helper.exe" install'
- ExecWait '"$INSTDIR\helper.exe" start'
-SectionEnd
-
-Section /o "TAP Virtual Ethernet Adapter" SecTAP
- ; TODO bringing the TAP adapter with us might be causing trouble with the fucking A/V mafia.
- ; we might want to reconsider, and possibly downloading it from official sources...
- ; Adapted from the windows nsis installer from OpenVPN (openvpn-build repo).
- DetailPrint "Installing TAP (may need confirmation)..."
- ; The /S flag make it "silent", remove it if you want it explicit
- ExecWait '"$INSTDIR\tap-windows.exe" /S /SELECT_UTILITIES=1'
- Pop $R0 # return value/error/timeout
- WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$applicationName" "tap" "installed"
- DetailPrint "TAP installed!"
-SectionEnd
-
-!ifdef UNINSTALLER
-; this section should not be in the main installer, because it will cause warnings.
-Section "Uninstall"
- ; we uninstall the new-style go helper
- ExecWait '"$INSTDIR\bitmask_helper.exe" stop'
- ExecWait '"$INSTDIR\bitmask_helper.exe" remove'
-
- ExecWait '"$INSTDIR\helper.exe" stop'
- ExecWait '"$INSTDIR\helper.exe" remove'
-
- ; now we (try to) remove everything else. kill it with fire!
- Delete $INSTDIR\nssm.exe ; probably does not exist anymore, but just in case
- Delete $INSTDIR\readme.txt
- Delete $INSTDIR\helper.log
- Delete $INSTDIR\openvpn.log
- Delete $INSTDIR\port
- Delete "$SMPROGRAMS\$applicationName\$applicationName.lnk"
- RMDir "$SMPROGRAMS\$applicationName\"
-
- $extra_uninstall_files
-
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$applicationNameLower"
- ; uninstaller must be always the last thing to remove
- Delete $INSTDIR\uninstall.exe
- RMDir $INSTDIR
-SectionEnd
-!endif
-
-Function .onInit
-!ifdef UNINSTALLER
- ; If UNINSTALLER is defined, then we don't do anything execpt write out the uninstaller.
- SetSilent silent
- WriteUninstaller "c:\bitmask-uninstall.exe"
- Quit ; bail out quickly when running the UNINSTALLER stage.
-!else
- !insertmacro SelectByParameter ${SecTAP} SELECT_TAP 1
-!endif
-FunctionEnd
-
-;----------------------------------------
-;Languages
-
-!insertmacro MUI_LANGUAGE "English"