Browse code

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

james authored on 2007/04/26 06:37:49
Showing 37 changed files
... ...
@@ -53,7 +53,9 @@ typedef unsigned long in_addr_t;
53 53
 /*#define DEBUG_LABEL "DEBUG1"*/
54 54
 
55 55
 /* Should we print debug info from driver? */
56
-/*#define TAP_WIN32_DEBUG*/
56
+#ifdef PRODUCT_TAP_DEBUG
57
+#define TAP_WIN32_DEBUG
58
+#endif
57 59
 
58 60
 /*
59 61
  * Minimum TAP-Win32 version number expected by userspace
... ...
@@ -63,9 +65,6 @@ typedef unsigned long in_addr_t;
63 63
 #define TAP_WIN32_MIN_MAJOR 9
64 64
 #define TAP_WIN32_MIN_MINOR 1
65 65
 
66
-/* Allow --askpass and --auth-user-pass passwords to be read from a file */
67
-/* #undef ENABLE_PASSWORD_SAVE */
68
-
69 66
 /* Enable client/server capability */
70 67
 #define ENABLE_CLIENT_SERVER 1
71 68
 
... ...
@@ -216,25 +215,25 @@ typedef unsigned long in_addr_t;
216 216
 #define HAVE_GETPASS 1
217 217
 
218 218
 /* Name of package */
219
-#define PACKAGE "openvpn"
219
+#define PACKAGE PRODUCT_UNIX_NAME
220 220
 
221 221
 /* Define to the address where bug reports for this package should be sent. */
222
-#define PACKAGE_BUGREPORT "openvpn-users@lists.sourceforge.net"
222
+//#define PACKAGE_BUGREPORT "openvpn-users@lists.sourceforge.net"
223 223
 
224 224
 /* Define to the full name of this package. */
225
-#define PACKAGE_NAME "OpenVPN"
225
+#define PACKAGE_NAME PRODUCT_NAME
226 226
 
227 227
 /* Define to the one symbol short name of this package. */
228
-#define PACKAGE_TARNAME "openvpn"
228
+#define PACKAGE_TARNAME PACKAGE
229 229
 
230 230
 /* Define to the version of this package. */
231 231
 #define PACKAGE_VERSION PRODUCT_VERSION
232 232
 
233 233
 /* Define to the full name and version of this package. */
234 234
 #ifdef DEBUG_LABEL
235
-#define PACKAGE_STRING "OpenVPN " PACKAGE_VERSION " " DEBUG_LABEL
235
+#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION " " DEBUG_LABEL
236 236
 #else
237
-#define PACKAGE_STRING "OpenVPN " PACKAGE_VERSION
237
+#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION
238 238
 #endif
239 239
 
240 240
 /* Define as the return type of signal handlers (`int' or `void'). */
... ...
@@ -1,14 +1,34 @@
1 1
 #!/bin/sh
2 2
 
3 3
 # This is the master OpenVPN build script for Windows.
4
-# See top-devel definitions in install-win32/version.nsi
4
+# This script will build OpenVPN, the TAP driver, and
5
+# the installer from source.
5 6
 #
6
-# Example usage:
7
+# See top-devel build configuration in install-win32/version.nsi
8
+#
9
+# Prerequisite installs:
10
+#
11
+# MinGW     -- for GNU C compiler
12
+# MSYS      -- for bash
13
+# msysDTK   -- for perl
14
+# NSIS      -- for building installer
15
+# svn       -- for checking out source code (or TortoiseSVN)
16
+# Windows Driver Kit Vista RC1 (5600) -- for building TAP driver + tapinstall
17
+#
18
+# Required source code not included in OpenVPN SVN repository
19
+# because of MS licensing restrictions:
7 20
 #
8
-# make without signing:
9
-#  SIGNCODE="null" ./domake-win
21
+# ../tapinstall -- This is based on 'devcon' which is found in the
22
+#                  Windows Driver Kit (formerly known as DDK).
23
+#                  Copy the 'devcon' source tree to ../tapinstall
24
+#                  Edit 'sources' and modify TARGETNAME=tapinstall
25
+#
26
+# ../svc-template -- This directory should contain service.[ch]
27
+#                    from the MS Platform SDK.
28
+#
29
+# Example usage:
10 30
 #
11
-# write installer to desktop
31
+# build everything, then write installer to desktop
12 32
 #  INSTALLER_DEST="/c/Documents and Settings/James/Desktop" ./domake-win
13 33
 
14 34
 install-win32/winconfig
... ...
@@ -17,6 +37,7 @@ install-win32/maketapinstall
17 17
 install-win32/maketap
18 18
 install-win32/signtap
19 19
 install-win32/makebin
20
+install-win32/getgui
20 21
 install-win32/buildinstaller
21 22
 install-win32/signinstaller
22 23
 install-win32/copyinstaller
... ...
@@ -163,7 +163,6 @@
163 163
 #define D_REGISTRY           LOGLEV(11, 70, M_DEBUG) /* win32 registry debugging info */
164 164
 #define D_OPENSSL_LOCK       LOGLEV(11, 70, M_DEBUG) /* show OpenSSL locks */
165 165
 
166
-#define D_THREAD_DEBUG       LOGLEV(4, 70, M_DEBUG)  /* JYFIXME -- show pthread debug information */
167
-
166
+/*#define D_THREAD_DEBUG       LOGLEV(4, 70, M_DEBUG)*/  /* show pthread debug information */
168 167
 
169 168
 #endif
170 169
new file mode 100755
171 170
Binary files /dev/null and b/images/icon.ico differ
172 171
deleted file mode 100755
173 172
Binary files a/images/openvpn.ico and /dev/null differ
... ...
@@ -3,4 +3,6 @@
3 3
 # build the installer
4 4
 
5 5
 cd install-win32
