]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
remove now-unneeded make-windows-installer.sh, re-embed vpnc-script-win.js, embed...
authorDaniel Lenski <dlenski@gmail.com>
Fri, 26 Mar 2021 16:48:38 +0000 (09:48 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Fri, 26 Mar 2021 17:50:17 +0000 (10:50 -0700)
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
.gitignore
Makefile.am
make-windows-installer.sh [deleted file]
openconnect.nsi.in

index a5d3705e95c819f9da0042173bc993877e227d5f..be379a50a1cfc769b8b9649e512888c57ec28fcc 100644 (file)
@@ -60,3 +60,11 @@ Makefile
 test-driver
 tests/*.log
 tests/*.trs
+
+# Leftovers from constructing the Windows installer
+file-list.txt
+*.nsi
+*.nsh
+/openconnect-installer*.exe
+/tap-windows*.exe
+/vpnc-script-win.js
index e8f06a1062c0ced3a385e850b611c5e2c6181c9e..6a04d5e9e4c988d6b346998871f56b2fe2444dc9 100644 (file)
@@ -254,7 +254,7 @@ if BUILD_NSIS
 #
 # The Makefile snippet in each generated file adds the full DLL
 # pathname to $(DLLS), adds the .d file itself to the dependencies of
-# dll-list.txt, and then includes more .d files for each other DLL
+# file-list.txt, and then includes more .d files for each other DLL
 # that this DLL links to.
 #
 # Because we use -include, we just skip any DLLs we can't find, which
@@ -263,29 +263,41 @@ if BUILD_NSIS
 # The result, after manually -including the top-level .openconnect.exe.d,
 # is that we have a full transitive list of required non-system DLLs
 # in the $(DLLS) variable. Which will contain duplicates, hence the
-# use of $(sort) when writing it out to dll-list.txt.
+# use of $(sort) when writing it out to file-list.txt.
 .%.d: .libs/% Makefile
        ( echo "DLLS += $<" ; \
-         echo "dll-list.txt: $@" ; \
+         echo "file-list.txt: $@" ; \
        mingw-objdump -p "$<" | sed -n '/DLL Name:/{s%^.*DLL Name: %-include .%;s/$$/.d/;p}' | tr A-Z a-z ) > $@
 
 .%.d: $(bindir)/% Makefile
        ( echo "DLLS += $<" ; \
-         echo "dll-list.txt: $@" ; \
+         echo "file-list.txt: $@" ; \
        mingw-objdump -p "$<" | sed -n '/DLL Name:/{s%^.*DLL Name: %-include .%;s/$$/.d/;p}' | tr A-Z a-z ) > $@
 
 -include .openconnect.exe.d
 
-dll-list.txt: Makefile
+file-list.txt: Makefile tap-windows-9.21.2.exe vpnc-script-win.js
        for dll in $(sort $(DLLS)); do echo "$${dll}"; done > $@
+       echo "$$PWD/tap-windows-9.21.2.exe" >> $@
+       echo "$$PWD/vpnc-script-win.js" >> $@
+
+# OpenVPN TAP driver for Windows Vista/2003 and newer
+# (see https://community.openvpn.net/openvpn/wiki/GettingTapWindows)
+tap-windows-9.21.2.exe:
+       curl https://build.openvpn.net/downloads/releases/tap-windows-9.21.2.exe -o $@
+       echo "db9d441c209fb28b7c07286a74fe000738304dac $@" | sha1sum -c
+
+# Latest vpnc-script-win.js
+vpnc-script-win.js:
+       curl https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script-win.js -o $@
 
 # Rather than trying to get clever in NSIS and iterate over lists,
 # just emit raw snippets to be included separately in the install
 # and uninstall sections.
-instfiles.nsh: dll-list.txt
+instfiles.nsh: file-list.txt
        sed 's%\(.*\)%File "\1"%' $< | tee $@
 
-uninstfiles.nsh: dll-list.txt
+uninstfiles.nsh: file-list.txt
        sed 's%.*/\(.*\)%Delete /rebootok "$$INSTDIR\\\\\1"%' $< > $@
 
 # Theoretically makensis can define symbols with the -D command line
@@ -306,7 +318,7 @@ openconnect.nsi: version.c
          echo "VIAddVersionKey Comments \"OpenConnect multi-protocol VPN client for Windows (command-line version, built with $$TLS_LIBRARY). For more information, visit http://www.infradead.org/openconnect/\""; \
          echo "!include $(srcdir)/openconnect.nsi.in" ) > $@
 
