summaryrefslogtreecommitdiffstats
path: root/install-win32
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2007-04-25 21:37:49 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2007-04-25 21:37:49 +0000
commit657ecf14acc58a6d345341a5e36411bde5be9cd9 (patch)
tree4f5a53feb9c26991d822e2e606de511f57e32be6 /install-win32
parent8edd43829bd7c47f5c5fa809b26a7de7ac4ded08 (diff)
downloadopenvpn-657ecf14acc58a6d345341a5e36411bde5be9cd9.tar.gz
openvpn-657ecf14acc58a6d345341a5e36411bde5be9cd9.tar.xz
openvpn-657ecf14acc58a6d345341a5e36411bde5be9cd9.zip
TAP driver now passes signing tests on Vista x64.
Added new settings to settings.in to better control build process. Removed some unneeded JYFIXMEs from source code. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1874 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'install-win32')
-rw-r--r--install-win32/buildinstaller4
-rw-r--r--install-win32/dosname.pl11
-rw-r--r--install-win32/getgui21
-rw-r--r--install-win32/ifdef.pl53
-rw-r--r--install-win32/m4todef.pl2
-rw-r--r--install-win32/macro.pl49
-rw-r--r--install-win32/makebin8
-rw-r--r--install-win32/maketap45
-rwxr-xr-xinstall-win32/openvpn.nsi183
-rw-r--r--install-win32/settings.in58
-rw-r--r--install-win32/signinstaller16
-rw-r--r--install-win32/signtap50
-rw-r--r--install-win32/trans.pl16
-rw-r--r--install-win32/winconfig19
14 files changed, 311 insertions, 224 deletions
diff --git a/install-win32/buildinstaller b/install-win32/buildinstaller
index 74902f7..fb8e968 100644
--- a/install-win32/buildinstaller
+++ b/install-win32/buildinstaller
@@ -3,4 +3,6 @@
# build the installer
cd install-win32
-'/c/Program Files/NSIS/makensis' openvpn.nsi
+rm -f *.exe
+'/c/Program Files/NSIS/makensis' openvpn.nsi &>makensis.log
+tail -20 makensis.log
diff --git a/install-win32/dosname.pl b/install-win32/dosname.pl
index c29d134..5bfa6b9 100644
--- a/install-win32/dosname.pl
+++ b/install-win32/dosname.pl
@@ -1,4 +1,7 @@
-($unixname) = @ARGV;
-$unixname =~ s#^/c##g;
-$unixname =~ s#/#\\#g;
-print "$unixname\n";
+#!/usr/bin/perl
+
+while ($unixname = shift(@ARGV)) {
+ $unixname =~ s#^/([a-zA-Z])(/|$)#$1:\\#g;
+ $unixname =~ s#/#\\#g;
+ print "$unixname\n";
+}
diff --git a/install-win32/getgui b/install-win32/getgui
new file mode 100644
index 0000000..1419bc9
--- /dev/null
+++ b/install-win32/getgui
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Get and sign the OpenVPN GUI
+
+c=`pwd`
+
+# load version.nsi definitions
+. autodefs/defs.sh
+
+GUI="$OPENVPN_GUI_DIR/$OPENVPN_GUI"
+
+if [ -e "$GUI" ]; then
+ cp $GUI bin
+ echo '!define OPENVPN_GUI_DEFINED' >autodefs/guidefs.nsi
+ if [ -d "$SIGNTOOL" ]; then
+ export TARGET_EXE="bin/$OPENVPN_GUI"
+ $SIGNTOOL/signexe
+ fi
+else
+ cat /dev/null >autodefs/guidefs.nsi
+fi
diff --git a/install-win32/ifdef.pl b/install-win32/ifdef.pl
new file mode 100644
index 0000000..d240ebb
--- /dev/null
+++ b/install-win32/ifdef.pl
@@ -0,0 +1,53 @@
+#!/usr/bin/perl
+
+# Simple ifdef/else/endif processor.
+
+die "usage: ifdef [-C<command-prefix>] [-Dname ...] [control-file ...] " if (@ARGV[0] =~ /^(-h|--help)$/);
+
+%Parms = ();
+
+$pre = "!";
+while ($arg=shift(@ARGV)) {
+ if ($arg =~ /^-/) {
+ if ($arg =~ /^-D(\w+)$/) {
+ $Parms{$1} = 1;
+ } elsif ($arg =~ /-C(.*)$/) {
+ $pre = $1;
+ } else {
+ die "unrecognized option: $arg";
+ }
+ } else {
+ open(CONTROL, "< $arg") or die "cannot open $arg";
+ while (<CONTROL>) {
+ if (/^!define\s+(\w+)/) {
+ $Parms{$1} = 1;
+ }
+ }
+ }
+}
+
+sub ifdef {
+ my ($var, $enabled) = @_;
+ my $def = 0;
+ $def = 1 if (defined $Parms{$var}) || ($var eq "true");
+ $def = 0 if $var eq "false";
+ while (<STDIN>) {
+ if (/^\s*\Q$pre\Eifdef\s+(\w+)\s*$/) {
+ return 1 if ifdef ($1, $def & $enabled);
+ } elsif (/^\s*\Q$pre\Eelseif\s+(\w+)\s*$/) {
+ $def = $def ^ 1;
+ return ifdef ($1, $def & $enabled);
+ } elsif (/^\s*\Q$pre\Eelse\s*$/) {
+ $def = $def ^ 1;
+ } elsif (/^\s*\Q$pre\Eendif\s*$/) {
+ return 0;
+ } elsif (/^\s*\Q$pre\E/) {
+ die "unrecognized command: $_";
+ } else {
+ print if $def && $enabled;
+ }
+ }
+ return 1;
+}
+
+ifdef("true", 1);
diff --git a/install-win32/m4todef.pl b/install-win32/m4todef.pl
index c4f0409..d2705b0 100644
--- a/install-win32/m4todef.pl
+++ b/install-win32/m4todef.pl
@@ -8,7 +8,7 @@ while (<STDIN>) {
if (/^\s*$/) {
print "\n";
} elsif (/^define\((\w+),\[(.*?)\]\)/) {
- print "define $1 \"$2\"\n";
+ print "!define $1 \"$2\"\n";
} elsif (/^dnl(.*)$/) {
print "#$1\n";
}
diff --git a/install-win32/macro.pl b/install-win32/macro.pl
index 4705310..08ba58a 100644
--- a/install-win32/macro.pl
+++ b/install-win32/macro.pl
@@ -15,38 +15,47 @@ $open_quote = "@@";
$close_quote = "@@";
while ($arg=shift(@ARGV)) {
- if ($arg =~ /^-/) {
- if ($arg =~ /^-D(\w+)=(.*)$/) {
- $Parms{$1} = $2
- } elsif ($arg =~ /-O(.*)$/) {
- $open_quote = $1;
- } elsif ($arg =~ /-C(.*)$/) {
- $close_quote = $1;
- } else {
- die "unrecognized option: $arg";
- }
+ if ($arg =~ /^-/) {
+ if ($arg =~ /^-D(\w+)(?:=(.*))?$/) {
+ $Parms{$1} = $2
+ } elsif ($arg =~ /-O(.*)$/) {
+ $open_quote = $1;
+ } elsif ($arg =~ /-C(.*)$/) {
+ $close_quote = $1;
} else {
- open(CONTROL, "< $arg") or die "cannot open $arg";
- while (<CONTROL>) {
- chomp;
- if (/^define\s+(\w+)\s+['"]?(.+?)['"]?\s*$/) {
- $Parms{$1} = $2
- }
- }
+ die "unrecognized option: $arg";
}
+ } else {
+ open(CONTROL, "< $arg") or die "cannot open $arg";
+ while (<CONTROL>) {
+ if (/^!define\s+(\w+)(?:\s+['"]?(.*?)['"]?)?\s*$/) {
+ $Parms{$1} = $2;
+ }
+ }
+ }
+}
+
+sub print_symbol_table {
+ foreach my $k (sort (keys(%Parms))) {
+ my $v = $Parms{$k};
+ print "[$k] -> \"$v\"\n";
+ }
}
+#print_symbol_table ();
+#exit 0;
+
while (<STDIN>) {
s{
\Q$open_quote\E
\s*
(
- \w+
- )
+ \w+
+ )
\s*
\Q$close_quote\E
}{
$Parms{$1}
- }xge;
+ }xge;
print;
}
diff --git a/install-win32/makebin b/install-win32/makebin
index 0e26fe3..777c327 100644
--- a/install-win32/makebin
+++ b/install-win32/makebin
@@ -9,12 +9,12 @@ rm -rf bin
mkdir bin
# Get OpenVPN executable
-cp openvpn.exe bin
-strip bin/openvpn.exe
+cp $PRODUCT_UNIX_NAME.exe bin
+strip bin/$PRODUCT_UNIX_NAME.exe
# Get OpenVPN service
-cp service-win32/openvpnserv.exe bin
-strip bin/openvpnserv.exe
+cp service-win32/${PRODUCT_UNIX_NAME}serv.exe bin
+strip bin/${PRODUCT_UNIX_NAME}serv.exe
# Get OpenSSL binaries
for f in libeay32.dll libssl32.dll openssl.exe ; do
diff --git a/install-win32/maketap b/install-win32/maketap
index c3a9f26..3082db7 100644
--- a/install-win32/maketap
+++ b/install-win32/maketap
@@ -6,25 +6,52 @@
# get version.nsi definitions
. autodefs/defs.sh
-amdtarget=""
-if [ -z "$TAP_BIN_AMD64" ]; then
+if [ -n "$PRODUCT_TAP_DEBUG" ] ; then
+ w2ktarget="w2k c"
+ amdtarget="chk AMD64 WNET"
+else
+ w2ktarget="w2k f"
amdtarget="fre AMD64 WNET"
fi
if [ -z "$DRVBINSRC" ] ; then
+ if [ -n "$TAP_BIN_AMD64" ]; then
+ amdtarget=""
+ fi
+
cd tap-win32
t=`pwd`
cd ..
- for mode in "w2k f" "$amdtarget"; do
+ for mode in "$w2ktarget" "$amdtarget"; do
echo '**********' build TAP $mode
cmd //c "C:\\WINDDK\\$DDKVER\\bin\\setenv.bat C:\\WINDDK\\$DDKVER $mode && cd `perl install-win32/dosname.pl $t` && build -cef"
done
-fi
-if [ -n "$TAP_BIN_AMD64" ]; then
- mkdir -p $t/amd64
- cp "$TAP_BIN_AMD64" $t/amd64
-fi
+ title openvpn-build &>/dev/null
-title openvpn-build &>/dev/null
+ if [ -n "$TAP_BIN_AMD64" ]; then
+ mkdir -p $t/amd64
+ cp "$TAP_BIN_AMD64" $t/amd64
+ fi
+
+ # copy driver files into tap-win32/dist
+ cd tap-win32
+ rm -rf dist
+ mkdir dist
+ cd dist
+ mkdir i386
+ mkdir amd64
+ cd i386
+ x86=`pwd`
+ cd ../amd64
+ x64=`pwd`
+ cd ../..
+ cp i386/OemWin2k.inf $x86
+ cp i386/*.sys $x86
+ cp amd64/OemWin2k.inf $x64
+ cp amd64/*.sys $x64
+ out="TAP driver catalog file is undefined";
+ echo "$out" >$x86/$PRODUCT_TAP_ID.cat
+ echo "$out" >$x64/$PRODUCT_TAP_ID.cat
+fi
diff --git a/install-win32/openvpn.nsi b/install-win32/openvpn.nsi
index 535b9c8..275cb19 100755
--- a/install-win32/openvpn.nsi
+++ b/install-win32/openvpn.nsi
@@ -10,16 +10,22 @@
!define HOME ".."
!include "${HOME}\autodefs\defs.nsi"
+!include "${HOME}\autodefs\guidefs.nsi"
!include "MUI.nsh"
!include "setpath.nsi"
!include "GetWindowsVersion.nsi"
!define BIN "${HOME}\bin"
-!define PRODUCT_NAME "OpenVPN"
+!define PRODUCT_ICON "icon.ico"
+
+!ifdef PRODUCT_TAP_DEBUG
+!define VERSION "${PRODUCT_VERSION}-DBG"
+!else
!define VERSION "${PRODUCT_VERSION}"
+!endif
-!define TAP "tap0901"
+!define TAP "${PRODUCT_TAP_ID}"
!define TAPDRV "${TAP}.sys"
; something like "-DBG2"
@@ -30,8 +36,8 @@
; Default service settings
!define SERV_CONFIG_DIR "$INSTDIR\config"
-!define SERV_CONFIG_EXT "ovpn"
-!define SERV_EXE_PATH "$INSTDIR\bin\openvpn.exe"
+!define SERV_CONFIG_EXT "${PRODUCT_FILE_EXT}"
+!define SERV_EXE_PATH "$INSTDIR\bin\${PRODUCT_UNIX_NAME}.exe"
!define SERV_LOG_DIR "$INSTDIR\log"
!define SERV_PRIORITY "NORMAL_PRIORITY_CLASS"
!define SERV_LOG_APPEND "0"
@@ -41,7 +47,7 @@
;General
- OutFile "openvpn-${VERSION}${OUTFILE_LABEL}-install.exe"
+ OutFile "${PRODUCT_UNIX_NAME}-${VERSION}${OUTFILE_LABEL}-install.exe"
SetCompressor bzip2
@@ -59,17 +65,17 @@
Name "${PRODUCT_NAME} ${VERSION} ${TITLE_LABEL}"
- !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of OpenVPN, an Open Source VPN package by James Yonan.\r\n\r\nNote that the Windows version of OpenVPN will only run on Win 2000, XP, or higher.\r\n\r\n\r\n"
+ !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${PRODUCT_NAME}, an Open Source VPN package by James Yonan.\r\n\r\nNote that the Windows version of ${PRODUCT_NAME} will only run on Win 2000, XP, or higher.\r\n\r\n\r\n"
- !define MUI_COMPONENTSPAGE_TEXT_TOP "Select the components to install/upgrade. Stop any OpenVPN processes or the OpenVPN service if it is running. All DLLs are installed locally."
+ !define MUI_COMPONENTSPAGE_TEXT_TOP "Select the components to install/upgrade. Stop any ${PRODUCT_NAME} processes or the ${PRODUCT_NAME} service if it is running. All DLLs are installed locally."
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\INSTALL-win32.txt"
!define MUI_FINISHPAGE_NOAUTOCLOSE
# !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_ABORTWARNING
- !define MUI_ICON "${HOME}\images\openvpn.ico"
- !define MUI_UNICON "${HOME}\images\openvpn.ico"
+ !define MUI_ICON "${HOME}\images\${PRODUCT_ICON}"
+ !define MUI_UNICON "${HOME}\images\${PRODUCT_ICON}"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${HOME}\images\install-whirl.bmp"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
@@ -94,27 +100,27 @@
;--------------------------------
;Language Strings
- LangString DESC_SecOpenVPNUserSpace ${LANG_ENGLISH} "Install OpenVPN user-space components, including openvpn.exe."
+ LangString DESC_SecOpenVPNUserSpace ${LANG_ENGLISH} "Install ${PRODUCT_NAME} user-space components, including ${PRODUCT_UNIX_NAME}.exe."
-!ifdef OPENVPN_GUI
- LangString DESC_SecOpenVPNGUI ${LANG_ENGLISH} "Install OpenVPN GUI by Mathias Sundman"
+!ifdef OPENVPN_GUI_DEFINED
+ LangString DESC_SecOpenVPNGUI ${LANG_ENGLISH} "Install ${PRODUCT_NAME} GUI by Mathias Sundman"
!endif
- LangString DESC_SecOpenVPNEasyRSA ${LANG_ENGLISH} "Install OpenVPN RSA scripts for X509 certificate management."
+ LangString DESC_SecOpenVPNEasyRSA ${LANG_ENGLISH} "Install ${PRODUCT_NAME} RSA scripts for X509 certificate management."
LangString DESC_SecOpenSSLDLLs ${LANG_ENGLISH} "Install OpenSSL DLLs locally (may be omitted if DLLs are already installed globally)."
LangString DESC_SecTAP ${LANG_ENGLISH} "Install/Upgrade the TAP-Win32 virtual device driver. Will not interfere with CIPE."
- LangString DESC_SecService ${LANG_ENGLISH} "Install the OpenVPN service wrapper (openvpnserv.exe)"
+ LangString DESC_SecService ${LANG_ENGLISH} "Install the ${PRODUCT_NAME} service wrapper (${PRODUCT_UNIX_NAME}serv.exe)"
LangString DESC_SecOpenSSLUtilities ${LANG_ENGLISH} "Install the OpenSSL Utilities (used for generating public/private key pairs)."
- LangString DESC_SecAddPath ${LANG_ENGLISH} "Add OpenVPN executable directory to the current user's PATH."
+ LangString DESC_SecAddPath ${LANG_ENGLISH} "Add ${PRODUCT_NAME} executable directory to the current user's PATH."
- LangString DESC_SecAddShortcuts ${LANG_ENGLISH} "Add OpenVPN shortcuts to the current user's Start Menu."
+ LangString DESC_SecAddShortcuts ${LANG_ENGLISH} "Add ${PRODUCT_NAME} shortcuts to the current user's Start Menu."
- LangString DESC_SecFileAssociation ${LANG_ENGLISH} "Register OpenVPN config file association (*.${SERV_CONFIG_EXT})"
+ LangString DESC_SecFileAssociation ${LANG_ENGLISH} "Register ${PRODUCT_NAME} config file association (*.${SERV_CONFIG_EXT})"
;--------------------------------
;Reserve Files
@@ -183,7 +189,7 @@ Function .onInit
UserInfo::GetAccountType
Pop $R1
StrCmp $R1 "Admin" ok
- Messagebox MB_OK "Administrator privileges required to install OpenVPN [$R0/$R1]"
+ Messagebox MB_OK "Administrator privileges required to install ${PRODUCT_NAME} [$R0/$R1]"
Abort
ok:
@@ -194,7 +200,7 @@ Function .onInit
StrCmp $1 "2003" goodwinver
StrCmp $1 "VISTA" goodwinver
- Messagebox MB_OK "Sorry, OpenVPN does not currently support Windows $1"
+ Messagebox MB_OK "Sorry, ${PRODUCT_NAME} does not currently support Windows $1"
Abort
goodwinver:
@@ -205,12 +211,12 @@ goodwinver:
; we are running on 64-bit windows
StrCmp $1 "VISTA" vista64bummer
-# Messagebox MB_OK "Sorry, OpenVPN doesn't currently support 64-bit Windows."
+# Messagebox MB_OK "Sorry, ${PRODUCT_NAME} doesn't currently support 64-bit Windows."
# Abort
vista64bummer:
-# Messagebox MB_OK "Sorry, OpenVPN doesn't currently support 64-bit Vista because Microsoft doesn't allow the installation of 64 bit unsigned drivers."
+# Messagebox MB_OK "Sorry, ${PRODUCT_NAME} doesn't currently support 64-bit Vista because Microsoft doesn't allow the installation of 64 bit unsigned drivers."
# Abort
init32bits:
@@ -219,32 +225,32 @@ FunctionEnd
!define SF_SELECTED 1
-Section "OpenVPN User-Space Components" SecOpenVPNUserSpace
+Section "${PRODUCT_NAME} User-Space Components" SecOpenVPNUserSpace
SetOverwrite on
SetOutPath "$INSTDIR\bin"
- File "${BIN}\openvpn.exe"
+ File "${BIN}\${PRODUCT_UNIX_NAME}.exe"
SectionEnd
-!ifdef OPENVPN_GUI
-Section "OpenVPN GUI" SecOpenVPNGUI
+!ifdef OPENVPN_GUI_DEFINED
+Section "${PRODUCT_NAME} GUI" SecOpenVPNGUI
SetOverwrite on
SetOutPath "$INSTDIR\bin"
- File "${HOME}\${OPENVPN_GUI_DIR}\${OPENVPN_GUI}"
+ File "${BIN}\${OPENVPN_GUI}"
SectionEnd
!endif
-Section "OpenVPN RSA Certificate Management Scripts" SecOpenVPNEasyRSA
+Section "${PRODUCT_NAME} RSA Certificate Management Scripts" SecOpenVPNEasyRSA
SetOverwrite on
SetOutPath "$INSTDIR\easy-rsa"
- File "${HOME}\install-win32\openssl.cnf.sample"
+ File "${HOME}\samples\openssl.cnf.sample"
File "${HOME}\easy-rsa\Windows\vars.bat.sample"
File "${HOME}\easy-rsa\Windows\init-config.bat"
@@ -262,37 +268,37 @@ Section "OpenVPN RSA Certificate Management Scripts" SecOpenVPNEasyRSA
SectionEnd
-Section "OpenVPN Service" SecService
+Section "${PRODUCT_NAME} Service" SecService
SetOverwrite on
SetOutPath "$INSTDIR\bin"
- File "${BIN}\openvpnserv.exe"
+ File "${BIN}\${PRODUCT_UNIX_NAME}serv.exe"
SetOutPath "$INSTDIR\config"
FileOpen $R0 "$INSTDIR\config\README.txt" w
- FileWrite $R0 "This directory should contain OpenVPN configuration files$\r$\n"
+ FileWrite $R0 "This directory should contain ${PRODUCT_NAME} configuration files$\r$\n"
FileWrite $R0 "each having an extension of .${SERV_CONFIG_EXT}$\r$\n"
FileWrite $R0 "$\r$\n"
- FileWrite $R0 "When OpenVPN is started as a service, a separate OpenVPN$\r$\n"
+ FileWrite $R0 "When ${PRODUCT_NAME} is started as a service, a separate ${PRODUCT_NAME}$\r$\n"
FileWrite $R0 "process will be instantiated for each configuration file.$\r$\n"
FileClose $R0
SetOutPath "$INSTDIR\sample-config"
- File "${HOME}\install-win32\sample.${SERV_CONFIG_EXT}"
- File "${HOME}\install-win32\client.${SERV_CONFIG_EXT}"
- File "${HOME}\install-win32\server.${SERV_CONFIG_EXT}"
+ File "${HOME}\samples\sample.${SERV_CONFIG_EXT}"
+ File "${HOME}\samples\client.${SERV_CONFIG_EXT}"
+ File "${HOME}\samples\server.${SERV_CONFIG_EXT}"
CreateDirectory "$INSTDIR\log"
FileOpen $R0 "$INSTDIR\log\README.txt" w
- FileWrite $R0 "This directory will contain the log files for OpenVPN$\r$\n"
+ FileWrite $R0 "This directory will contain the log files for ${PRODUCT_NAME}$\r$\n"
FileWrite $R0 "sessions which are being run as a service.$\r$\n"
FileClose $R0
SectionEnd
-Section "OpenVPN File Associations" SecFileAssociation
+Section "${PRODUCT_NAME} File Associations" SecFileAssociation
SectionEnd
Section "OpenSSL DLLs" SecOpenSSLDLLs
@@ -345,6 +351,7 @@ Section "TAP-Win32 Virtual Ethernet Adapter" SecTAP
SetOutPath "$INSTDIR\driver"
File "${BIN}\driver\amd64\OemWin2k.inf"
+ File "${BIN}\driver\amd64\${PRODUCT_TAP_ID}.cat"
File "${BIN}\driver\amd64\${TAPDRV}"
goto tapend
@@ -358,14 +365,14 @@ tap-32bit:
SetOutPath "$INSTDIR\driver"
File "${BIN}\driver\i386\OemWin2k.inf"
- File "${BIN}\driver\i386\tap.cat"
+ File "${BIN}\driver\i386\${PRODUCT_TAP_ID}.cat"
File "${BIN}\driver\i386\${TAPDRV}"
tapend:
SectionEnd
-Section "Add OpenVPN to PATH" SecAddPath
+Section "Add ${PRODUCT_NAME} to PATH" SecAddPath
; remove previously set path (if any)
Push "$INSTDIR\bin"
@@ -380,12 +387,12 @@ SectionEnd
Section "Add Shortcuts to Start Menu" SecAddShortcuts
SetOverwrite on
- CreateDirectory "$SMPROGRAMS\OpenVPN"
- WriteINIStr "$SMPROGRAMS\OpenVPN\OpenVPN Windows Notes.url" "InternetShortcut" "URL" "http://openvpn.net/INSTALL-win32.html"
- WriteINIStr "$SMPROGRAMS\OpenVPN\OpenVPN Manual Page.url" "InternetShortcut" "URL" "http://openvpn.net/man.html"
- WriteINIStr "$SMPROGRAMS\OpenVPN\OpenVPN HOWTO.url" "InternetShortcut" "URL" "http://openvpn.net/howto.html"
- WriteINIStr "$SMPROGRAMS\OpenVPN\OpenVPN Web Site.url" "InternetShortcut" "URL" "http://openvpn.net/"
- CreateShortCut "$SMPROGRAMS\OpenVPN\Uninstall OpenVPN.lnk" "$INSTDIR\Uninstall.exe"
+ CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
+ WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Windows Notes.url" "InternetShortcut" "URL" "http://openvpn.net/INSTALL-win32.html"
+ WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Manual Page.url" "InternetShortcut" "URL" "http://openvpn.net/man.html"
+ WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} HOWTO.url" "InternetShortcut" "URL" "http://openvpn.net/howto.html"
+ WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Web Site.url" "InternetShortcut" "URL" "http://openvpn.net/"
+ CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall ${PRODUCT_NAME}.lnk" "$INSTDIR\Uninstall.exe"
SectionEnd
@@ -454,7 +461,7 @@ Section -post
notap:
; Store install folder in registry
- WriteRegStr HKLM SOFTWARE\OpenVPN "" $INSTDIR
+ WriteRegStr HKLM SOFTWARE\${PRODUCT_NAME} "" $INSTDIR
; install as a service if requested
SectionGetFlags ${SecService} $R0
@@ -462,19 +469,19 @@ Section -post
IntCmp $R0 ${SF_SELECTED} "" noserv noserv
; set registry parameters for openvpnserv
- !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "config_dir" "${SERV_CONFIG_DIR}"
- !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "config_ext" "${SERV_CONFIG_EXT}"
- !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "exe_path" "${SERV_EXE_PATH}"
- !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "log_dir" "${SERV_LOG_DIR}"
- !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "priority" "${SERV_PRIORITY}"
- !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "log_append" "${SERV_LOG_APPEND}"
+ !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "config_dir" "${SERV_CONFIG_DIR}"
+ !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "config_ext" "${SERV_CONFIG_EXT}"
+ !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "exe_path" "${SERV_EXE_PATH}"
+ !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "log_dir" "${SERV_LOG_DIR}"
+ !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "priority" "${SERV_PRIORITY}"
+ !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "log_append" "${SERV_LOG_APPEND}"
; install openvpnserv as a service
DetailPrint "Previous Service REMOVE (if exists)"
- nsExec::ExecToLog '"$INSTDIR\bin\openvpnserv.exe" -remove'
+ nsExec::ExecToLog '"$INSTDIR\bin\${PRODUCT_UNIX_NAME}serv.exe" -remove'
Pop $R0 # return value/error/timeout
DetailPrint "Service INSTALL"
- nsExec::ExecToLog '"$INSTDIR\bin\openvpnserv.exe" -install'
+ nsExec::ExecToLog '"$INSTDIR\bin\${PRODUCT_UNIX_NAME}serv.exe" -install'
Pop $R0 # return value/error/timeout
noserv:
@@ -483,54 +490,54 @@ Section -post
SetOutPath $INSTDIR
File "${HOME}\install-win32\INSTALL-win32.txt"
File "${HOME}\install-win32\license.txt"
- File "${HOME}\images\openvpn.ico"
+ File "${HOME}\images\${PRODUCT_ICON}"
; Create file association if requested
SectionGetFlags ${SecFileAssociation} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} "" noass noass
- !insertmacro WriteRegStringIfUndef HKCR ".${SERV_CONFIG_EXT}" "" "OpenVPNFile"
- !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile" "" "OpenVPN Config File"
- !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\shell" "" "open"
- !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\DefaultIcon" "" "$INSTDIR\openvpn.ico,0"
- !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\shell\open\command" "" 'notepad.exe "%1"'
- !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\shell\run" "" "Start OpenVPN on this config file"
- !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\shell\run\command" "" '"$INSTDIR\bin\openvpn.exe" --pause-exit --config "%1"'
+ WriteRegStr HKCR ".${SERV_CONFIG_EXT}" "" "${PRODUCT_NAME}File"
+ WriteRegStr HKCR "${PRODUCT_NAME}File" "" "${PRODUCT_NAME} Config File"
+ WriteRegStr HKCR "${PRODUCT_NAME}File\shell" "" "open"
+ WriteRegStr HKCR "${PRODUCT_NAME}File\DefaultIcon" "" "$INSTDIR\${PRODUCT_ICON},0"
+ WriteRegStr HKCR "${PRODUCT_NAME}File\shell\open\command" "" 'notepad.exe "%1"'
+ WriteRegStr HKCR "${PRODUCT_NAME}File\shell\run" "" "Start ${PRODUCT_NAME} on this config file"
+ WriteRegStr HKCR "${PRODUCT_NAME}File\shell\run\command" "" '"$INSTDIR\bin\${PRODUCT_UNIX_NAME}.exe" --pause-exit --config "%1"'
; Create start menu and desktop shortcuts to OpenVPN GUI
noass:
- !ifdef OPENVPN_GUI
+ !ifdef OPENVPN_GUI_DEFINED
IfFileExists "$INSTDIR\bin\${OPENVPN_GUI}" "" tryaddtap
- CreateShortCut "$SMPROGRAMS\OpenVPN\OpenVPN GUI.lnk" "$INSTDIR\bin\${OPENVPN_GUI}" ""
- CreateShortcut "$DESKTOP\OpenVPN GUI.lnk" "$INSTDIR\bin\${OPENVPN_GUI}"
+ CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} GUI.lnk" "$INSTDIR\bin\${OPENVPN_GUI}" ""
+ CreateShortcut "$DESKTOP\${PRODUCT_NAME} GUI.lnk" "$INSTDIR\bin\${OPENVPN_GUI}"
!endif
; Create start menu shortcuts to addtap.bat and deltapall.bat
tryaddtap:
IfFileExists "$INSTDIR\bin\addtap.bat" "" trydeltap
- CreateShortCut "$SMPROGRAMS\OpenVPN\Add a new TAP-Win32 virtual ethernet adapter.lnk" "$INSTDIR\bin\addtap.bat" ""
+ CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Add a new TAP-Win32 virtual ethernet adapter.lnk" "$INSTDIR\bin\addtap.bat" ""
trydeltap:
IfFileExists "$INSTDIR\bin\deltapall.bat" "" config_shortcut
- CreateShortCut "$SMPROGRAMS\OpenVPN\Delete ALL TAP-Win32 virtual ethernet adapters.lnk" "$INSTDIR\bin\deltapall.bat" ""
+ CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Delete ALL TAP-Win32 virtual ethernet adapters.lnk" "$INSTDIR\bin\deltapall.bat" ""
; Create start menu shortcuts for config and log directories
config_shortcut:
IfFileExists "$INSTDIR\config" "" log_shortcut
- CreateShortCut "$SMPROGRAMS\OpenVPN\OpenVPN configuration file directory.lnk" "$INSTDIR\config" ""
+ CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} configuration file directory.lnk" "$INSTDIR\config" ""
log_shortcut:
IfFileExists "$INSTDIR\log" "" samp_shortcut
- CreateShortCut "$SMPROGRAMS\OpenVPN\OpenVPN log file directory.lnk" "$INSTDIR\log" ""
+ CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} log file directory.lnk" "$INSTDIR\log" ""
samp_shortcut:
IfFileExists "$INSTDIR\sample-config" "" genkey_shortcut
- CreateShortCut "$SMPROGRAMS\OpenVPN\OpenVPN Sample Configuration Files.lnk" "$INSTDIR\sample-config" ""
+ CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Sample Configuration Files.lnk" "$INSTDIR\sample-config" ""
genkey_shortcut:
- IfFileExists "$INSTDIR\bin\openvpn.exe" "" noshortcuts
+ IfFileExists "$INSTDIR\bin\${PRODUCT_UNIX_NAME}.exe" "" noshortcuts
IfFileExists "$INSTDIR\config" "" noshortcuts
- CreateShortCut "$SMPROGRAMS\OpenVPN\Generate a static OpenVPN key.lnk" "$INSTDIR\bin\openvpn.exe" '--pause-exit --verb 3 --genkey --secret "$INSTDIR\config\key.txt"' "$INSTDIR\openvpn.ico" 0
+ CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Generate a static ${PRODUCT_NAME} key.lnk" "$INSTDIR\bin\${PRODUCT_UNIX_NAME}.exe" '--pause-exit --verb 3 --genkey --secret "$INSTDIR\config\key.txt"' "$INSTDIR\${PRODUCT_ICON}" 0
noshortcuts:
; Create uninstaller
@@ -539,7 +546,7 @@ Section -post
; Show up in Add/Remove programs
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" "${PRODUCT_NAME} ${VERSION}"
WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString" "$INSTDIR\Uninstall.exe"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon" "$INSTDIR\openvpn.ico"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon" "$INSTDIR\${PRODUCT_ICON}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayVersion" "${VERSION}"
; Advise a reboot
@@ -552,7 +559,7 @@ SectionEnd
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecOpenVPNUserSpace} $(DESC_SecOpenVPNUserSpace)
- !ifdef OPENVPN_GUI
+ !ifdef OPENVPN_GUI_DEFINED
!insertmacro MUI_DESCRIPTION_TEXT ${SecOpenVPNGUI} $(DESC_SecOpenVPNGUI)
!endif
!insertmacro MUI_DESCRIPTION_TEXT ${SecOpenVPNEasyRSA} $(DESC_SecOpenVPNEasyRSA)
@@ -576,7 +583,7 @@ Function un.onInit
UserInfo::GetAccountType
Pop $R1
StrCmp $R1 "Admin" ok
- Messagebox MB_OK "Administrator privileges required to uninstall OpenVPN [$R0/$R1]"
+ Messagebox MB_OK "Administrator privileges required to uninstall ${PRODUCT_NAME} [$R0/$R1]"
Abort
ok:
FunctionEnd
@@ -584,7 +591,7 @@ FunctionEnd
Section "Uninstall"
DetailPrint "Service REMOVE"
- nsExec::ExecToLog '"$INSTDIR\bin\openvpnserv.exe" -remove'
+ nsExec::ExecToLog '"$INSTDIR\bin\${PRODUCT_UNIX_NAME}serv.exe" -remove'
Pop $R0 # return value/error/timeout
Sleep 2000
@@ -597,13 +604,13 @@ Section "Uninstall"
Push "$INSTDIR\bin"
Call un.RemoveFromPath
- RMDir /r $SMPROGRAMS\OpenVPN
+ RMDir /r $SMPROGRAMS\${PRODUCT_NAME}
- Delete "$INSTDIR\bin\openvpn.exe"
- !ifdef OPENVPN_GUI
+ Delete "$INSTDIR\bin\${PRODUCT_UNIX_NAME}.exe"
+ !ifdef OPENVPN_GUI_DEFINED
Delete "$INSTDIR\bin\${OPENVPN_GUI}"
!endif
- Delete "$INSTDIR\bin\openvpnserv.exe"
+ Delete "$INSTDIR\bin\${PRODUCT_UNIX_NAME}serv.exe"
Delete "$INSTDIR\bin\libeay32.dll"
Delete "$INSTDIR\bin\libssl32.dll"
Delete "$INSTDIR\bin\tapinstall.exe"
@@ -616,13 +623,13 @@ Section "Uninstall"
Delete "$INSTDIR\log\README.txt"
Delete "$INSTDIR\driver\OemWin2k.inf"
- Delete "$INSTDIR\driver\tap.cat"
+ Delete "$INSTDIR\driver\${PRODUCT_TAP_ID}.cat"
Delete "$INSTDIR\driver\${TAPDRV}"
Delete "$INSTDIR\bin\openssl.exe"
Delete "$INSTDIR\INSTALL-win32.txt"
- Delete "$INSTDIR\openvpn.ico"
+ Delete "$INSTDIR\${PRODUCT_ICON}"
Delete "$INSTDIR\license.txt"
Delete "$INSTDIR\Uninstall.exe"
@@ -641,7 +648,7 @@ Section "Uninstall"
Delete "$INSTDIR\easy-rsa\revoke-full.bat"
Delete "$INSTDIR\easy-rsa\serial.start"
- Delete "$INSTDIR\sample-config\*.ovpn"
+ Delete "$INSTDIR\sample-config\*.${PRODUCT_FILE_EXT}"
RMDir "$INSTDIR\bin"
RMDir "$INSTDIR\driver"
@@ -649,12 +656,12 @@ Section "Uninstall"
RMDir "$INSTDIR\sample-config"
RMDir "$INSTDIR"
- !insertmacro DelRegKeyIfUnchanged HKCR ".${SERV_CONFIG_EXT}" "OpenVPNFile"
- DeleteRegKey HKCR "OpenVPNFile"
- DeleteRegKey HKLM SOFTWARE\OpenVPN
+ !insertmacro DelRegKeyIfUnchanged HKCR ".${SERV_CONFIG_EXT}" "${PRODUCT_NAME}File"
+ DeleteRegKey HKCR "${PRODUCT_NAME}File"
+ DeleteRegKey HKLM SOFTWARE\${PRODUCT_NAME}
DeleteRegKey HKCU "Software\${PRODUCT_NAME}"
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVPN"
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
- ;Messagebox MB_OK "IMPORTANT: If you intend on reinstalling OpenVPN after this uninstall, and you are running Win2K, you are strongly urged to reboot before reinstalling (this is an informational message only, pressing OK will not reboot)."
+ ;Messagebox MB_OK "IMPORTANT: If you intend on reinstalling ${PRODUCT_NAME} after this uninstall, and you are running Win2K, you are strongly urged to reboot before reinstalling (this is an informational message only, pressing OK will not reboot)."
SectionEnd
diff --git a/install-win32/settings.in b/install-win32/settings.in
index 98ea71b..f65a756 100644
--- a/install-win32/settings.in
+++ b/install-win32/settings.in
@@ -2,58 +2,70 @@
# for Windows OpenVPN installer.
# Get the OpenVPN version number
-include "autodefs/version.in"
+!include "autodefs/version.in"
+
+# Branding
+!define PRODUCT_NAME "OpenVPN"
+!define PRODUCT_UNIX_NAME "openvpn"
+!define PRODUCT_FILE_EXT "ovpn"
+
+# Allow --askpass and --auth-user-pass passwords to be read from a file
+;!define ENABLE_PASSWORD_SAVE
# Include the OpenVPN GUI exe in the installer.
# May be undefined.
-define OPENVPN_GUI_DIR "../openvpn-gui"
-define OPENVPN_GUI "openvpn-gui-1.0.3.exe"
+!define OPENVPN_GUI_DIR "../openvpn-gui"
+!define OPENVPN_GUI "openvpn-gui-1.0.3.exe"
# Prebuilt libraries. DMALLOC is optional.
-define OPENSSL_DIR "../openssl-0.9.7l"
-define LZO_DIR "../lzo-2.02"
-define DMALLOC_DIR "../dmalloc-5.4.2"
+!define OPENSSL_DIR "../openssl-0.9.7l"
+!define LZO_DIR "../lzo-2.02"
+!define DMALLOC_DIR "../dmalloc-5.4.2"
# Write TAP driver and tapinstall.exe to this directory,
# to use as prebuilt binaries for future builds. May
# be undefined.
-;define DRVBINDEST "../tapbin"
+;!define DRVBINDEST "../tapbin"
# Don't build TAP driver and tapinstall.exe -- instead get
# them as prebuilt binaries from this directory. May be
# undefined.
-;define DRVBINSRC "../tapbin"
+;!define DRVBINSRC "../tapbin"
# tapinstall.exe source code.
# Not needed if DRVBINSRC is defined.
-define TISRC "../tapinstall"
+!define TISRC "../tapinstall"
# TAP Adapter parameters.
-define PRODUCT_TAP_MAJOR_VER 9
-define PRODUCT_TAP_MINOR_VER 3
-define PRODUCT_TAP_RELDATE "04/18/2007"
+!define PRODUCT_TAP_DEVICE_DESCRIPTION "TAP-Win32 Adapter V9"
+!define PRODUCT_TAP_PROVIDER "TAP-Win32 Provider V9"
+!define PRODUCT_TAP_ID "tap0901"
+!define PRODUCT_TAP_MAJOR_VER 9
+!define PRODUCT_TAP_MINOR_VER 3
+!define PRODUCT_TAP_RELDATE "04/18/2007"
+
+; visible=0x81 hidden=0x89
+!define PRODUCT_TAP_CHARACTERISTICS 0x81
+
+# Build debugging version of TAP driver
+;!define PRODUCT_TAP_DEBUG
# Service template files service.[ch] (get from Platform SDK).
# If undefined, don't build openvpnserv.exe
-define SVC_TEMPLATE "../svc-template"
+!define SVC_TEMPLATE "../svc-template"
# DDK Version.
# DDK distribution is assumed to be in C:\WINDDK\${DDKVER}
-# Not needed if DRVBINSRC is defined.
-define DDKVER 5600
+!define DDKVER 5600
# Code Signing.
# This directory should contain signcode.exe + key files.
# If undefined, don't sign any files.
-define SIGNCODE "../sign"
-
-# INF2CAT should point to the MS inf2cat distribution.
-# inf2cat is used for driver signing.
-# If undefined, don't sign any files.
-define INF2CAT "../inf2cat"
+!define SIGNTOOL "../signtool"
+!define PRODUCT_SIGN_CN "openvpn"
# -j parameter passed to make
-define MAKE_JOBS 2
+!define MAKE_JOBS 2
# do a make clean before make
-define MAKE_CLEAN "yes"
+!define MAKE_CLEAN "yes"
diff --git a/install-win32/signinstaller b/install-win32/signinstaller
index 013688b..a802360 100644
--- a/install-win32/signinstaller
+++ b/install-win32/signinstaller
@@ -1,22 +1,16 @@
#!/bin/sh
-# Sign the installer
-# SIGNCODE should point to directory with signcode.exe and keys
+# Sign the installer.
c=`pwd`
# load version.nsi definitions
. autodefs/defs.sh
-if [ -n "$SIGNCODE" ] ; then
-
+if [ -d "$SIGNTOOL" ]; then
cd install-win32
- ls openvpn*.exe 2>/dev/null || exit 1
- exe=`pwd`/`ls -t openvpn*.exe | head -n 1`
+ ls *.exe 2>/dev/null || exit 1
+ export TARGET_EXE=$(pwd)/$(ls -t *.exe | head -n 1)
cd $c
- cd "$SIGNCODE"
-
- TS="http://timestamp.verisign.com/scripts/timstamp.dll"
- echo '******************' SIGNCODE OpenVPN INSTALLER
- ./signcode -spc mycredentials.spc -v myprivatekey.pvk -a sha1 -n "OpenVPN Installer" -t $TS `perl $c/install-win32/dosname.pl $exe`
+ $SIGNTOOL/signexe
fi
diff --git a/install-win32/signtap b/install-win32/signtap
index 46f3056..148bbf0 100644
--- a/install-win32/signtap
+++ b/install-win32/signtap
@@ -1,54 +1,10 @@
#!/bin/sh
-# Sign the x86 and x64 versions of the TAP driver
-
-# SIGNCODE should point to directory with signcode.exe and keys
-# INF2CAT should point to the MS inf2cat distribution
-
-c=`pwd`
+# Sign the TAP driver.
# load version.nsi definitions
. autodefs/defs.sh
-if [ -z "$DRVBINSRC" ] ; then
- # copy driver files into tap-win32/dist
- cd tap-win32
- rm -rf dist
- mkdir dist
- cd dist
- mkdir i386
- mkdir amd64
- cd i386
- x86=`pwd`
- cd ../amd64
- x64=`pwd`
- cd ../..
- cp i386/OemWin2k.inf $x86
- cp i386/*.sys $x86
- cp amd64/OemWin2k.inf $x64
- cp amd64/*.sys $x64
- cd $c
-
- if [ -n "$SIGNCODE" ] && [ -n "$INF2CAT" ] ; then
- cd "$INF2CAT"
-
- echo '******************' BUILD .cat FILE for x86
- cmd //c "inf2cat /driver:`perl $c/install-win32/dosname.pl $x86` /os:2000,XP_X86,Server2003_X86,Vista_X86"
-
- echo '******************' BUILD .cat FILE for x64
- cmd //c "inf2cat /driver:`perl $c/install-win32/dosname.pl $x64` /os:XP_X64,Server2003_X64,Vista_X64"
-
- cd $c
- cd "$SIGNCODE"
-
- TS="http://timestamp.verisign.com/scripts/timstamp.dll"
- echo '******************' SIGNCODE .cat FILE for x86
- ./signcode -spc mycredentials.spc -v myprivatekey.pvk -a sha1 -n "OpenVPN TAP-Win32 Driver" -t $TS `perl $c/install-win32/dosname.pl $x86/tap.cat`
- echo '******************' SIGNCODE .cat FILE for x64
- ./signcode -spc mycredentials.spc -v myprivatekey.pvk -a sha1 -n "OpenVPN TAP-Win64 Driver" -t $TS `perl $c/install-win32/dosname.pl $x64/tap.cat`
- else
- out="TAP driver catalog file is undefined";
- echo "$out" >$x86/tap.cat
- echo "$out" >$x64/tap.cat
- fi
+if [ -d "$SIGNTOOL" ]; then
+ $SIGNTOOL/signtap
fi
diff --git a/install-win32/trans.pl b/install-win32/trans.pl
index b275ea8..34fd207 100644
--- a/install-win32/trans.pl
+++ b/install-win32/trans.pl
@@ -7,9 +7,9 @@
# Input grammar:
# (1) comments having ';' or '#' as the first char in the line
# (2) a blank line
-# (3) include "file"
-# (4) define foo bar
-# (5) define foo "bar"
+# (3) !include "file"
+# (4) !define foo bar
+# (5) !define foo "bar"
#
# Environmental variables can be used to override a setting.
# The special value "null" causes the variable to be undefined.
@@ -25,6 +25,7 @@ sub comment {
sub define {
my ($name, $value) = @_;
if ($mode eq "sh") {
+ $value="true" if !$value;
print "[ -z \"\$$name\" ] && export $name=$value\n";
print "[ \"\$$name\" = \"$nulltag\" ] && unset $name\n";
} else {
@@ -34,13 +35,12 @@ sub define {
}
if ($value ne $nulltag) {
print "#define $name $value\n" if ($mode =~ /^(c|h)$/);
- print "!define $name $value\n" if ($mode eq "nsi");
- print "define $name $value\n" if ($mode eq "in");
+ print "!define $name $value\n" if ($mode =~ /^(nsi|in)$/);
print "var $name=$value;\n" if ($mode eq "js");
} else {
print "//#undef $name\n" if ($mode =~ /^(c|h)$/);
print "#!undef $name\n" if ($mode eq "nsi");
- print ";undef $name\n" if ($mode eq "in");
+ print ";!undef $name\n" if ($mode eq "in");
print "//undef $name\n" if ($mode eq "js");
}
}
@@ -60,9 +60,9 @@ sub include_file {
print "\n";
} elsif (/^[#;](.*)$/) {
comment ($1);
- } elsif (/^define\s+(\w+)\s+(.+)$/) {
+ } elsif (/^!define\s+(\w+)(?:\s+(.*?))?\s*$/) {
define ($1, $2);
- } elsif (/^include\s+"(.+)"/) {
+ } elsif (/^!include\s+"(.+)"$/) {
include_file ($1);
} else {
die "can't parse this line: $_\n";
diff --git a/install-win32/winconfig b/install-win32/winconfig
index 7fd49cd..5f823a2 100644
--- a/install-win32/winconfig
+++ b/install-win32/winconfig
@@ -9,6 +9,7 @@ rm -rf autodefs
mkdir autodefs
MACRO="perl install-win32/macro.pl autodefs/defs.in"
+IFDEF="perl install-win32/ifdef.pl"
# silly vista security theatre
PATCH="/tmp/p.exe"
@@ -24,13 +25,11 @@ done
. autodefs/defs.sh
# configure tap driver sources
-$MACRO <tap-win32/SOURCES.in >tap-win32/SOURCES
-$MACRO <tap-win32/i386/OemWin2k.inf.in >tap-win32/i386/OemWin2k.inf
rm -rf tap-win32/amd64
mkdir tap-win32/amd64
-cp tap-win32/i386/OemWin2k.inf tap-win32/amd64
-cd tap-win32/amd64
-$PATCH <../inf64.patch
+$MACRO <tap-win32/SOURCES.in >tap-win32/SOURCES
+$MACRO <tap-win32/i386/OemWin2k.inf.in | $IFDEF >tap-win32/i386/OemWin2k.inf
+$MACRO <tap-win32/i386/OemWin2k.inf.in | $IFDEF -DAMD64 >tap-win32/amd64/OemWin2k.inf
# configure service
if [ -n "$SVC_TEMPLATE" ] ; then
@@ -47,7 +46,11 @@ cd $c
cat COPYING COPYRIGHT.GPL >install-win32/license.txt
# copy sample configuration files and docs
-cp sample-config-files/client.conf install-win32/client.ovpn
-cp sample-config-files/server.conf install-win32/server.ovpn
-cp easy-rsa/1.0/openssl.cnf install-win32/openssl.cnf.sample
+s=samples
+rm -rf $s
+mkdir $s
+cp sample-config-files/client.conf $s/client.$PRODUCT_FILE_EXT
+cp sample-config-files/server.conf $s/server.$PRODUCT_FILE_EXT
+cp install-win32/sample.ovpn $s/sample.$PRODUCT_FILE_EXT
+cp easy-rsa/1.0/openssl.cnf $s/openssl.cnf.sample
cp INSTALL-win32.txt install-win32