6
-'/c/Program Files/NSIS/makensis' openvpn.nsi
6
+rm -f *.exe
7
+'/c/Program Files/NSIS/makensis' openvpn.nsi &>makensis.log
8
+tail -20 makensis.log
... ...
@@ -1,4 +1,7 @@
1
-($unixname) = @ARGV;
2
-$unixname =~ s#^/c##g;
3
-$unixname =~ s#/#\\#g;
4
-print "$unixname\n";
1
+#!/usr/bin/perl
2
+
3
+while ($unixname = shift(@ARGV)) {
4
+  $unixname =~ s#^/([a-zA-Z])(/|$)#$1:\\#g;
5
+  $unixname =~ s#/#\\#g;
6
+  print "$unixname\n";
7
+}
5 8
new file mode 100644
... ...
@@ -0,0 +1,21 @@
0
+#!/bin/sh
1
+
2
+# Get and sign the OpenVPN GUI
3
+
4
+c=`pwd`
5
+
6
+# load version.nsi definitions
7
+. autodefs/defs.sh
8
+
9
+GUI="$OPENVPN_GUI_DIR/$OPENVPN_GUI"
10
+
11
+if [ -e "$GUI" ]; then
12
+    cp $GUI bin
13
+    echo '!define OPENVPN_GUI_DEFINED' >autodefs/guidefs.nsi
14
+    if [ -d "$SIGNTOOL" ]; then
15
+	export TARGET_EXE="bin/$OPENVPN_GUI"
16
+	$SIGNTOOL/signexe
17
+    fi
18
+else
19
+    cat /dev/null >autodefs/guidefs.nsi
20
+fi
0 21
new file mode 100644
... ...
@@ -0,0 +1,53 @@
0
+#!/usr/bin/perl
1
+
2
+# Simple ifdef/else/endif processor.
3
+
4
+die "usage: ifdef [-C<command-prefix>] [-Dname ...] [control-file ...] " if (@ARGV[0] =~ /^(-h|--help)$/);
5
+
6
+%Parms = ();
7
+
8
+$pre = "!";
9
+while ($arg=shift(@ARGV)) {
10
+    if ($arg =~ /^-/) {
11
+	if ($arg =~ /^-D(\w+)$/) {
12
+	    $Parms{$1} = 1;
13
+	} elsif ($arg =~ /-C(.*)$/) {
14
+	  $pre = $1;
15
+	} else {
16
+	    die "unrecognized option: $arg";
17
+	}
18
+    } else {
19
+	open(CONTROL, "< $arg") or die "cannot open $arg";
20
+	while (<CONTROL>) {
21
+	    if (/^!define\s+(\w+)/) {
22
+                $Parms{$1} = 1;
23
+            }
24
+        }
25
+    }
26
+}
27
+
28
+sub ifdef {
29
+  my ($var, $enabled) = @_;
30
+  my $def = 0;
31
+  $def = 1 if (defined $Parms{$var}) || ($var eq "true");
32
+  $def = 0 if $var eq "false";
33
+  while (<STDIN>) {
34
+    if (/^\s*\Q$pre\Eifdef\s+(\w+)\s*$/) {
35
+      return 1 if ifdef ($1, $def & $enabled);
36
+    } elsif (/^\s*\Q$pre\Eelseif\s+(\w+)\s*$/) {
37
+      $def = $def ^ 1;
38
+      return ifdef ($1, $def & $enabled);
39
+    } elsif (/^\s*\Q$pre\Eelse\s*$/) {
40
+      $def = $def ^ 1;
41
+    } elsif (/^\s*\Q$pre\Eendif\s*$/) {
42
+      return 0;
43
+    } elsif (/^\s*\Q$pre\E/) {
44
+      die "unrecognized command: $_";
45
+    } else {
46
+      print if $def && $enabled;
47
+    }
48
+  }
49
+  return 1;
50
+}
51
+
52
+ifdef("true", 1);
... ...
@@ -8,7 +8,7 @@ while (<STDIN>) {
8 8
   if (/^\s*$/) {
9 9
     print "\n";
10 10
   } elsif (/^define\((\w+),\[(.*?)\]\)/) {
11
-    print "define $1 \"$2\"\n";
11
+    print "!define $1 \"$2\"\n";
12 12
   } elsif (/^dnl(.*)$/) {
13 13
     print "#$1\n";
14 14
   }
... ...
@@ -15,38 +15,47 @@ $open_quote = "@@";
15 15
 $close_quote = "@@";
16 16
 
17 17
 while ($arg=shift(@ARGV)) {
18
-    if ($arg =~ /^-/) {
19
-	if ($arg =~ /^-D(\w+)=(.*)$/) {
20
-	    $Parms{$1} = $2
21
-	} elsif ($arg =~ /-O(.*)$/) {
22
-	  $open_quote = $1;
23
-	} elsif ($arg =~ /-C(.*)$/) {
24
-	  $close_quote = $1;
25
-	} else {
26
-	    die "unrecognized option: $arg";
27
-	}
18
+  if ($arg =~ /^-/) {
19
+    if ($arg =~ /^-D(\w+)(?:=(.*))?$/) {
20
+      $Parms{$1} = $2
21
+    } elsif ($arg =~ /-O(.*)$/) {
22
+      $open_quote = $1;
23
+    } elsif ($arg =~ /-C(.*)$/) {
24
+      $close_quote = $1;
28 25
     } else {
29
-	open(CONTROL, "< $arg") or die "cannot open $arg";
30
-	while (<CONTROL>) {
31
-	    chomp;
32
-	    if (/^define\s+(\w+)\s+['"]?(.+?)['"]?\s*$/) {
33
-                $Parms{$1} = $2
34
-            }
35
-        }
26
+      die "unrecognized option: $arg";
36 27
     }
28
+  } else {
29
+    open(CONTROL, "< $arg") or die "cannot open $arg";
30
+    while (<CONTROL>) {
31
+      if (/^!define\s+(\w+)(?:\s+['"]?(.*?)['"]?)?\s*$/) {
32
+	$Parms{$1} = $2;
33
+      }
34
+    }
35
+  }
36
+}
37
+
38
+sub print_symbol_table {
39
+  foreach my $k (sort (keys(%Parms))) {
40
+    my $v = $Parms{$k};
41
+    print "[$k] -> \"$v\"\n";
42
+  }
37 43
 }
38 44
 
45
+#print_symbol_table ();
46
+#exit 0;
47
+
39 48
 while (<STDIN>) {
40 49
   s{
41 50
     \Q$open_quote\E
42 51
     \s*
43 52
     (
44
-      \w+
45
-    )
53
+    \w+
54
+   )
46 55
     \s*
47 56
     \Q$close_quote\E
48 57
   }{
49 58
     $Parms{$1}
50
-   }xge;
59
+  }xge;
51 60
   print;
52 61
 }
... ...
@@ -9,12 +9,12 @@ rm -rf bin
9 9
 mkdir bin
10 10
 
11 11
 # Get OpenVPN executable
12
-cp openvpn.exe bin
13
-strip bin/openvpn.exe
12
+cp $PRODUCT_UNIX_NAME.exe bin
13
+strip bin/$PRODUCT_UNIX_NAME.exe
14 14
 
15 15
 # Get OpenVPN service
16
-cp service-win32/openvpnserv.exe bin
17
-strip bin/openvpnserv.exe
16
+cp service-win32/${PRODUCT_UNIX_NAME}serv.exe bin
17
+strip bin/${PRODUCT_UNIX_NAME}serv.exe
18 18
 
19 19
 # Get OpenSSL binaries
20 20
 for f in libeay32.dll libssl32.dll openssl.exe ; do
... ...
@@ -6,25 +6,52 @@
6 6
 # get version.nsi definitions
7 7
 . autodefs/defs.sh
8 8
 
9
-amdtarget=""
10
-if [ -z "$TAP_BIN_AMD64" ]; then
9
+if [ -n "$PRODUCT_TAP_DEBUG" ] ; then
10
+    w2ktarget="w2k c"
11
+    amdtarget="chk AMD64 WNET"
12
+else
13
+    w2ktarget="w2k f"
11 14
     amdtarget="fre AMD64 WNET"
12 15
 fi
13 16
 
14 17
 if [ -z "$DRVBINSRC" ] ; then
18
+    if [ -n "$TAP_BIN_AMD64" ]; then
19
+	amdtarget=""
20
+    fi
21
+
15 22
     cd tap-win32
16 23
     t=`pwd`
17 24
     cd ..
18 25
 
19
-    for mode in "w2k f" "$amdtarget"; do
26
+    for mode in "$w2ktarget" "$amdtarget"; do
20 27
 	echo '**********' build TAP $mode
21 28
 	cmd //c "C:\\WINDDK\\$DDKVER\\bin\\setenv.bat C:\\WINDDK\\$DDKVER $mode && cd `perl install-win32/dosname.pl $t` && build -cef"
22 29
     done
23
-fi
24 30
 
25
-if [ -n "$TAP_BIN_AMD64" ]; then
26
-    mkdir -p $t/amd64
27
-    cp "$TAP_BIN_AMD64" $t/amd64
28
-fi
31
+    title openvpn-build &>/dev/null
29 32
 
30
-title openvpn-build &>/dev/null
33
+    if [ -n "$TAP_BIN_AMD64" ]; then
34
+	mkdir -p $t/amd64
35
+	cp "$TAP_BIN_AMD64" $t/amd64
36
+    fi
37
+
38
+    # copy driver files into tap-win32/dist
39
+    cd tap-win32
40
+    rm -rf dist
41
+    mkdir dist
42
+    cd dist
43
+    mkdir i386
44
+    mkdir amd64
45
+    cd i386
46
+    x86=`pwd`
47
+    cd ../amd64
48
+    x64=`pwd`
49
+    cd ../..
50
+    cp i386/OemWin2k.inf $x86
51
+    cp i386/*.sys $x86
52
+    cp amd64/OemWin2k.inf $x64
53
+    cp amd64/*.sys $x64
54
+    out="TAP driver catalog file is undefined";
55
+    echo "$out" >$x86/$PRODUCT_TAP_ID.cat
56
+    echo "$out" >$x64/$PRODUCT_TAP_ID.cat
57
+fi
... ...
@@ -10,16 +10,22 @@
10 10
 !define HOME ".."
11 11
 
12 12
 !include "${HOME}\autodefs\defs.nsi"
13
+!include "${HOME}\autodefs\guidefs.nsi"
13 14
 !include "MUI.nsh"
14 15
 !include "setpath.nsi"
15 16
 !include "GetWindowsVersion.nsi"
16 17
 
17 18
 !define BIN "${HOME}\bin"
18 19
 
19
-!define PRODUCT_NAME "OpenVPN"
20
+!define PRODUCT_ICON "icon.ico"
21
+
22
+!ifdef PRODUCT_TAP_DEBUG
23
+!define VERSION "${PRODUCT_VERSION}-DBG"
24
+!else
20 25
 !define VERSION "${PRODUCT_VERSION}"
26
+!endif
21 27
 
22
-!define TAP "tap0901"
28
+!define TAP "${PRODUCT_TAP_ID}"
23 29
 !define TAPDRV "${TAP}.sys"
24 30
 
25 31
 ; something like "-DBG2"
... ...
@@ -30,8 +36,8 @@
30 30
 
31 31
 ; Default service settings
32 32
 !define SERV_CONFIG_DIR   "$INSTDIR\config"
33
-!define SERV_CONFIG_EXT   "ovpn"
34
-!define SERV_EXE_PATH     "$INSTDIR\bin\openvpn.exe"
33
+!define SERV_CONFIG_EXT   "${PRODUCT_FILE_EXT}"
34
+!define SERV_EXE_PATH     "$INSTDIR\bin\${PRODUCT_UNIX_NAME}.exe"
35 35
 !define SERV_LOG_DIR      "$INSTDIR\log"
36 36
 !define SERV_PRIORITY     "NORMAL_PRIORITY_CLASS"
37 37
 !define SERV_LOG_APPEND   "0"
... ...
@@ -41,7 +47,7 @@
41 41
 
42 42
   ;General
43 43
 
44
-  OutFile "openvpn-${VERSION}${OUTFILE_LABEL}-install.exe"
44
+  OutFile "${PRODUCT_UNIX_NAME}-${VERSION}${OUTFILE_LABEL}-install.exe"
45 45
 
46 46
   SetCompressor bzip2
47 47
 
... ...
@@ -59,17 +65,17 @@
59 59
 
60 60
   Name "${PRODUCT_NAME} ${VERSION} ${TITLE_LABEL}"
61 61
 
62
-  !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"
62
+  !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"
63 63
 
64
-  !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."
64
+  !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."
65 65
 
66 66
   !define MUI_COMPONENTSPAGE_SMALLDESC
67 67
   !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\INSTALL-win32.txt"
68 68
   !define MUI_FINISHPAGE_NOAUTOCLOSE
69 69
 #  !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
70 70
   !define MUI_ABORTWARNING
71
-  !define MUI_ICON "${HOME}\images\openvpn.ico"
72
-  !define MUI_UNICON "${HOME}\images\openvpn.ico"
71
+  !define MUI_ICON "${HOME}\images\${PRODUCT_ICON}"
72
+  !define MUI_UNICON "${HOME}\images\${PRODUCT_ICON}"
73 73
   !define MUI_HEADERIMAGE
74 74
   !define MUI_HEADERIMAGE_BITMAP "${HOME}\images\install-whirl.bmp"
75 75
   !define MUI_UNFINISHPAGE_NOAUTOCLOSE
... ...
@@ -94,27 +100,27 @@
94 94
 ;--------------------------------
95 95
 ;Language Strings
96 96
 
97
-  LangString DESC_SecOpenVPNUserSpace ${LANG_ENGLISH} "Install OpenVPN user-space components, including openvpn.exe."
97
+  LangString DESC_SecOpenVPNUserSpace ${LANG_ENGLISH} "Install ${PRODUCT_NAME} user-space components, including ${PRODUCT_UNIX_NAME}.exe."
98 98
 
99
-!ifdef OPENVPN_GUI
100
-  LangString DESC_SecOpenVPNGUI ${LANG_ENGLISH} "Install OpenVPN GUI by Mathias Sundman"
99
+!ifdef OPENVPN_GUI_DEFINED
100
+  LangString DESC_SecOpenVPNGUI ${LANG_ENGLISH} "Install ${PRODUCT_NAME} GUI by Mathias Sundman"
101 101
 !endif
102 102
 
103
-  LangString DESC_SecOpenVPNEasyRSA ${LANG_ENGLISH} "Install OpenVPN RSA scripts for X509 certificate management."
103
+  LangString DESC_SecOpenVPNEasyRSA ${LANG_ENGLISH} "Install ${PRODUCT_NAME} RSA scripts for X509 certificate management."
104 104
 
105 105
   LangString DESC_SecOpenSSLDLLs ${LANG_ENGLISH} "Install OpenSSL DLLs locally (may be omitted if DLLs are already installed globally)."
106 106
 
107 107
   LangString DESC_SecTAP ${LANG_ENGLISH} "Install/Upgrade the TAP-Win32 virtual device driver.  Will not interfere with CIPE."
108 108
 
109
-  LangString DESC_SecService ${LANG_ENGLISH} "Install the OpenVPN service wrapper (openvpnserv.exe)"
109
+  LangString DESC_SecService ${LANG_ENGLISH} "Install the ${PRODUCT_NAME} service wrapper (${PRODUCT_UNIX_NAME}serv.exe)"
110 110
 
111 111
   LangString DESC_SecOpenSSLUtilities ${LANG_ENGLISH} "Install the OpenSSL Utilities (used for generating public/private key pairs)."
112 112
 
113
-  LangString DESC_SecAddPath ${LANG_ENGLISH} "Add OpenVPN executable directory to the current user's PATH."
113
+  LangString DESC_SecAddPath ${LANG_ENGLISH} "Add ${PRODUCT_NAME} executable directory to the current user's PATH."
114 114
 
115
-  LangString DESC_SecAddShortcuts ${LANG_ENGLISH} "Add OpenVPN shortcuts to the current user's Start Menu."
115
+  LangString DESC_SecAddShortcuts ${LANG_ENGLISH} "Add ${PRODUCT_NAME} shortcuts to the current user's Start Menu."
116 116
 
117
-  LangString DESC_SecFileAssociation ${LANG_ENGLISH} "Register OpenVPN config file association (*.${SERV_CONFIG_EXT})"
117
+  LangString DESC_SecFileAssociation ${LANG_ENGLISH} "Register ${PRODUCT_NAME} config file association (*.${SERV_CONFIG_EXT})"
118 118
 
119 119
 ;--------------------------------
120 120
 ;Reserve Files
... ...
@@ -183,7 +189,7 @@ Function .onInit
183 183
   UserInfo::GetAccountType
184 184
   Pop $R1
185 185
   StrCmp $R1 "Admin" ok
186
-    Messagebox MB_OK "Administrator privileges required to install OpenVPN [$R0/$R1]"
186
+    Messagebox MB_OK "Administrator privileges required to install ${PRODUCT_NAME} [$R0/$R1]"
187 187
     Abort
188 188
   ok:
189 189
 
... ...
@@ -194,7 +200,7 @@ Function .onInit
194 194
   StrCmp $1 "2003" goodwinver
195 195
   StrCmp $1 "VISTA" goodwinver
196 196
 
197
-  Messagebox MB_OK "Sorry, OpenVPN does not currently support Windows $1"
197
+  Messagebox MB_OK "Sorry, ${PRODUCT_NAME} does not currently support Windows $1"
198 198
   Abort
199 199
 
200 200
 goodwinver:
... ...
@@ -205,12 +211,12 @@ goodwinver:
205 205
   ; we are running on 64-bit windows
206 206
   StrCmp $1 "VISTA" vista64bummer
207 207
 
208
-#  Messagebox MB_OK "Sorry, OpenVPN doesn't currently support 64-bit Windows."
208
+#  Messagebox MB_OK "Sorry, ${PRODUCT_NAME} doesn't currently support 64-bit Windows."
209 209
 #  Abort
210 210
 
211 211
 vista64bummer:
212 212
 
213
-#  Messagebox MB_OK "Sorry, OpenVPN doesn't currently support 64-bit Vista because Microsoft doesn't allow the installation of 64 bit unsigned drivers."
213
+#  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."
214 214
 #  Abort
215 215
 
216 216
 init32bits:
... ...
@@ -219,32 +225,32 @@ FunctionEnd
219 219
 
220 220
 !define SF_SELECTED 1
221 221
 
222
-Section "OpenVPN User-Space Components" SecOpenVPNUserSpace
222
+Section "${PRODUCT_NAME} User-Space Components" SecOpenVPNUserSpace
223 223
 
224 224
   SetOverwrite on
225 225
   SetOutPath "$INSTDIR\bin"
226 226
 
227
-  File "${BIN}\openvpn.exe"
227
+  File "${BIN}\${PRODUCT_UNIX_NAME}.exe"
228 228
 
229 229
 SectionEnd
230 230
 
231
-!ifdef OPENVPN_GUI
232
-Section "OpenVPN GUI" SecOpenVPNGUI
231
+!ifdef OPENVPN_GUI_DEFINED
232
+Section "${PRODUCT_NAME} GUI" SecOpenVPNGUI
233 233
 
234 234
   SetOverwrite on
235 235
   SetOutPath "$INSTDIR\bin"
236 236
 
237
-  File "${HOME}\${OPENVPN_GUI_DIR}\${OPENVPN_GUI}"
237
+  File "${BIN}\${OPENVPN_GUI}"
238 238
 
239 239
 SectionEnd
240 240
 !endif
241 241
 
242
-Section "OpenVPN RSA Certificate Management Scripts" SecOpenVPNEasyRSA
242
+Section "${PRODUCT_NAME} RSA Certificate Management Scripts" SecOpenVPNEasyRSA
243 243
 
244 244
   SetOverwrite on
245 245
   SetOutPath "$INSTDIR\easy-rsa"
246 246
 
247
-  File "${HOME}\install-win32\openssl.cnf.sample"
247
+  File "${HOME}\samples\openssl.cnf.sample"
248 248
   File "${HOME}\easy-rsa\Windows\vars.bat.sample"
249 249
 
250 250
   File "${HOME}\easy-rsa\Windows\init-config.bat"
... ...
@@ -262,37 +268,37 @@ Section "OpenVPN RSA Certificate Management Scripts" SecOpenVPNEasyRSA
262 262
 
263 263
 SectionEnd
264 264
 
265
-Section "OpenVPN Service" SecService
265
+Section "${PRODUCT_NAME} Service" SecService
266 266
 
267 267
   SetOverwrite on
268 268
 
269 269
   SetOutPath "$INSTDIR\bin"
270
-  File "${BIN}\openvpnserv.exe"
270
+  File "${BIN}\${PRODUCT_UNIX_NAME}serv.exe"
271 271
 
272 272
   SetOutPath "$INSTDIR\config"
273 273
 
274 274
   FileOpen $R0 "$INSTDIR\config\README.txt" w
275
-  FileWrite $R0 "This directory should contain OpenVPN configuration files$\r$\n"
275
+  FileWrite $R0 "This directory should contain ${PRODUCT_NAME} configuration files$\r$\n"
276 276
   FileWrite $R0 "each having an extension of .${SERV_CONFIG_EXT}$\r$\n"
277 277
   FileWrite $R0 "$\r$\n"
278
-  FileWrite $R0 "When OpenVPN is started as a service, a separate OpenVPN$\r$\n"
278
+  FileWrite $R0 "When ${PRODUCT_NAME} is started as a service, a separate ${PRODUCT_NAME}$\r$\n"
279 279
   FileWrite $R0 "process will be instantiated for each configuration file.$\r$\n"
280 280
   FileClose $R0
281 281
 
282 282
   SetOutPath "$INSTDIR\sample-config"
283
-  File "${HOME}\install-win32\sample.${SERV_CONFIG_EXT}"
284
-  File "${HOME}\install-win32\client.${SERV_CONFIG_EXT}"
285
-  File "${HOME}\install-win32\server.${SERV_CONFIG_EXT}"
283
+  File "${HOME}\samples\sample.${SERV_CONFIG_EXT}"
284
+  File "${HOME}\samples\client.${SERV_CONFIG_EXT}"
285
+  File "${HOME}\samples\server.${SERV_CONFIG_EXT}"
286 286
 
287 287
   CreateDirectory "$INSTDIR\log"
288 288
   FileOpen $R0 "$INSTDIR\log\README.txt" w
289
-  FileWrite $R0 "This directory will contain the log files for OpenVPN$\r$\n"
289
+  FileWrite $R0 "This directory will contain the log files for ${PRODUCT_NAME}$\r$\n"
290 290
   FileWrite $R0 "sessions which are being run as a service.$\r$\n"
291 291
   FileClose $R0
292 292
 
293 293
 SectionEnd
294 294
 
295
-Section "OpenVPN File Associations" SecFileAssociation
295
+Section "${PRODUCT_NAME} File Associations" SecFileAssociation
296 296
 SectionEnd
297 297
 
298 298
 Section "OpenSSL DLLs" SecOpenSSLDLLs
... ...
@@ -345,6 +351,7 @@ Section "TAP-Win32 Virtual Ethernet Adapter" SecTAP
345 345
   SetOutPath "$INSTDIR\driver"
346 346
 
347 347
   File "${BIN}\driver\amd64\OemWin2k.inf"
348
+  File "${BIN}\driver\amd64\${PRODUCT_TAP_ID}.cat"
348 349
   File "${BIN}\driver\amd64\${TAPDRV}"
349 350
 
350 351
 goto tapend
... ...
@@ -358,14 +365,14 @@ tap-32bit:
358 358
 
359 359
   SetOutPath "$INSTDIR\driver"
360 360
   File "${BIN}\driver\i386\OemWin2k.inf"
361
-  File "${BIN}\driver\i386\tap.cat"
361
+  File "${BIN}\driver\i386\${PRODUCT_TAP_ID}.cat"
362 362
   File "${BIN}\driver\i386\${TAPDRV}"
363 363
 
364 364
   tapend:
365 365
 
366 366
 SectionEnd
367 367
 
368
-Section "Add OpenVPN to PATH" SecAddPath
368
+Section "Add ${PRODUCT_NAME} to PATH" SecAddPath
369 369
 
370 370
   ; remove previously set path (if any)
371 371
   Push "$INSTDIR\bin"
... ...
@@ -380,12 +387,12 @@ SectionEnd
380 380
 Section "Add Shortcuts to Start Menu" SecAddShortcuts
381 381
 
382 382
   SetOverwrite on
383
-  CreateDirectory "$SMPROGRAMS\OpenVPN"
384
-  WriteINIStr "$SMPROGRAMS\OpenVPN\OpenVPN Windows Notes.url" "InternetShortcut" "URL" "http://openvpn.net/INSTALL-win32.html"
385
-  WriteINIStr "$SMPROGRAMS\OpenVPN\OpenVPN Manual Page.url" "InternetShortcut" "URL" "http://openvpn.net/man.html"
386
-  WriteINIStr "$SMPROGRAMS\OpenVPN\OpenVPN HOWTO.url" "InternetShortcut" "URL" "http://openvpn.net/howto.html"
387
-  WriteINIStr "$SMPROGRAMS\OpenVPN\OpenVPN Web Site.url" "InternetShortcut" "URL" "http://openvpn.net/"
388
-  CreateShortCut "$SMPROGRAMS\OpenVPN\Uninstall OpenVPN.lnk" "$INSTDIR\Uninstall.exe"
383
+  CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
384
+  WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Windows Notes.url" "InternetShortcut" "URL" "http://openvpn.net/INSTALL-win32.html"
385
+  WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Manual Page.url" "InternetShortcut" "URL" "http://openvpn.net/man.html"
386
+  WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} HOWTO.url" "InternetShortcut" "URL" "http://openvpn.net/howto.html"
387
+  WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Web Site.url" "InternetShortcut" "URL" "http://openvpn.net/"
388
+  CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall ${PRODUCT_NAME}.lnk" "$INSTDIR\Uninstall.exe"
389 389
 
390 390
 SectionEnd
391 391
 
... ...
@@ -454,7 +461,7 @@ Section -post
454 454
  notap:
455 455
 
456 456
   ; Store install folder in registry
457
-  WriteRegStr HKLM SOFTWARE\OpenVPN "" $INSTDIR
457
+  WriteRegStr HKLM SOFTWARE\${PRODUCT_NAME} "" $INSTDIR
458 458
 
459 459
   ; install as a service if requested
460 460
   SectionGetFlags ${SecService} $R0
... ...
@@ -462,19 +469,19 @@ Section -post
462 462
   IntCmp $R0 ${SF_SELECTED} "" noserv noserv
463 463
 
464 464
     ; set registry parameters for openvpnserv	
465
-    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "config_dir"  "${SERV_CONFIG_DIR}"
466
-    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "config_ext"  "${SERV_CONFIG_EXT}"
467
-    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "exe_path"    "${SERV_EXE_PATH}"
468
-    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "log_dir"     "${SERV_LOG_DIR}"
469
-    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "priority"    "${SERV_PRIORITY}"
470
-    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "log_append"  "${SERV_LOG_APPEND}"
465
+    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "config_dir"  "${SERV_CONFIG_DIR}"
466
+    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "config_ext"  "${SERV_CONFIG_EXT}"
467
+    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "exe_path"    "${SERV_EXE_PATH}"
468
+    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "log_dir"     "${SERV_LOG_DIR}"
469
+    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "priority"    "${SERV_PRIORITY}"
470
+    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PRODUCT_NAME}" "log_append"  "${SERV_LOG_APPEND}"
471 471
 
472 472
     ; install openvpnserv as a service
473 473
     DetailPrint "Previous Service REMOVE (if exists)"
474
-    nsExec::ExecToLog '"$INSTDIR\bin\openvpnserv.exe" -remove'
474
+    nsExec::ExecToLog '"$INSTDIR\bin\${PRODUCT_UNIX_NAME}serv.exe" -remove'
475 475
     Pop $R0 # return value/error/timeout
476 476
     DetailPrint "Service INSTALL"
477
-    nsExec::ExecToLog '"$INSTDIR\bin\openvpnserv.exe" -install'
477
+    nsExec::ExecToLog '"$INSTDIR\bin\${PRODUCT_UNIX_NAME}serv.exe" -install'
478 478
     Pop $R0 # return value/error/timeout
479 479
 
480 480
  noserv:
... ...
@@ -483,54 +490,54 @@ Section -post
483 483
   SetOutPath $INSTDIR
484 484
   File "${HOME}\install-win32\INSTALL-win32.txt"
485 485
   File "${HOME}\install-win32\license.txt"
486
-  File "${HOME}\images\openvpn.ico"
486
+  File "${HOME}\images\${PRODUCT_ICON}"
487 487
 
488 488
   ; Create file association if requested
489 489
   SectionGetFlags ${SecFileAssociation} $R0
490 490
   IntOp $R0 $R0 & ${SF_SELECTED}
491 491
   IntCmp $R0 ${SF_SELECTED} "" noass noass
492
-    !insertmacro WriteRegStringIfUndef HKCR ".${SERV_CONFIG_EXT}" "" "OpenVPNFile"
493
-    !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile" "" "OpenVPN Config File"
494
-    !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\shell" "" "open"
495
-    !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\DefaultIcon" "" "$INSTDIR\openvpn.ico,0"
496
-    !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\shell\open\command" "" 'notepad.exe "%1"'
497
-    !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\shell\run" "" "Start OpenVPN on this config file"
498
-    !insertmacro WriteRegStringIfUndef HKCR "OpenVPNFile\shell\run\command" "" '"$INSTDIR\bin\openvpn.exe" --pause-exit --config "%1"'
492
+    WriteRegStr HKCR ".${SERV_CONFIG_EXT}" "" "${PRODUCT_NAME}File"
493
+    WriteRegStr HKCR "${PRODUCT_NAME}File" "" "${PRODUCT_NAME} Config File"
494
+    WriteRegStr HKCR "${PRODUCT_NAME}File\shell" "" "open"
495
+    WriteRegStr HKCR "${PRODUCT_NAME}File\DefaultIcon" "" "$INSTDIR\${PRODUCT_ICON},0"
496
+    WriteRegStr HKCR "${PRODUCT_NAME}File\shell\open\command" "" 'notepad.exe "%1"'
497
+    WriteRegStr HKCR "${PRODUCT_NAME}File\shell\run" "" "Start ${PRODUCT_NAME} on this config file"
498
+    WriteRegStr HKCR "${PRODUCT_NAME}File\shell\run\command" "" '"$INSTDIR\bin\${PRODUCT_UNIX_NAME}.exe" --pause-exit --config "%1"'
499 499
 
500 500
     ; Create start menu and desktop shortcuts to OpenVPN GUI
501 501
  noass:
502
-  !ifdef OPENVPN_GUI
502
+  !ifdef OPENVPN_GUI_DEFINED
503 503
     IfFileExists "$INSTDIR\bin\${OPENVPN_GUI}" "" tryaddtap
504
-      CreateShortCut "$SMPROGRAMS\OpenVPN\OpenVPN GUI.lnk" "$INSTDIR\bin\${OPENVPN_GUI}" ""
505
-      CreateShortcut "$DESKTOP\OpenVPN GUI.lnk" "$INSTDIR\bin\${OPENVPN_GUI}"
504
+      CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} GUI.lnk" "$INSTDIR\bin\${OPENVPN_GUI}" ""
505
+      CreateShortcut "$DESKTOP\${PRODUCT_NAME} GUI.lnk" "$INSTDIR\bin\${OPENVPN_GUI}"
506 506
   !endif
507 507
 
508 508
     ; Create start menu shortcuts to addtap.bat and deltapall.bat
509 509
  tryaddtap:
510 510
     IfFileExists "$INSTDIR\bin\addtap.bat" "" trydeltap
511
-      CreateShortCut "$SMPROGRAMS\OpenVPN\Add a new TAP-Win32 virtual ethernet adapter.lnk" "$INSTDIR\bin\addtap.bat" ""
511
+      CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Add a new TAP-Win32 virtual ethernet adapter.lnk" "$INSTDIR\bin\addtap.bat" ""
512 512
 
513 513
  trydeltap:
514 514
     IfFileExists "$INSTDIR\bin\deltapall.bat" "" config_shortcut
515
-      CreateShortCut "$SMPROGRAMS\OpenVPN\Delete ALL TAP-Win32 virtual ethernet adapters.lnk" "$INSTDIR\bin\deltapall.bat" ""
515
+      CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Delete ALL TAP-Win32 virtual ethernet adapters.lnk" "$INSTDIR\bin\deltapall.bat" ""
516 516
 
517 517
     ; Create start menu shortcuts for config and log directories
518 518
  config_shortcut:
519 519
     IfFileExists "$INSTDIR\config" "" log_shortcut
520
-      CreateShortCut "$SMPROGRAMS\OpenVPN\OpenVPN configuration file directory.lnk" "$INSTDIR\config" ""
520
+      CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} configuration file directory.lnk" "$INSTDIR\config" ""
521 521
 
522 522
  log_shortcut:
523 523
     IfFileExists "$INSTDIR\log" "" samp_shortcut
524
-      CreateShortCut "$SMPROGRAMS\OpenVPN\OpenVPN log file directory.lnk" "$INSTDIR\log" ""
524
+      CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} log file directory.lnk" "$INSTDIR\log" ""
525 525
 
526 526
  samp_shortcut:
527 527
     IfFileExists "$INSTDIR\sample-config" "" genkey_shortcut
528
-      CreateShortCut "$SMPROGRAMS\OpenVPN\OpenVPN Sample Configuration Files.lnk" "$INSTDIR\sample-config" ""
528
+      CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Sample Configuration Files.lnk" "$INSTDIR\sample-config" ""
529 529
 
530 530
  genkey_shortcut:
531
-    IfFileExists "$INSTDIR\bin\openvpn.exe" "" noshortcuts
531
+    IfFileExists "$INSTDIR\bin\${PRODUCT_UNIX_NAME}.exe" "" noshortcuts
532 532
       IfFileExists "$INSTDIR\config" "" noshortcuts
533
-        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
533
+        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
534 534
 
535 535
  noshortcuts:
536 536
   ; Create uninstaller
... ...
@@ -539,7 +546,7 @@ Section -post
539 539
   ; Show up in Add/Remove programs
540 540
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" "${PRODUCT_NAME} ${VERSION}"
541 541
   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString" "$INSTDIR\Uninstall.exe"
542
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon" "$INSTDIR\openvpn.ico"
542
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon" "$INSTDIR\${PRODUCT_ICON}"
543 543
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayVersion" "${VERSION}"
544 544
 
545 545
   ; Advise a reboot
... ...
@@ -552,7 +559,7 @@ SectionEnd
552 552
 
553 553
 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
554 554
   !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenVPNUserSpace} $(DESC_SecOpenVPNUserSpace)
555
-  !ifdef OPENVPN_GUI
555
+  !ifdef OPENVPN_GUI_DEFINED
556 556
     !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenVPNGUI} $(DESC_SecOpenVPNGUI)
557 557
   !endif
558 558
   !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenVPNEasyRSA} $(DESC_SecOpenVPNEasyRSA)
... ...
@@ -576,7 +583,7 @@ Function un.onInit
576 576
   UserInfo::GetAccountType
577 577
   Pop $R1
578 578
   StrCmp $R1 "Admin" ok
579
-    Messagebox MB_OK "Administrator privileges required to uninstall OpenVPN [$R0/$R1]"
579
+    Messagebox MB_OK "Administrator privileges required to uninstall ${PRODUCT_NAME} [$R0/$R1]"
580 580
     Abort
581 581
   ok:
582 582
 FunctionEnd
... ...
@@ -584,7 +591,7 @@ FunctionEnd
584 584
 Section "Uninstall"
585 585
 
586 586
   DetailPrint "Service REMOVE"
587
-  nsExec::ExecToLog '"$INSTDIR\bin\openvpnserv.exe" -remove'
587
+  nsExec::ExecToLog '"$INSTDIR\bin\${PRODUCT_UNIX_NAME}serv.exe" -remove'
588 588
   Pop $R0 # return value/error/timeout
589 589
 
590 590
   Sleep 2000
... ...
@@ -597,13 +604,13 @@ Section "Uninstall"
597 597
   Push "$INSTDIR\bin"
598 598
   Call un.RemoveFromPath
599 599
 
600
-  RMDir /r $SMPROGRAMS\OpenVPN
600
+  RMDir /r $SMPROGRAMS\${PRODUCT_NAME}
601 601
 
602
-  Delete "$INSTDIR\bin\openvpn.exe"
603
-  !ifdef OPENVPN_GUI
602
+  Delete "$INSTDIR\bin\${PRODUCT_UNIX_NAME}.exe"
603
+  !ifdef OPENVPN_GUI_DEFINED
604 604
     Delete "$INSTDIR\bin\${OPENVPN_GUI}"
605 605
   !endif
606
-  Delete "$INSTDIR\bin\openvpnserv.exe"
606
+  Delete "$INSTDIR\bin\${PRODUCT_UNIX_NAME}serv.exe"
607 607
   Delete "$INSTDIR\bin\libeay32.dll"
608 608
   Delete "$INSTDIR\bin\libssl32.dll"
609 609
   Delete "$INSTDIR\bin\tapinstall.exe"
... ...
@@ -616,13 +623,13 @@ Section "Uninstall"
616 616
   Delete "$INSTDIR\log\README.txt"
617 617
 
618 618
   Delete "$INSTDIR\driver\OemWin2k.inf"
619
-  Delete "$INSTDIR\driver\tap.cat"
619
+  Delete "$INSTDIR\driver\${PRODUCT_TAP_ID}.cat"
620 620
   Delete "$INSTDIR\driver\${TAPDRV}"
621 621
 
622 622
   Delete "$INSTDIR\bin\openssl.exe"
623 623
 
624 624
   Delete "$INSTDIR\INSTALL-win32.txt"
625
-  Delete "$INSTDIR\openvpn.ico"
625
+  Delete "$INSTDIR\${PRODUCT_ICON}"
626 626
   Delete "$INSTDIR\license.txt"
627 627
   Delete "$INSTDIR\Uninstall.exe"
628 628
 
... ...
@@ -641,7 +648,7 @@ Section "Uninstall"
641 641
   Delete "$INSTDIR\easy-rsa\revoke-full.bat"
642 642
   Delete "$INSTDIR\easy-rsa\serial.start"
643 643
 
644
-  Delete "$INSTDIR\sample-config\*.ovpn"
644
+  Delete "$INSTDIR\sample-config\*.${PRODUCT_FILE_EXT}"
645 645
 
646 646
   RMDir "$INSTDIR\bin"
647 647
   RMDir "$INSTDIR\driver"
... ...
@@ -649,12 +656,12 @@ Section "Uninstall"
649 649
   RMDir "$INSTDIR\sample-config"
650 650
   RMDir "$INSTDIR"
651 651
 
652
-  !insertmacro DelRegKeyIfUnchanged HKCR ".${SERV_CONFIG_EXT}" "OpenVPNFile"
653
-  DeleteRegKey HKCR "OpenVPNFile"
654
-  DeleteRegKey HKLM SOFTWARE\OpenVPN
652
+  !insertmacro DelRegKeyIfUnchanged HKCR ".${SERV_CONFIG_EXT}" "${PRODUCT_NAME}File"
653
+  DeleteRegKey HKCR "${PRODUCT_NAME}File"
654
+  DeleteRegKey HKLM SOFTWARE\${PRODUCT_NAME}
655 655
   DeleteRegKey HKCU "Software\${PRODUCT_NAME}"
656
-  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVPN"
656
+  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
657 657
 
658
-  ;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)."
658
+  ;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)."
659 659
 
660 660
 SectionEnd
... ...
@@ -2,58 +2,70 @@
2 2
 # for Windows OpenVPN installer.
3 3
 
4 4
 # Get the OpenVPN version number
5
-include "autodefs/version.in"
5
+!include "autodefs/version.in"
6
+
7
+# Branding
8
+!define PRODUCT_NAME      "OpenVPN"
9
+!define PRODUCT_UNIX_NAME "openvpn"
10
+!define PRODUCT_FILE_EXT  "ovpn"
11
+
12
+# Allow --askpass and --auth-user-pass passwords to be read from a file
13
+;!define ENABLE_PASSWORD_SAVE
6 14
 
7 15
 # Include the OpenVPN GUI exe in the installer.
8 16
 # May be undefined.
9
-define OPENVPN_GUI_DIR "../openvpn-gui"
10
-define OPENVPN_GUI     "openvpn-gui-1.0.3.exe"
17
+!define OPENVPN_GUI_DIR "../openvpn-gui"
18
+!define OPENVPN_GUI     "openvpn-gui-1.0.3.exe"
11 19
 
12 20
 # Prebuilt libraries.  DMALLOC is optional.
13
-define OPENSSL_DIR	"../openssl-0.9.7l"
14
-define LZO_DIR		"../lzo-2.02"
15
-define DMALLOC_DIR	"../dmalloc-5.4.2"
21
+!define OPENSSL_DIR	"../openssl-0.9.7l"
22
+!define LZO_DIR		"../lzo-2.02"
23
+!define DMALLOC_DIR	"../dmalloc-5.4.2"
16 24
 
17 25
 # Write TAP driver and tapinstall.exe to this directory,
18 26
 # to use as prebuilt binaries for future builds.  May
19 27
 # be undefined.
20
-;define DRVBINDEST "../tapbin"
28
+;!define DRVBINDEST "../tapbin"
21 29
 
22 30
 # Don't build TAP driver and tapinstall.exe -- instead get
23 31
 # them as prebuilt binaries from this directory.  May be
24 32
 # undefined.
25
-;define DRVBINSRC  "../tapbin"
33
+;!define DRVBINSRC  "../tapbin"
26 34
 
27 35
 # tapinstall.exe source code.
28 36
 # Not needed if DRVBINSRC is defined.
29
-define TISRC	"../tapinstall"
37
+!define TISRC	"../tapinstall"
30 38
 
31 39
 # TAP Adapter parameters.
32
-define PRODUCT_TAP_MAJOR_VER       9
33
-define PRODUCT_TAP_MINOR_VER       3
34
-define PRODUCT_TAP_RELDATE         "04/18/2007"
40
+!define PRODUCT_TAP_DEVICE_DESCRIPTION  "TAP-Win32 Adapter V9"
41
+!define PRODUCT_TAP_PROVIDER            "TAP-Win32 Provider V9"
42
+!define PRODUCT_TAP_ID		        "tap0901"
43
+!define PRODUCT_TAP_MAJOR_VER           9
44
+!define PRODUCT_TAP_MINOR_VER           3
45
+!define PRODUCT_TAP_RELDATE             "04/18/2007"
46
+
47
+; visible=0x81  hidden=0x89
48
+!define PRODUCT_TAP_CHARACTERISTICS     0x81
49
+
50
+# Build debugging version of TAP driver
51
+;!define PRODUCT_TAP_DEBUG
35 52
 
36 53
 # Service template files service.[ch] (get from Platform SDK).
37 54
 # If undefined, don't build openvpnserv.exe
38
-define SVC_TEMPLATE "../svc-template"
55
+!define SVC_TEMPLATE "../svc-template"
39 56
 
40 57
 # DDK Version.
41 58
 # DDK distribution is assumed to be in C:\WINDDK\${DDKVER}
42
-# Not needed if DRVBINSRC is defined.
43
-define DDKVER	5600
59
+!define DDKVER	5600
44 60
 
45 61
 # Code Signing.
46 62
 # This directory should contain signcode.exe + key files.
47 63
 # If undefined, don't sign any files.
48
-define SIGNCODE "../sign"
49
-
50
-# INF2CAT should point to the MS inf2cat distribution.
51
-# inf2cat is used for driver signing.
52
-# If undefined, don't sign any files.
53
-define INF2CAT	"../inf2cat"
64
+!define SIGNTOOL        "../signtool"
65
+!define PRODUCT_SIGN_CN "openvpn"
54 66
 
55 67
 # -j parameter passed to make
56
-define MAKE_JOBS 2
68
+!define MAKE_JOBS 2
57 69
 
58 70
 # do a make clean before make
59
-define MAKE_CLEAN "yes"
71
+!define MAKE_CLEAN "yes"
... ...
@@ -1,22 +1,16 @@
1 1
 #!/bin/sh
2 2
 
3
-# Sign the installer
4
-# SIGNCODE should point to directory with signcode.exe and keys
3
+# Sign the installer.
5 4
 
6 5
 c=`pwd`
7 6
 
8 7
 # load version.nsi definitions
9 8
 . autodefs/defs.sh
10 9
 
11
-if [ -n "$SIGNCODE" ] ; then
12
-
10
+if [ -d "$SIGNTOOL" ]; then
13 11
     cd install-win32
14
-    ls openvpn*.exe 2>/dev/null || exit 1
15
-    exe=`pwd`/`ls -t openvpn*.exe | head -n 1`
12
+    ls *.exe 2>/dev/null || exit 1
13
+    export TARGET_EXE=$(pwd)/$(ls -t *.exe | head -n 1)
16 14
     cd $c
17
-    cd "$SIGNCODE"
18
-
19
-    TS="http://timestamp.verisign.com/scripts/timstamp.dll"
20
-    echo '******************' SIGNCODE OpenVPN INSTALLER
21
-    ./signcode -spc mycredentials.spc -v myprivatekey.pvk -a sha1 -n "OpenVPN Installer" -t $TS `perl $c/install-win32/dosname.pl $exe`
15
+    $SIGNTOOL/signexe
22 16
 fi
... ...
@@ -1,54 +1,10 @@
1 1
 #!/bin/sh
2 2
 
3
-# Sign the x86 and x64 versions of the TAP driver
4
-
5
-# SIGNCODE should point to directory with signcode.exe and keys
6
-# INF2CAT should point to the MS inf2cat distribution
7
-
8
-c=`pwd`
3
+# Sign the TAP driver.
9 4
 
10 5
 # load version.nsi definitions
11 6
 . autodefs/defs.sh
12 7
 
13
-if [ -z "$DRVBINSRC" ] ; then
14
-    # copy driver files into tap-win32/dist
15
-    cd tap-win32
16
-    rm -rf dist
17
-    mkdir dist
18
-    cd dist
19
-    mkdir i386
20
-    mkdir amd64
21
-    cd i386
22
-    x86=`pwd`
23
-    cd ../amd64
24
-    x64=`pwd`
25
-    cd ../..
26
-    cp i386/OemWin2k.inf $x86
27
-    cp i386/*.sys $x86
28
-    cp amd64/OemWin2k.inf $x64
29
-    cp amd64/*.sys $x64
30
-    cd $c
31
-
32
-    if [ -n "$SIGNCODE" ] && [ -n "$INF2CAT" ] ; then
33
-	cd "$INF2CAT"
34
-
35
-	echo '******************' BUILD .cat FILE for x86
36
-	cmd //c "inf2cat /driver:`perl $c/install-win32/dosname.pl $x86` /os:2000,XP_X86,Server2003_X86,Vista_X86"
37
-
38
-	echo '******************' BUILD .cat FILE for x64
39
-	cmd //c "inf2cat /driver:`perl $c/install-win32/dosname.pl $x64` /os:XP_X64,Server2003_X64,Vista_X64"
40
-
41
-	cd $c
42
-	cd "$SIGNCODE"
43
-
44
-	TS="http://timestamp.verisign.com/scripts/timstamp.dll"
45
-	echo '******************' SIGNCODE .cat FILE for x86
46
-	./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`
47
-	echo '******************' SIGNCODE .cat FILE for x64
48
-	./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`
49
-    else
50
-	out="TAP driver catalog file is undefined";
51
-	echo "$out" >$x86/tap.cat
52
-	echo "$out" >$x64/tap.cat
53
-    fi
8
+if [ -d "$SIGNTOOL" ]; then
9
+    $SIGNTOOL/signtap
54 10
 fi
... ...
@@ -7,9 +7,9 @@
7 7
 # Input grammar:
8 8
 #   (1) comments having ';' or '#' as the first char in the line
9 9
 #   (2) a blank line
10
-#   (3) include "file"
11
-#   (4) define foo bar
12
-#   (5) define foo "bar"
10
+#   (3) !include "file"
11
+#   (4) !define foo bar
12
+#   (5) !define foo "bar"
13 13
 #
14 14
 # Environmental variables can be used to override a setting.
15 15
 # The special value "null" causes the variable to be undefined.
... ...
@@ -25,6 +25,7 @@ sub comment {
25 25
 sub define {
26 26
   my ($name, $value) = @_;
27 27
   if ($mode eq "sh") {
28
+    $value="true" if !$value;
28 29
     print "[ -z \"\$$name\" ] && export $name=$value\n";
29 30
     print "[ \"\$$name\" = \"$nulltag\" ] && unset $name\n";
30 31
   } else {
... ...
@@ -34,13 +35,12 @@ sub define {
34 34
     }
35 35
     if ($value ne $nulltag) {
36 36
       print "#define $name $value\n" if ($mode =~ /^(c|h)$/);
37
-      print "!define $name $value\n" if ($mode eq "nsi");
38
-      print "define $name $value\n" if ($mode eq "in");
37
+      print "!define $name $value\n" if ($mode =~ /^(nsi|in)$/);
39 38
       print "var $name=$value;\n" if ($mode eq "js");
40 39
     } else {
41 40
       print "//#undef $name\n" if ($mode =~ /^(c|h)$/);
42 41
       print "#!undef $name\n" if ($mode eq "nsi");
43
-      print ";undef $name\n" if ($mode eq "in");
42
+      print ";!undef $name\n" if ($mode eq "in");
44 43
       print "//undef $name\n" if ($mode eq "js");
45 44
     }
46 45
   }
... ...
@@ -60,9 +60,9 @@ sub include_file {
60 60
 	print "\n";
61 61
       } elsif (/^[#;](.*)$/) {
62 62
 	comment ($1);
63
-      } elsif (/^define\s+(\w+)\s+(.+)$/) {
63
+      } elsif (/^!define\s+(\w+)(?:\s+(.*?))?\s*$/) {
64 64
 	define ($1, $2);
65
-      } elsif (/^include\s+"(.+)"/) {
65
+      } elsif (/^!include\s+"(.+)"$/) {
66 66
 	include_file ($1);
67 67
       } else {
68 68
 	die "can't parse this line: $_\n";
... ...
@@ -9,6 +9,7 @@ rm -rf autodefs
9 9
 mkdir autodefs
10 10
 
11 11
 MACRO="perl install-win32/macro.pl autodefs/defs.in"
12
+IFDEF="perl install-win32/ifdef.pl"
12 13
 
13 14
 # silly vista security theatre
14 15
 PATCH="/tmp/p.exe"
... ...
@@ -24,13 +25,11 @@ done
24 24
 . autodefs/defs.sh
25 25
 
26 26
 # configure tap driver sources
27
-$MACRO <tap-win32/SOURCES.in >tap-win32/SOURCES
28
-$MACRO <tap-win32/i386/OemWin2k.inf.in >tap-win32/i386/OemWin2k.inf
29 27
 rm -rf tap-win32/amd64
30 28
 mkdir tap-win32/amd64
31
-cp tap-win32/i386/OemWin2k.inf tap-win32/amd64
32
-cd tap-win32/amd64
33
-$PATCH <../inf64.patch
29
+$MACRO <tap-win32/SOURCES.in >tap-win32/SOURCES
30
+$MACRO <tap-win32/i386/OemWin2k.inf.in | $IFDEF >tap-win32/i386/OemWin2k.inf
31
+$MACRO <tap-win32/i386/OemWin2k.inf.in | $IFDEF -DAMD64 >tap-win32/amd64/OemWin2k.inf
34 32
 
35 33
 # configure service
36 34
 if [ -n "$SVC_TEMPLATE" ] ; then
... ...
@@ -47,7 +46,11 @@ cd $c
47 47
 cat COPYING COPYRIGHT.GPL >install-win32/license.txt
48 48
 
49 49
 # copy sample configuration files and docs
50
-cp sample-config-files/client.conf install-win32/client.ovpn
51
-cp sample-config-files/server.conf install-win32/server.ovpn
52
-cp easy-rsa/1.0/openssl.cnf install-win32/openssl.cnf.sample
50
+s=samples
51
+rm -rf $s
52
+mkdir $s
53
+cp sample-config-files/client.conf $s/client.$PRODUCT_FILE_EXT
54
+cp sample-config-files/server.conf $s/server.$PRODUCT_FILE_EXT
55
+cp install-win32/sample.ovpn $s/sample.$PRODUCT_FILE_EXT
56
+cp easy-rsa/1.0/openssl.cnf $s/openssl.cnf.sample
53 57
 cp INSTALL-win32.txt install-win32
... ...
@@ -58,7 +58,7 @@ LIB_DIRS = -L${OPENSSL_DIR}/out -L${LZO_DIR}
58 58
 
59 59
 LIB_DIRS_DMALLOC = ${LIB_DIRS} -L${DMALLOC_DIR}
60 60
 
61
-EXE = openvpn.exe
61
+EXE = ${PRODUCT_UNIX_NAME}.exe
62 62
 
63 63
 HEADERS = \
64 64
 	base64.h \
... ...
@@ -44,7 +44,7 @@
44 44
 
45 45
 #include "memdbg.h"
46 46
 
47
-#define MANAGEMENT_ECHO_PULL_INFO 0 /* JYFIXME */
47
+#define MANAGEMENT_ECHO_PULL_INFO 0
48 48
 
49 49
 #if MANAGEMENT_ECHO_PULL_INFO
50 50
 #define MANAGEMENT_ECHO_FLAGS LOG_PRINT_INTVAL
... ...
@@ -70,6 +70,9 @@ const char title_string[] =
70 70
 #if EPOLL
71 71
   " [EPOLL]"
72 72
 #endif
73
+#ifdef PRODUCT_TAP_DEBUG
74
+  " [TAPDBG]"
75
+#endif
73 76
 #ifdef USE_PTHREAD
74 77
   " [PTHREAD]"
75 78
 #endif
... ...
@@ -748,7 +748,7 @@ get_proxy_settings (char **err, struct gc_arena *gc)
748 748
   if (err)
749 749
     *err = string_alloc ("PROXY: automatic detection not supported on this OS", gc);
750 750
   return NULL;
751
-#else /* JYFIXME, test --auto-proxy feature */
751
+#else /* test --auto-proxy feature */
752 752
   struct auto_proxy_info *pi;
753 753
   ALLOC_OBJ_CLEAR_GC (pi, struct auto_proxy_info, gc);
754 754
   pi->http.server = "10.10.0.2";
... ...
@@ -5,7 +5,7 @@
5 5
 # applying service.patch to the Platform
6 6
 # SDK service sample.
7 7
 
8
-EXE = openvpnserv.exe
8
+EXE = ${PRODUCT_UNIX_NAME}serv.exe
9 9
 
10 10
 HEADERS = service.h
11 11
 
... ...
@@ -1,4 +1,4 @@
1 1
 # build service.[ch] patch against original
2 2
 # SDK sample
3
-diff -ub service.c.orig service.c >service.patch
4
-diff -ub service.h.orig service.h >>service.patch
3
+diff -ub service.c.orig service.c | u2d >service.patch
4
+diff -ub service.h.orig service.h | u2d >>service.patch
... ...
@@ -65,13 +65,13 @@ struct security_attributes
65 65
  * Control Manager which will cause an asynchronous call
66 66
  * of ServiceStop below.
67 67
  */
68
-#define EXIT_EVENT_NAME "openvpn_exit_1"
68
+#define EXIT_EVENT_NAME PRODUCT_UNIX_NAME "_exit_1"
69 69
 
70 70
 /*
71 71
  * Which registry key in HKLM should
72 72
  * we get config info from?
73 73
  */
74
-#define REG_KEY "SOFTWARE\\OpenVPN"
74
+#define REG_KEY "SOFTWARE\\" PRODUCT_NAME
75 75
 
76 76
 static HANDLE exit_event = NULL;
77 77
 
... ...
@@ -398,7 +398,7 @@ VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
398 398
 	  mysnprintf (log_path, "%s\\%s", log_dir, log_file);
399 399
 
400 400
 	  /* construct command line */
401
-	  mysnprintf (command_line, "openvpn --service %s 1 --config \"%s\"",
401
+	  mysnprintf (command_line, PRODUCT_UNIX_NAME " --service %s 1 --config \"%s\"",
402 402
 		      EXIT_EVENT_NAME,
403 403
 		      find_obj.cFileName);
404 404
 
... ...
@@ -406,7 +406,7 @@ VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
406 406
 	     be inherited. */
407 407
 	  if (!init_security_attributes_allow_all (&sa))
408 408
 	    {
409
-	      MSG (M_SYSERR, "InitializeSecurityDescriptor start_openvpn failed");
409
+	      MSG (M_SYSERR, "InitializeSecurityDescriptor start_" PRODUCT_UNIX_NAME " failed");
410 410
 	      goto finish;
411 411
 	    }
412 412
 
... ...
@@ -1,5 +1,5 @@
1
-+++ service.c	Mon Jan 30 10:16:33 2006
1
+--- service.c.orig	Tue Apr 24 14:49:30 2007
2 2
 @@ -16,6 +16,7 @@
3 3
    service_main(DWORD dwArgc, LPTSTR *lpszArgv);
4 4
    CmdInstallService();
... ...
@@ -319,27 +319,33 @@
319 319
     }
320 320
  
321 321
     if ( lpszTemp )
322
-+++ service.h	Mon Jan 30 10:03:35 2006
323
-@@ -62,13 +62,13 @@
322
+--- service.h.orig	Tue Apr 24 14:49:30 2007
323
+@@ -57,18 +57,19 @@
324
+ extern "C" {
325
+ #endif
326
+ 
327
++#include "../autodefs/defs.h"
328
+ 
329
+ //////////////////////////////////////////////////////////////////////////////
324 330
  //// todo: change to desired strings
325 331
  ////
326 332
  // name of the executable
327 333
 -#define SZAPPNAME            "Simple"
328
-+#define SZAPPNAME            "openvpnserv"
334
++#define SZAPPNAME            PRODUCT_UNIX_NAME "serv"
329 335
  // internal name of the service
330 336
 -#define SZSERVICENAME        "SimpleService"
331
-+#define SZSERVICENAME        "OpenVPNService"
337
++#define SZSERVICENAME        PRODUCT_NAME "Service"
332 338
  // displayed name of the service
333 339
 -#define SZSERVICEDISPLAYNAME "Simple Service"
334
-+#define SZSERVICEDISPLAYNAME "OpenVPN Service"
340
++#define SZSERVICEDISPLAYNAME PRODUCT_NAME " Service"
335 341
  // list of service dependencies - "dep1\0dep2\0\0"
336 342
 -#define SZDEPENDENCIES       ""
337
-+#define SZDEPENDENCIES       "TAP0901\0Dhcp\0\0"
343
++#define SZDEPENDENCIES       PRODUCT_TAP_ID "\0Dhcp\0\0"
338 344
  //////////////////////////////////////////////////////////////////////////////
339 345
  
340 346
  
341
-@@ -126,7 +126,10 @@
347
+@@ -126,7 +127,10 @@
342 348
  //  RETURN VALUE:
343 349
  //    none
344 350
  //
... ...
@@ -80,14 +80,14 @@ typedef uint16_t packet_size_type;
80 80
 /* OpenVPN sockaddr struct */
81 81
 struct openvpn_sockaddr
82 82
 {
83
-  int dummy; /* JYFIXME -- add offset to force a bug if sa not explicitly dereferenced */
83
+  /*int dummy;*/ /* add offset to force a bug if sa not explicitly dereferenced */
84 84
   struct sockaddr_in sa;
85 85
 };
86 86
 
87 87
 /* actual address of remote, based on source address of received packets */
88 88
 struct link_socket_actual
89 89
 {
90
-  int dummy; /* JYFIXME -- add offset to force a bug if dest not explicitly dereferenced */
90
+  /*int dummy;*/ /* add offset to force a bug if dest not explicitly dereferenced */
91 91
   struct openvpn_sockaddr dest;
92 92
 #if ENABLE_IP_PKTINFO
93 93
   struct in_pktinfo pi;
... ...
@@ -4,7 +4,7 @@
4 4
 MAJORCOMP=ntos
5 5
 MINORCOMP=ndis
6 6
 
7
-TARGETNAME=tap0901
7
+TARGETNAME=@@PRODUCT_TAP_ID@@
8 8
 TARGETTYPE=DRIVER
9 9
 TARGETPATH=.
10 10
 TARGETLIBS=$(DDK_LIB_PATH)\ndis.lib $(DDK_LIB_PATH)\ntstrsafe.lib
... ...
@@ -59,7 +59,7 @@ LINKER_FLAGS=$(LINKER_FLAGS) /MAP /MAPINFO:EXPORTS /MAPINFO:LINES
59 59
 #BROWSER_INFO=1
60 60
 #BROWSERFILE=$(TARGETNAME).BSC -n
61 61
 
62
-# Abort compilation on warnings.
63
-MSC_WARNING_LEVEL=/W3 /WX
62
+# Abort compilation on warnings by adding /WX
63
+MSC_WARNING_LEVEL=/W3
64 64
 
65 65
 SOURCES=tapdrvr.c resource.rc
... ...
@@ -32,6 +32,8 @@
32 32
 // common to both.
33 33
 //===============================================
34 34
 
35
+#include "../autodefs/defs.h"
36
+
35 37
 //=============
36 38
 // TAP IOCTLs
37 39
 //=============
... ...
@@ -79,4 +81,4 @@
79 79
 // simultaneously.
80 80
 //=========================================================
81 81
 
82
-#define TAP_COMPONENT_ID "tap0901"
82
+#define TAP_COMPONENT_ID PRODUCT_TAP_ID
... ...
@@ -30,7 +30,7 @@
30 30
 //                        Product and Version public settings
31 31
 //====================================================================
32 32
 
33
-#define PRODUCT_STRING "TAP-Win32 Adapter V9"
33
+#define PRODUCT_STRING PRODUCT_TAP_DEVICE_DESCRIPTION
34 34
 
35 35
 #define TAP_NDIS_MAJOR_VERSION 5
36 36
 #define TAP_NDIS_MINOR_VERSION 0
... ...
@@ -96,7 +96,7 @@ MyDebugPrint (const unsigned char* format, ...)
96 96
 	      va_end (args);
97 97
 
98 98
 	      if (status == STATUS_SUCCESS)
99
-		g_Debug.out = end - g_Debug.text;
99
+		g_Debug.out = (unsigned int) (end - g_Debug.text);
100 100
 	      else
101 101
 		g_Debug.error = TRUE;
102 102
 	    }
... ...
@@ -23,7 +23,11 @@
23 23
 ; not collide with other instances of TAP-Win32 defined
24 24
 ; by other apps.  Multiple versions of the TAP-Win32
25 25
 ; driver, each installed by different apps, can coexist
26
-; on the same machine if you follow these guidelines:
26
+; on the same machine if you follow these guidelines.
27
+; NOTE: these instructions assume you are editing the
28
+; generated OemWin2k.inf file, not the source
29
+; OemWin2k.inf.in file which is preprocessed by winconfig
30
+; and uses macro definitions from settings.in.
27 31
 ;
28 32
 ; (1) Rename all tapXXXX instances in this file to
29 33
 ;     something different (use at least 5 characters
... ...
@@ -44,7 +48,7 @@
44 44
 
45 45
 [Version]
46 46
    Signature = "$Windows NT$"
47
-   CatalogFile = tap.cat
47
+   CatalogFile = @@PRODUCT_TAP_ID@@.cat
48 48
    ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
49 49
    Provider = %Provider%
50 50
    Class = Net
... ...
@@ -54,17 +58,25 @@
54 54
    DriverVer=@@PRODUCT_TAP_RELDATE@@,@@PRODUCT_TAP_MAJOR_VER@@.00.00.@@PRODUCT_TAP_MINOR_VER@@
55 55
 
56 56
 [Strings]
57
-   DeviceDescription = "TAP-Win32 Adapter V9"
58
-   Provider = "TAP-Win32 Provider V9"
57
+   DeviceDescription = "@@PRODUCT_TAP_DEVICE_DESCRIPTION@@"
58
+   Provider = "@@PRODUCT_TAP_PROVIDER@@"
59 59
 
60 60
 ;----------------------------------------------------------------
61 61
 ;                      Manufacturer + Product Section (Done)
62 62
 ;----------------------------------------------------------------
63 63
 [Manufacturer]
64
-   %Provider% = tap0901
65
-
66
-[tap0901]
67
-   %DeviceDescription% = tap0901.ndi, tap0901
64
+!ifdef AMD64
65
+   %Provider% = @@PRODUCT_TAP_ID@@, NTamd64
66
+!else
67
+   %Provider% = @@PRODUCT_TAP_ID@@
68
+!endif
69
+
70
+!ifdef AMD64
71
+[@@PRODUCT_TAP_ID@@.NTamd64]
72
+!else
73
+[@@PRODUCT_TAP_ID@@]
74
+!endif
75
+   %DeviceDescription% = @@PRODUCT_TAP_ID@@.ndi, @@PRODUCT_TAP_ID@@
68 76
 
69 77
 ;---------------------------------------------------------------
70 78
 ;                             Driver Section (Done)
... ...
@@ -79,23 +91,23 @@
79 79
 ;    NCF_HAS_UI = 0x80
80 80
 ;----------------- Characteristics ------------
81 81
 
82
-[tap0901.ndi]
83
-   CopyFiles       = tap0901.driver, tap0901.files
84
-   AddReg          = tap0901.reg
85
-   AddReg          = tap0901.params.reg
86
-   Characteristics = 0x81
82
+[@@PRODUCT_TAP_ID@@.ndi]
83
+   CopyFiles       = @@PRODUCT_TAP_ID@@.driver, @@PRODUCT_TAP_ID@@.files
84
+   AddReg          = @@PRODUCT_TAP_ID@@.reg
85
+   AddReg          = @@PRODUCT_TAP_ID@@.params.reg
86
+   Characteristics = @@PRODUCT_TAP_CHARACTERISTICS@@
87 87
 
88
-[tap0901.ndi.Services]
89
-   AddService = tap0901,        2, tap0901.service
88
+[@@PRODUCT_TAP_ID@@.ndi.Services]
89
+   AddService = @@PRODUCT_TAP_ID@@,        2, @@PRODUCT_TAP_ID@@.service
90 90
 
91
-[tap0901.reg]
92
-   HKR, Ndi,            Service,      0, "tap0901"
91
+[@@PRODUCT_TAP_ID@@.reg]
92
+   HKR, Ndi,            Service,      0, "@@PRODUCT_TAP_ID@@"
93 93
    HKR, Ndi\Interfaces, UpperRange,   0, "ndis5"
94 94
    HKR, Ndi\Interfaces, LowerRange,   0, "ethernet"
95 95
    HKR, ,               Manufacturer, 0, "%Provider%"
96 96
    HKR, ,               ProductName,  0, "%DeviceDescription%"
97 97
 
98
-[tap0901.params.reg]
98
+[@@PRODUCT_TAP_ID@@.params.reg]
99 99
    HKR, Ndi\params\MTU,                  ParamDesc, 0, "MTU"
100 100
    HKR, Ndi\params\MTU,                  Type,      0, "int"
101 101
    HKR, Ndi\params\MTU,                  Default,   0, "1500"
... ...
@@ -136,13 +148,13 @@
136 136
 ;    SERVICE_DISABLED     = 0x4
137 137
 ;---------- Start Mode ---------------
138 138
 
139
-[tap0901.service]
139
+[@@PRODUCT_TAP_ID@@.service]
140 140
    DisplayName = %DeviceDescription%
141 141
    ServiceType = 1
142 142
    StartType = 3
143 143
    ErrorControl = 1
144 144
    LoadOrderGroup = NDIS
145
-   ServiceBinary = %12%\tap0901.sys
145
+   ServiceBinary = %12%\@@PRODUCT_TAP_ID@@.sys
146 146
 
147 147
 ;-----------------------------------------------------------------
148 148
 ;                                File Installation
... ...
@@ -158,25 +170,25 @@
158 158
 ; 1 = "Intel Driver Disk 1",e100bex.sys,,
159 159
 
160 160
 [SourceDisksNames]
161
-   1 = %DeviceDescription%, tap0901.sys
161
+   1 = %DeviceDescription%, @@PRODUCT_TAP_ID@@.sys
162 162
 
163 163
 ; SourceDisksFiles
164 164
 ; filename_on_source = diskID[, [subdir][, size]]
165 165
 ; e100bex.sys = 1,, ; on distribution disk 1
166 166
 
167 167
 [SourceDisksFiles]
168
-tap0901.sys = 1
168
+@@PRODUCT_TAP_ID@@.sys = 1
169 169
 
170 170
 [DestinationDirs]
171
-   tap0901.files  = 11
172
-   tap0901.driver = 12
171
+   @@PRODUCT_TAP_ID@@.files  = 11
172
+   @@PRODUCT_TAP_ID@@.driver = 12
173 173
 
174
-[tap0901.files]
174
+[@@PRODUCT_TAP_ID@@.files]
175 175
 ;   TapPanel.cpl,,,6   ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
176 176
 ;   cipsrvr.exe,,,6     ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
177 177
 
178
-[tap0901.driver]
179
-   tap0901.sys,,,6     ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
178
+[@@PRODUCT_TAP_ID@@.driver]
179
+   @@PRODUCT_TAP_ID@@.sys,,,6     ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
180 180
 
181 181
 ;---------------------------------------------------------------
182 182
 ;                                      End
183 183
deleted file mode 100644
... ...
@@ -1,14 +0,0 @@
1
-+++ amd64/OemWin2k.inf	Mon Mar  5 23:17:35 2007
2
-@@ -61,9 +61,9 @@
3
- ;                      Manufacturer + Product Section (Done)
4
- ;----------------------------------------------------------------
5
- [Manufacturer]
6
--   %Provider% = tap0901
7
-+   %Provider% = tap0901, NTamd64
8
- 
9
--[tap0901]
10
-+[tap0901.NTamd64]
11
-    %DeviceDescription% = tap0901.ndi, tap0901
12
- 
13
- ;---------------------------------------------------------------
... ...
@@ -58,7 +58,7 @@
58 58
 //========================================================
59 59
 // Check for truncated IPv4 packets, log errors if found.
60 60
 //========================================================
61
-#define PACKET_TRUNCATION_CHECK 1 // JYFIXME
61
+#define PACKET_TRUNCATION_CHECK 0
62 62
 
63 63
 //========================================================
64 64
 // EXPERIMENTAL -- Configure TAP device object to be
... ...
@@ -68,7 +68,7 @@
68 68
 // Duplicates the functionality of OpenVPN's
69 69
 // --allow-nonadmin directive.
70 70
 //========================================================
71
-#define ENABLE_NONADMIN 1         // JYFIXME
71
+#define ENABLE_NONADMIN 1
72 72
 
73 73
 #if DDKVER < 5600
74 74
 #include <ndis.h>
... ...
@@ -1413,7 +1413,8 @@ AdapterTransmit (IN NDIS_HANDLE p_AdapterContext,
1413 1413
 		 IN UINT p_Flags)
1414 1414
 {
1415 1415
   TapAdapterPointer l_Adapter = (TapAdapterPointer) p_AdapterContext;
1416
-  ULONG l_Index = 0, l_BufferLength = 0, l_PacketLength = 0;
1416
+  ULONG l_Index = 0, l_PacketLength = 0;
1417
+  UINT l_BufferLength = 0;
1417 1418
   PIRP l_IRP;
1418 1419
   TapPacketPointer l_PacketBuffer;
1419 1420
   PNDIS_BUFFER l_NDIS_Buffer;
... ...
@@ -50,7 +50,7 @@
50 50
 
51 51
 #ifdef WIN32
52 52
 
53
-/* #define SIMULATE_DHCP_FAILED */       /* JYFIXME -- simulate bad DHCP negotiation */
53
+/* #define SIMULATE_DHCP_FAILED */       /* simulate bad DHCP negotiation */
54 54
 
55 55
 #define NI_TEST_FIRST  (1<<0)
56 56
 #define NI_IP_NETMASK  (1<<1)
... ...
@@ -1,2 +1,2 @@
1 1
 dnl define the OpenVPN version
2
-define(PRODUCT_VERSION,[2.1_rc3])
2
+define(PRODUCT_VERSION,[2.1_rc3a])