-openconnect-installer.exe: openconnect.nsi instfiles.nsh uninstfiles.nsh $(srcdir)/openconnect.nsi.in openconnect$(EXEEXT) libopenconnect.la html-recursive
+openconnect-installer.exe: openconnect.nsi instfiles.nsh uninstfiles.nsh $(srcdir)/openconnect.nsi.in openconnect$(EXEEXT) libopenconnect.la html-recursive tap-windows-9.21.2.exe vpnc-script-win.js
        $(MAKENSIS) $<
 
 endif
diff --git a/make-windows-installer.sh b/make-windows-installer.sh
deleted file mode 100755 (executable)
index 34136a6..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2021 Daniel Lenski
-#
-# This builds a Windows installer for OpenConnect using the Fedora nsiswrapper
-# program from https://fedoraproject.org/wiki/MinGW, which in turn depends on
-# NSIS (https://nsis.sourceforge.io).
-#
-# This script should be run *after* successfully cross-building openconnect.exe
-# and libopenconnect-5.dll.
-
-set -e
-
-SYSROOT=/usr/i686-w64-mingw32/sys-root
-
-# only X.Y.Z.W is allowed for the installer's "product version" property
-VERSION=$(cut -f2 -d\" version.c)
-PROD_VERSION=$(echo "$VERSION" | perl -ne 'm|v(\d+)\.(\d+)(?:\-(\d+)-g.+)|; print "$1.$2." . ($3 or "0") . ".0"')
-
-if egrep -q '^#define OPENCONNECT_GNUTLS' config.h; then
-    TLS_LIBRARY=GnuTLS
-elif egrep -q '^#define OPENCONNECT_OPENSSL' config.h; then
-    TLS_LIBRARY=OpenSSL
-else
-    TLS_LIBRARY="Unknown TLS library"
-fi
-
-mkdir nsis
-cd nsis
-
-# build HTML documentation
-make -C ../www update
-ln -s ../public docs
-
-# download latest vpnc-script-win.js
-curl "https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script-win.js" > vpnc-script-win.js
-
-# add symlinks to OpenConnect .exe/.dll, and all DLLs installed by package manager
-# (so that nsiswrapper can find them)
-ln -s ../.libs/openconnect.exe ../.libs/libopenconnect-5.dll $SYSROOT/mingw/{bin,lib}/*.dll .
-
-# build openconnect.nsi (input to makensis)
-PATH="$PATH:." nsiswrapper --name OpenConnect --outfile openconnect-installer.exe \
-    openconnect.exe docs vpnc-script-win.js > openconnect.nsi.in
-
-# add version information
-cat <<EOF > openconnect.nsi
-SetCompressor /FINAL lzma
-VIAddVersionKey ProductName "OpenConnect"
-VIProductVersion "$PROD_VERSION"
-VIAddVersionKey ProductVersion "$VERSION"
-VIAddVersionKey Comments "OpenConnect multi-protocol VPN client for Windows (command-line version, built with $TLS_LIBRARY). For more information, visit https://openconnect.gitlab.io/openconnect"
-EOF
-
-# build installer
-cat openconnect.nsi.in >> openconnect.nsi
-makensis openconnect.nsi
index 5935fe79647d4cb4f4bc7d2e0fbcc67d2326c107..b791cfae2517ad38f786143ca1abf77c6ca15060 100644 (file)
@@ -51,6 +51,24 @@ Section "OpenConnect"
   !include instfiles.nsh
 SectionEnd
 
+Section -prerequisites
+  SectionIn RO
+
+  MessageBox MB_OK \
+    "OpenConnect uses the TAP-Windows driver from OpenVPN to create virtual Ethernet adapters for \
+     VPN connections. If you haven't already installed this driver, you should now install v9.21.2, \
+     which works on Windows 2003, Windows Vista, or newer. \
+     More information on this driver, and available versions, can be found at \
+     https://community.openvpn.net/openvpn/wiki/GettingTapWindows"
+
+  MessageBox MB_YESNO "Install TAP-Windows driver v9.21.2?" /SD IDYES IDNO endTapWindows
+    DetailPrint "Running TAP-Windows driver setup..."
+    ExecWait "$INSTDIR\tap-windows-9.21.2.exe"
+    DetailPrint "Finished TAP-Windows driver setup"
+    Delete /rebootok "$INSTDIR\tap-windows-9.21.2.exe"
+  endTapWindows:
+SectionEnd
+
 Section "Start Menu Shortcuts"
   CreateDirectory "$SMPROGRAMS\OpenConnect"
   CreateShortCut "$SMPROGRAMS\OpenConnect\Uninstall OpenConnect.lnk" "$INSTDIR\Uninstall OpenConnect.exe" "" "$INSTDIR\Uninstall OpenConnect.exe" 0