From: Alon Bar-Lev Date: Wed, 29 Feb 2012 22:37:34 +0200 Message-Id: <1330547854-18889-9-git-send-email-alon.barlev@...277...> In-Reply-To: <1330547702-18756-1-git-send-email-alon.barlev@...277...> References: <1330547702-18756-1-git-send-email-alon.barlev@...277...> Subject: [Openvpn-devel] [tap-windows 11/11] build: initial build List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Cc: Alon Bar-Lev Signed-off-by: Alon Bar-Lev --- .gitignore | 7 +- _build.bat | 49 +++++++ build.bat | 55 ++++++++ build/MSCV-VSClass3.cer | 29 ++++ build/msvc-generate.js | 118 +++++++++++++++++ build/unix2dos.js | 54 ++++++++ build/vars.amd64.m4 | 2 + build/vars.i386.m4 | 2 + build/zip.js | 74 +++++++++++ config-env.bat.in | 12 ++ configure.bat | 88 +++++++++++++ installer/StrStr.nsi | 47 +++++++ installer/build.bat | 88 +++++++++++++ installer/icon.ico | Bin 0 -> 22486 bytes installer/install-whirl.bmp | Bin 0 -> 25820 bytes installer/tap-windows.nsi | 296 +++++++++++++++++++++++++++++++++++++++++++ src/OemWin2k.inf.in | 187 +++++++++++++++++++++++++++ src/SOURCES.in | 7 +- src/config.h.in | 9 ++ src/error.c | 4 +- src/i386/OemWin2k.inf.in | 195 ---------------------------- src/resource.rc | 8 +- src/tapdrvr.c | 9 +- version.m4 | 11 ++ 24 files changed, 1144 insertions(+), 207 deletions(-) create mode 100644 _build.bat create mode 100644 build.bat create mode 100644 build/MSCV-VSClass3.cer create mode 100644 build/msvc-generate.js create mode 100644 build/unix2dos.js create mode 100644 build/vars.amd64.m4 create mode 100644 build/vars.i386.m4 create mode 100644 build/zip.js create mode 100644 config-env.bat.in create mode 100644 configure.bat create mode 100755 installer/StrStr.nsi create mode 100644 installer/build.bat create mode 100755 installer/icon.ico create mode 100755 installer/install-whirl.bmp create mode 100755 installer/tap-windows.nsi create mode 100755 src/OemWin2k.inf.in create mode 100644 src/config.h.in delete mode 100755 src/i386/OemWin2k.inf.in create mode 100644 version.m4 diff --git a/.gitignore b/.gitignore index 230ee15..f10f92d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,15 @@ *.pdb *.sys *.map +*.cat *.cod +*.exe +*.zip +tmp +config-local.m4 +config-env.bat src/obj* src/amd64 src/i386 src/SOURCES -src/i386/OemWin2k.inf src/config.h diff --git a/_build.bat b/_build.bat new file mode 100644 index 0000000..718feb2 --- /dev/null +++ b/_build.bat @@ -0,0 +1,49 @@ +@echo off +rem TAP-Windows -- A kernel driver to provide virtual tap +rem device functionality on Windows. +rem +rem Copyright (C) 2012 Alon Bar-Lev +rem +rem This program is free software; you can redistribute it and/or modify +rem it under the terms of the GNU General Public License as published by +rem the Free Software Foundation; either version 2 of the License, or +rem (at your option) any later version. +rem +rem This program is distributed in the hope that it will be useful, +rem but WITHOUT ANY WARRANTY; without even the implied warranty of +rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +rem GNU General Public License for more details. +rem +rem You should have received a copy of the GNU General Public License +rem along with this program (see the file COPYING included with this +rem distribution); if not, write to the Free Software Foundation, Inc., +rem 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +setlocal enableextensions enabledelayedexpansion + +set root=%cd% +set myos=%1 +set myprofile=%2 +set mymode=fre + +echo Building %myos%-%myprofile%-%mymode% + +call "%DDK%\bin\setenv" %DDK% %mymode% %myprofile% %myos% no_oacr +if errorlevel 1 goto error + +cd /d %root% +cd src +nmake +if errorlevel 1 goto error + +set rc=0 +goto end + +:error +echo FAIL %myos%-%myprofile%-%mymode% +set rc=1 +goto end + +:end + +endlocal diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..839be8c --- /dev/null +++ b/build.bat @@ -0,0 +1,55 @@ +@echo off +rem TAP-Windows -- A kernel driver to provide virtual tap +rem device functionality on Windows. +rem +rem Copyright (C) 2012 Alon Bar-Lev +rem +rem This program is free software; you can redistribute it and/or modify +rem it under the terms of the GNU General Public License as published by +rem the Free Software Foundation; either version 2 of the License, or +rem (at your option) any later version. +rem +rem This program is distributed in the hope that it will be useful, +rem but WITHOUT ANY WARRANTY; without even the implied warranty of +rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +rem GNU General Public License for more details. +rem +rem You should have received a copy of the GNU General Public License +rem along with this program (see the file COPYING included with this +rem distribution); if not, write to the Free Software Foundation, Inc., +rem 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +cd %0\.. + +if not exist config-env.bat ( + echo please run configure + exit /b 1 +) + +setlocal + +call config-env.bat + +for /d %%d in (src\obj*) do rmdir /q /s %%d > nul 2>&1 +for %%f in (src\amd64\*.sys src\i386\*.sys) do del /s %%f > nul 2>&1 + +cmd /c _build WXP x86 +if errorlevel 1 goto error +cmd /c _build WIN7 x64 +if errorlevel 1 goto error + +call installer\build + +set rc=0 +goto end + +:error +echo FAIL +set rc=1 +goto end + +:end + +endlocal + +exit /b %rc% diff --git a/build/MSCV-VSClass3.cer b/build/MSCV-VSClass3.cer new file mode 100644 index 0000000..78eae54 --- /dev/null +++ b/build/MSCV-VSClass3.cer @@ -0,0 +1,29 @@ +-----BEGIN CERTIFICATE----- +MIIFAzCCAuugAwIBAgIKYQwSBgAAAAAAGzANBgkqhkiG9w0BAQUFADB/MQswCQYD +VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSkwJwYDVQQDEyBNaWNyb3Nv +ZnQgQ29kZSBWZXJpZmljYXRpb24gUm9vdDAeFw0wNjA1MjMxNzAxMjlaFw0xNjA1 +MjMxNzExMjlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5j +LjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eT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ple8J2qPlvu9g7NlUoFmc +KL1U72YVf4dMhNumDpVnLlF7NDm2QcKMhGgm3CQCCeeBjgqXLe/up7mYpg+BjccQ +teHtmC9Ib1OFSWR4m+xdrJcLVSbD77qNyNGlL1p/k2thGjObGLiiYhDeJOp24S9D +6+zdfBI0JInaKFWu5XVOMStnY7ao16tzCgPOxepZP8frKkWuqGJbLwCZOau0X3PD +COyAEY9HDo8qE0PhkQZiVbv/uj2pqT0mD67KfWKLFVWJ1pQ0TdZl +-----END CERTIFICATE----- diff --git a/build/msvc-generate.js b/build/msvc-generate.js new file mode 100644 index 0000000..d9564cf --- /dev/null +++ b/build/msvc-generate.js @@ -0,0 +1,118 @@ +/* + * msvc-generate.js - string transformation + * + * Copyright (C) 2008-2012 Alon Bar-Lev + * + * BSD License + * ============ + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * o Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * o Neither the name of the Alon Bar-Lev nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +var ForReading = 1; +var fso = new ActiveXObject("Scripting.FileSystemObject"); +var input = "nul"; +var output = "nul"; +var files = new Array(); +var env = new Array(); + +function initialize() { + for (var i=0;i + * + * BSD License + * ============ + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * o Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * o Neither the name of the Alon Bar-Lev nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +var ForReading = 1; + +try { + var fso = new ActiveXObject("Scripting.FileSystemObject"); + for (var i=0;i + * + * BSD License + * ============ + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * o Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * o Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * o Neither the name of the Alon Bar-Lev nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +var ForReading = 0; +var ForWriting = 1; +var fso = new ActiveXObject("Scripting.FileSystemObject"); + +function zip(source, destination) { + try { + var f = OpenTextFile(destination, ForReading); + f.Close(); + } + catch(e) { + var f = fso.CreateTextFile(destination, ForWriting); + var zipheader = "PK" + String.fromCharCode(5) + String.fromCharCode(6); + for (var i=0;i<18;i++) { + zipheader += String.fromCharCode(0); + } + f.Write(zipheader); + f.Close(); + } + + var shell = new ActiveXObject("Shell.Application"); + var source = shell.NameSpace(fso.GetAbsolutePathName(source)); + var destination = shell.NameSpace(fso.GetAbsolutePathName(destination)); + + destination.CopyHere(source.Items(), 4); + while(source.Items().Count != destination.Items().Count) { + WScript.Sleep(1000); + } +} + +var index = 0; +var source = WScript.Arguments(index++); +var destination = WScript.Arguments(index++); +try { + zip(source, destination); + WScript.Quit(0); +} +catch(e) { + WScript.Echo("ERROR: Cannot zip '" + destination + "'."); + WScript.Quit(1); +} + diff --git a/config-env.bat.in b/config-env.bat.in new file mode 100644 index 0000000..ed38c15 --- /dev/null +++ b/config-env.bat.in @@ -0,0 +1,12 @@ +set DDK=@DDK@ +set DEVCON32=@DEVCON32@ +set DEVCON64=@DEVCON64@ +set DEVCON_BASENAME=@DEVCON_BASENAME@ +set SIGNTOOL=@SIGNTOOL@ +set MAKENSIS=@MAKENSIS@ +set CODESIGN_PKCS12=@CODESIGN_PKCS12@ +set CODESIGN_PASS=@CODESIGN_PASS@ +set PRODUCT_TAP_WIN_COMPONENT_ID=@PRODUCT_TAP_WIN_COMPONENT_ID@ +set PRODUCT_NAME=@PRODUCT_NAME@ +set PRODUCT_VERSION=@PRODUCT_VERSION@ +set OUTDIR=@OUTDIR@ diff --git a/configure.bat b/configure.bat new file mode 100644 index 0000000..8673d5a --- /dev/null +++ b/configure.bat @@ -0,0 +1,88 @@ +@echo off +rem TAP-Windows -- A kernel driver to provide virtual tap +rem device functionality on Windows. +rem +rem Copyright (C) 2012 Alon Bar-Lev +rem +rem This program is free software; you can redistribute it and/or modify +rem it under the terms of the GNU General Public License as published by +rem the Free Software Foundation; either version 2 of the License, or +rem (at your option) any later version. +rem +rem This program is distributed in the hope that it will be useful, +rem but WITHOUT ANY WARRANTY; without even the implied warranty of +rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +rem GNU General Public License for more details. +rem +rem You should have received a copy of the GNU General Public License +rem along with this program (see the file COPYING included with this +rem distribution); if not, write to the Free Software Foundation, Inc., +rem 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +cd %0\.. + +if "%1"=="--help" ( + echo %0 + echo Environment: + echo DDK DDK home + echo SIGNTOOL signtool, default from DDK + echo DEVCON32 devcon, default from DDK + echo DEVCON64 devcon, default from DDK + echo MAKENSIS nullsoft installer + echo CODESIGN_PKCS12 Code sign PKCS#12 optional + echo CODESIGN_PASS Code sign password + echo OUTDIR Output directory + exit /b 1 +) + +setlocal + +if "%DDK%"=="" for /d %%f in (c:\WINDDK\*) do set DDK=%%f + +if "%DDK%"=="" ( + echo cannot find ddk + goto error +) + +if "%SIGNTOOL%"=="" set SIGNTOOL=%DDK%\bin\x86\signtool.exe +if "%DEVCON32%"=="" set DEVCON32=%DDK%\tools\devcon\i386\devcon.exe +if "%DEVCON64%"=="" set DEVCON64=%DDK%\tools\devcon\amd64\devcon.exe +for /f %%f in ("%DEVCON32%") do set DEVCON_BASENAME=%%~nf%%~xf + +if "%MAKENSIS%"=="" for /d %%f in ("%ProgramFiles%\NSIS" "%ProgramFiles(x86)%\NSIS") do if exist "%%f" set MAKENSIS=%%~f + +if "%MAKENSIS%"=="" ( + echo cannot find nsis + goto error +) + +if "%OUTDIR%"=="" set OUTDIR=%cd% + +set msvcg_args=cscript //nologo build/msvc-generate.js --config=version.m4 +if exist config-local.m4 set msvcg_args=%msvcg_args% --config=config-local.m4 +set msvcg_args=%msvcg_args% --var=DDK="%DDK%" --var=MAKENSIS="%MAKENSIS%" --var=SIGNTOOL="%SIGNTOOL%" --var=DEVCON32="%DEVCON32%" --var=DEVCON64="%DEVCON64%" --var=DEVCON_BASENAME="%DEVCON_BASENAME%" --var=EXTRA_C_DEFINES="%EXTRA_C_DEFINES%" --var=CODESIGN_PKCS12="%CODESIGN_PKCS12%" --var=CODESIGN_PASS="%CODESIGN_PASS%" --var=OUTDIR="%OUTDIR%" + +for %%f in (config-env.bat src\SOURCES src\config.h) do ( + %msvcg_args% --input=%%f.in --output=%%f + if errorlevel 1 goto error +) + +for %%a in (i386 amd64) do ( + mkdir src\%%a > nul 2>&1 + %msvcg_args% --config=build\vars.%%a.m4 --input=src\OemWin2k.inf.in --output=src\%%a\OemWin2k.inf + if errorlevel 1 goto error +) + +set rc=0 +goto end + +:error +echo FAILED +set rc=1 +goto end + +:end + +endlocal + +exit /b %rc% diff --git a/installer/StrStr.nsi b/installer/StrStr.nsi new file mode 100755 index 0000000..0bad0f2 --- /dev/null +++ b/installer/StrStr.nsi @@ -0,0 +1,47 @@ +;==================================================== +; StrStr - Finds a given string in another given string. +; Returns -1 if not found and the pos if found. +; Input: head of the stack - string to find +; second in the stack - string to find in +; Output: head of the stack +;==================================================== +!macro StrStr un +Function ${un}StrStr + Push $0 + Exch + Pop $0 ; $0 now have the string to find + Push $1 + Exch 2 + Pop $1 ; $1 now have the string to find in + Exch + Push $2 + Push $3 + Push $4 + Push $5 + + StrCpy $2 -1 + StrLen $3 $0 + StrLen $4 $1 + IntOp $4 $4 - $3 + + StrStr_loop: + IntOp $2 $2 + 1 + IntCmp $2 $4 0 0 StrStrReturn_notFound + StrCpy $5 $1 $3 $2 + StrCmp $5 $0 StrStr_done StrStr_loop + + StrStrReturn_notFound: + StrCpy $2 -1 + + StrStr_done: + Pop $5 + Pop $4 + Pop $3 + Exch $2 + Exch 2 + Pop $0 + Pop $1 +FunctionEnd +!macroend +!insertmacro StrStr "" +;!insertmacro StrStr "un." diff --git a/installer/build.bat b/installer/build.bat new file mode 100644 index 0000000..79405b5 --- /dev/null +++ b/installer/build.bat @@ -0,0 +1,88 @@ +@echo off +rem TAP-Windows -- A kernel driver to provide virtual tap +rem device functionality on Windows. +rem +rem Copyright (C) 2012 Alon Bar-Lev +rem +rem This program is free software; you can redistribute it and/or modify +rem it under the terms of the GNU General Public License as published by +rem the Free Software Foundation; either version 2 of the License, or +rem (at your option) any later version. +rem +rem This program is distributed in the hope that it will be useful, +rem but WITHOUT ANY WARRANTY; without even the implied warranty of +rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +rem GNU General Public License for more details. +rem +rem You should have received a copy of the GNU General Public License +rem along with this program (see the file COPYING included with this +rem distribution); if not, write to the Free Software Foundation, Inc., +rem 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +setlocal + +set wd=%cd% +cd %0\.. + +if "%MAKENSIS%"=="" call ..\config-env.bat + +if "%OUTDIR%"=="" set OUTDIR=. +set OUTPUT=%OUTDIR%\tap-windows-%PRODUCT_VERSION% +set TAP_ROOT=tmp\image\tap-windows-%PRODUCT_VERSION% + +del "%OUTPUT%.*" > nul 2>&1 +rmdir /q /s tmp > nul 2>&1 + +mkdir %TAP_ROOT%\include +copy ..\src\tap-windows.h %TAP_ROOT%\include +if errorlevel 1 goto error +mkdir %TAP_ROOT%\i386 +copy ..\src\i386\* %TAP_ROOT%\i386 +if errorlevel 1 goto error +mkdir %TAP_ROOT%\amd64 +copy ..\src\amd64\* %TAP_ROOT%\amd64 +if errorlevel 1 goto error + +type ..\COPYING > %TAP_ROOT%\license.txt +type ..\COPYRIGHT.GPL >> %TAP_ROOT%\license.txt +cscript //nologo ..\build\unix2dos.js %TAP_ROOT%\license.txt +if errorlevel 1 goto error + +"%DDK%\bin\selfsign\inf2cat" /driver:%TAP_ROOT%\i386 /os:XP_X86,Vista_X86,7_X86,Server2003_X86,Server2008_X86 +"%DDK%\bin\selfsign\inf2cat" /driver:%TAP_ROOT%\amd64 /os:XP_X64,Vista_X64,7_X64,Server2003_X64,Server2008_X64,Server2008R2_X64 + +if not "%CODESIGN_PKCS12%"=="" ( + for %%a in (i386 amd64) do ( + "%SIGNTOOL%" sign /v /p "%CODESIGN_PASS%" /f "%CODESIGN_PKCS12%" /ac ..\build\MSCV-VSClass3.cer /t http://timestamp.verisign.com/scripts/timestamp.dll "%TAP_ROOT%\%%a\%PRODUCT_TAP_WIN_COMPONENT_ID%.sys" + "%SIGNTOOL%" sign /v /p "%CODESIGN_PASS%" /f "%CODESIGN_PKCS12%" /ac ..\build\MSCV-VSClass3.cer /t http://timestamp.verisign.com/scripts/timestamp.dll "%TAP_ROOT%\%%a\%PRODUCT_TAP_WIN_COMPONENT_ID%.cat" + if errorlevel 1 goto error + ) +) + +cscript //nologo ..\build\zip.js tmp\image "%OUTPUT%.zip" +if errorlevel 1 goto error + +"%MAKENSIS%\makensis" -DDEVCON32="%DEVCON32%" -DDEVCON64="%DEVCON64%" -DDEVCON_BASENAME="%DEVCON_BASENAME%" -DPRODUCT_TAP_WIN_COMPONENT_ID="%PRODUCT_TAP_WIN_COMPONENT_ID%" -DPRODUCT_NAME="%PRODUCT_NAME%" -DPRODUCT_VERSION="%PRODUCT_VERSION%" -DOUTPUT="%OUTPUT%.exe" -DIMAGE="%TAP_ROOT%" tap-windows.nsi +if errorlevel 1 goto error + +if not "%CODESIGN_PKCS12%"=="" ( + "%SIGNTOOL%" sign /v /p "%CODESIGN_PASS%" /f "%CODESIGN_PKCS12%" /t http://timestamp.verisign.com/scripts/timestamp.dll "%OUTPUT%.exe" + if errorlevel 1 goto error + ) +) + +set rc=0 +goto end + +:error +echo FATAL +set rc=1 +goto end + +:end + +cd %wd% + +endlocal + +exit /b %rc% diff --git a/installer/icon.ico b/installer/icon.ico new file mode 100755 index 0000000000000000000000000000000000000000..03ea0b1dccf355d4f5ac877c0918b374c7b7c4ee GIT binary patch literal 22486 zcmeHP2Xs`$*PoC;=v7f_5_*>+QUvK$P!N@...1554...&#s6adn3Cc*gzDOq9}-B14RTxYJhzUGl_C#1_)mt@...1559... zhY!h|JSo4}k}aS6E>k*ZdF4y`#_W$EM4PYqI1mA7;oufZq@...1560...+H*WtF4~nX z&!0OdQ%>i}XCeQtojc_7pjGb`k91)VP8>fjm+a1wlYhvPA8g2yxsdJ9!4$b*N47ln zSDswGYK0u~Q3lqUA#-zc<=vlq<>7+|WmZpxITd?*{9K;A{o@...1561...| z`2Oqbwk+vzbaDjPqHc3IN;{if6&rhPb!SzF_vXoAGre-}$y|97Hfa%T(t=$%@*db5+UL)ULivG{=kw%1*z6y- zZI$C!X31BUWy$SZx5!z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D9A(K z6o|in-^0MG4=5<_^vCC2u(CnD@...1602...|X+<;(OL@...1603...|w)#>Z1YWaue*PRg|%1+t3 z0GRh52yspd@...1604...(SL7puktbxBv8gVG>&P05_rQ#ps4ubl#F+^GD<8)5{ zMTm2_X1*`VSMvAU4;E~-ub~uVqfI#&U>(ehCju%1RP6Kl!gZqQ%lJJPK2gz3@...1605...) z9Ba)voLiWf<23NAtGS3H8sqom_wgMB<2c)0F7x;f0NR&(09^qU0en}K?4K@...1606... zw#A;MK$G_*{yJMw+la-umkFLL0Ft(bfLjuv`12e_eF0rswp__(TZfXDGP939 zk8$(3uYVFvUOr>Ld!WssfAr^5P@...1499...#tL&e{apKExp5c5fQA)qwCh`V6B`%E|{#?Sdl z%wLkE;tR^FWnPGHgeK12CT^Kz-kJDxhB17o@...1607...%6tf3MU!r^~wN3-t~_(^-u<(H1S< zW5U1DKlH`DCcoLb}}AvoN|Ri>r3!7V#U8NKi9~6x8#3e9Vfu!AwVemT3DQlp!+%? z4G_v676vB=G^YYCRo4r%7RF8!0o<#?$QTGW6*N8pv<4JLhRcC_C3sS=J_RuLWn36Y zMtdLkIR)@F;9h_ci~sww`>&rd4P(GQfDr)RZ!@NSA3&XB-g6V65uhZ%fBq%4rHl{b z|2ouHCK>HxN#V!X|5{S`L6(t8;VCHd!c)Ri+(P7_OzI?rH#{XWDGHx2vBYOesbNN$ z5|$bn&(E2{Qp?5jb0&L_{u?=29OUjUM zo=L}~8&5t4-zdcwtBprH2|FMtr*P-7Oc7CDLHYTwz)%`AP2S*v@...1611...!+9s>D9v+bev1 hg?)-gDe+$tKG0&Bf+ewp&`~VaM_MRlQaJbh{{ZxLA(a3C literal 0 HcmV?d00001 diff --git a/installer/install-whirl.bmp b/installer/install-whirl.bmp new file mode 100755 index 0000000000000000000000000000000000000000..03f33fce96789420beb692679093506ca0685469 GIT binary patch literal 25820 zcmeI5`EOlE701he!EbZ{T4*ToS~jU5#3q&`ZPG$R>5}eg zplg~^pbJam=j=|L#QT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U&~dO1~F?m!_vBs z9E?wqq+eY=ZU9aiO@...1651...`zN>mpl)0@...1652...;9F>elIa@...1653...!dDMf2G0G=U^8Wjac4r?1h$M%z1&>y%b*j!VV?XQimsEpj66*iLs2%=SLgal~}Wh8Gf7|KEnU3458 zOX>VN{#e9sQ!#`F0BIrdH+)KrO#^{x%2INZiB*I0SCNkHVrUINbMka}-`=^;KAbU{ z(C$cr8z~PLs6O*>_TD{nrNqx~Y9;3}L4`y3gqVf=xx*5pg@...1655...!586ry`HE zBPp75-|k(=D)-}x|42f73scK>iqTuDQ;E}P%M1YYNF|m_ttBy(R_7MNrjy~eriBev zd19MCeI?I%BYRilaLE(gQo~u9<-{tnLEJMltwG>LN6TelOd0+NPw3@...1656...{gEeFF zGc%MSE#gTOH-(jJ8nKT`R52MPoI1N6XZTGcuGFPvwSLOLaM6Y * +; * This program is free software; you can redistribute it and/or modify * +; * it under the terms of the GNU General Public License version 2 * +; * as published by the Free Software Foundation. * +; **************************************************************************** + +; TAP-Windows install script for Windows, using NSIS + +SetCompressor lzma + +!include "MUI.nsh" + +!include "StrStr.nsi" + +;-------------------------------- +;Configuration + +;General + +OutFile "${OUTPUT}" + +ShowInstDetails show +ShowUninstDetails show + +;Folder selection page +InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" + +;Remember install folder +InstallDirRegKey HKCU "Software\${PRODUCT_NAME}" "" + +;-------------------------------- +;Modern UI Configuration + +Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" + +!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 ${PRODUCT_NAME} processes or the ${PRODUCT_NAME} service if it is running. All DLLs are installed locally." + +!define MUI_COMPONENTSPAGE_SMALLDESC +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_ABORTWARNING +!define MUI_ICON "icon.ico" +!define MUI_UNICON "icon.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "install-whirl.bmp" +!define MUI_UNFINISHPAGE_NOAUTOCLOSE + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "${IMAGE}\license.txt" +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +;-------------------------------- +;Languages + +!insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Language Strings + +LangString DESC_SecTAP ${LANG_ENGLISH} "Install/Upgrade the TAP virtual device driver. Will not interfere with CIPE." +LangString DESC_SecTAPSDK ${LANG_ENGLISH} "Install the TAP SDK." + +;-------------------------------- +;Reserve Files + +;Things that need to be extracted on first (keep these lines before any File command!) +;Only useful for BZIP2 compression + +ReserveFile "install-whirl.bmp" + +;-------------------------------- +;Macros + +!macro IsAdmin + UserInfo::GetName + ${Unless} ${Errors} + Pop $R0 + UserInfo::GetAccountType + Pop $R1 + ${If} $R1 != "Admin" + Messagebox MB_OK "Administrator privileges required to install/uninstall ${PRODUCT_NAME} [$R0/$R1]" + Abort + ${EndIf} + ${EndUnlesS} +!macroend + +;------------------------------------------ +;Set reboot flag based on tapinstall return + +Function CheckReboot + ${If} $R0 == "" + IntOp $R0 0 & 0 + SetRebootFlag true + DetailPrint "REBOOT flag set" + ${EndIf} +FunctionEnd + +;-------------------------------- +;Installer Sections + +Function .onInit + ClearErrors + !insertmacro IsAdmin + + # Delete previous start menu + RMDir /r $SMPROGRAMS\${PRODUCT_NAME} + +FunctionEnd + +Section "TAP Virtual Ethernet Adapter" SecTAP + + SetOverwrite on + + FileOpen $R0 "$INSTDIR\bin\addtap.bat" w + FileWrite $R0 "rem Add a new TAP virtual ethernet adapter$\r$\n" + FileWrite $R0 '"$INSTDIR\bin\${DEVCON_BASENAME}" install "$INSTDIR\driver\OemWin2k.inf" ${PRODUCT_TAP_WIN_COMPONENT_ID}$\r$\n' + FileWrite $R0 "pause$\r$\n" + FileClose $R0 + + FileOpen $R0 "$INSTDIR\bin\deltapall.bat" w + FileWrite $R0 "echo WARNING: this script will delete ALL TAP virtual adapters (use the device manager to delete adapters one at a time)$\r$\n" + FileWrite $R0 "pause$\r$\n" + FileWrite $R0 '"$INSTDIR\bin\${DEVCON_BASENAME}" remove ${PRODUCT_TAP_WIN_COMPONENT_ID}$\r$\n' + FileWrite $R0 "pause$\r$\n" + FileClose $R0 + + ; Check if we are running on a 64 bit system. + System::Call "kernel32::GetCurrentProcess() i .s" + System::Call "kernel32::IsWow64Process(i s, *i .R0)" + ${If} $R0 != 0 + ; tap-64bit: + DetailPrint "We are running on a 64-bit system." + + SetOutPath "$INSTDIR\bin" + File "${DEVCON64}" + + SetOutPath "$INSTDIR\driver" + File "${IMAGE}\amd64\OemWin2k.inf" + File "${IMAGE}\amd64\${PRODUCT_TAP_WIN_COMPONENT_ID}.cat" + File "${IMAGE}\amd64\${PRODUCT_TAP_WIN_COMPONENT_ID}.sys" + ${Else} + ; tap-32bit + DetailPrint "We are running on a 32-bit system." + + SetOutPath "$INSTDIR\bin" + File "${DEVCON32}" + + SetOutPath "$INSTDIR\driver" + File "${IMAGE}\i386\OemWin2k.inf" + File "${IMAGE}\i386\${PRODUCT_TAP_WIN_COMPONENT_ID}.cat" + File "${IMAGE}\i386\${PRODUCT_TAP_WIN_COMPONENT_ID}.sys" + ${EndIf} +SectionEnd + +Section /o "TAP SDK" SecTAPSDK + SetOverwrite on + SetOutPath "$INSTDIR\include" + File "${IMAGE}\include\tap-windows.h" +SectionEnd + +;-------------------- +;Post-install section + +Section -post + + SetOverwrite on + + ; Store README, license, icon + SetOverwrite on + SetOutPath $INSTDIR + File "${IMAGE}\license.txt" + File "icon.ico" + + ${If} ${SectionIsSelected} ${SecTAP} + ; + ; install/upgrade TAP driver if selected, using devcon + ; + ; TAP install/update was selected. + ; Should we install or update? + ; If tapinstall error occurred, $R5 will + ; be nonzero. + IntOp $R5 0 & 0 + nsExec::ExecToStack '"$INSTDIR\bin\${DEVCON_BASENAME}" hwids ${PRODUCT_TAP_WIN_COMPONENT_ID}' + Pop $R0 # return value/error/timeout + IntOp $R5 $R5 | $R0 + DetailPrint "${DEVCON_BASENAME} hwids returned: $R0" + + ; If tapinstall output string contains "${PRODUCT_TAP_WIN_COMPONENT_ID}" we assume + ; that TAP device has been previously installed, + ; therefore we will update, not install. + Push "${PRODUCT_TAP_WIN_COMPONENT_ID}" + Call StrStr + Pop $R0 + + ${If} $R5 == 0 + ${If} $R0 == -1 + DetailPrint "TAP INSTALL (${PRODUCT_TAP_WIN_COMPONENT_ID})" + nsExec::ExecToLog '"$INSTDIR\bin\${DEVCON_BASENAME}" install "$INSTDIR\driver\OemWin2k.inf" ${PRODUCT_TAP_WIN_COMPONENT_ID}' + Pop $R0 # return value/error/timeout + Call CheckReboot + IntOp $R5 $R5 | $R0 + DetailPrint "${DEVCON_BASENAME} install returned: $R0" + ${Else} + DetailPrint "TAP UPDATE" + nsExec::ExecToLog '"$INSTDIR\bin\${DEVCON_BASENAME}" update "$INSTDIR\driver\OemWin2k.inf" ${PRODUCT_TAP_WIN_COMPONENT_ID}' + Pop $R0 # return value/error/timeout + Call CheckReboot + IntOp $R5 $R5 | $R0 + DetailPrint "${DEVCON_BASENAME} update returned: $R0" + ${EndIf} + ${EndIf} + + DetailPrint "${DEVCON_BASENAME} cumulative status: $R5" + ${If} $R5 != 0 + MessageBox MB_OK "An error occurred installing the TAP device driver." + ${EndIf} + + ; Store install folder in registry + WriteRegStr HKLM SOFTWARE\${PRODUCT_NAME} "" $INSTDIR + + ; Create shortcuts + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Utilities\Add a new TAP virtual ethernet adapter.lnk" "$INSTDIR\bin\addtap.bat" "" + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Utilities\Delete ALL TAP virtual ethernet adapters.lnk" "$INSTDIR\bin\deltapall.bat" "" + ${EndIf} + + ; Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + + ; Show up in Add/Remove programs + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" "${PRODUCT_NAME} ${PRODUCT_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\icon.ico" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayVersion" "${PRODUCT_VERSION}" + + ; Advise a reboot + ;Messagebox MB_OK "IMPORTANT: Rebooting the system is advised in order to finalize TAP driver installation/upgrade (this is an informational message only, pressing OK will not reboot)." + +SectionEnd + +;-------------------------------- +;Descriptions + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN +!insertmacro MUI_DESCRIPTION_TEXT ${SecTAP} $(DESC_SecTAP) +!insertmacro MUI_DESCRIPTION_TEXT ${SecTAPSDK} $(DESC_SecTAPSDK) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + +;-------------------------------- +;Uninstaller Section + +Function un.onInit + ClearErrors + !insertmacro IsAdmin +FunctionEnd + +Section "Uninstall" + DetailPrint "TAP REMOVE" + nsExec::ExecToLog '"$INSTDIR\bin\${DEVCON_BASENAME}" remove ${PRODUCT_TAP_WIN_COMPONENT_ID}' + Pop $R0 # return value/error/timeout + DetailPrint "${DEVCON_BASENAME} remove returned: $R0" + + Delete "$INSTDIR\bin\${DEVCON_BASENAME}" + Delete "$INSTDIR\bin\addtap.bat" + Delete "$INSTDIR\bin\deltapall.bat" + + Delete "$INSTDIR\driver\OemWin2k.inf" + Delete "$INSTDIR\driver\${PRODUCT_TAP_WIN_COMPONENT_ID}.cat" + Delete "$INSTDIR\driver\${PRODUCT_TAP_WIN_COMPONENT_ID}.sys" + + Delete "$INSTDIR\include\tap-windows.h" + + Delete "$INSTDIR\icon.ico" + Delete "$INSTDIR\license.txt" + Delete "$INSTDIR\Uninstall.exe" + + RMDir "$INSTDIR\bin" + RMDir "$INSTDIR\driver" + RMDir "$INSTDIR\include" + RMDir "$INSTDIR" + + DeleteRegKey HKCR "${PRODUCT_NAME}File" + DeleteRegKey HKLM "SOFTWARE\${PRODUCT_NAME}" + DeleteRegKey HKCU "Software\${PRODUCT_NAME}" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" + +SectionEnd diff --git a/src/OemWin2k.inf.in b/src/OemWin2k.inf.in new file mode 100755 index 0000000..ef73600 --- /dev/null +++ b/src/OemWin2k.inf.in @@ -0,0 +1,187 @@ +; **************************************************************************** +; * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. * +; * This program is free software; you can redistribute it and/or modify * +; * it under the terms of the GNU General Public License version 2 * +; * as published by the Free Software Foundation. * +; **************************************************************************** + +; SYNTAX CHECKER +; cd \WINDDK\3790\tools\chkinf +; chkinf c:\src\openvpn\tap-win32\i386\oemwin2k.inf +; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm + +; INSTALL/REMOVE DRIVER +; tapinstall install OemWin2k.inf TAP0901 +; tapinstall update OemWin2k.inf TAP0901 +; tapinstall remove TAP0901 + +;********************************************************* +; Note to Developers: +; +; If you are bundling the TAP-Windows driver with your app, +; you should try to rename it in such a way that it will +; not collide with other instances of TAP-Windows defined +; by other apps. Multiple versions of the TAP-Windows +; driver, each installed by different apps, can coexist +; on the same machine if you follow these guidelines. +; NOTE: these instructions assume you are editing the +; generated OemWin2k.inf file, not the source +; OemWin2k.inf.in file which is preprocessed by winconfig +; and uses macro definitions from settings.in. +; +; (1) Rename all tapXXXX instances in this file to +; something different (use at least 5 characters +; for this name!) +; (2) Change the "!define TAP" definition in openvpn.nsi +; to match what you changed tapXXXX to. +; (3) Change TARGETNAME in SOURCES to match what you +; changed tapXXXX to. +; (4) Change TAP_COMPONENT_ID in common.h to match what +; you changed tapXXXX to. +; (5) Change SZDEPENDENCIES in service.h to match what +; you changed tapXXXX to. +; (6) Change DeviceDescription and Provider strings. +; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you +; set DeviceDescription to. +; +;********************************************************* + +[Version] + Signature = "$Windows NT$" + CatalogFile = @PRODUCT_TAP_WIN_COMPONENT_ID@...1677... + ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} + Provider = %Provider% + Class = Net + +; This version number should match the version +; number given in SOURCES. + DriverVer=@PRODUCT_TAP_WIN_RELDATE@,@PRODUCT_TAP_WIN_MAJOR@...1678...@PRODUCT_TAP_WIN_MINOR@ + +[Strings] + DeviceDescription = "@PRODUCT_TAP_WIN_DEVICE_DESCRIPTION@" + Provider = "@PRODUCT_TAP_WIN_PROVIDER@" + +;---------------------------------------------------------------- +; Manufacturer + Product Section (Done) +;---------------------------------------------------------------- +[Manufacturer] + %Provider% = @PRODUCT_TAP_WIN_COMPONENT_ID@@INF_PROVIDER_SUFFIX@ + +[@PRODUCT_TAP_WIN_COMPONENT_ID@@INF_SECTION_SUFFIX@] + %DeviceDescription% = @PRODUCT_TAP_WIN_COMPONENT_ID@...1679..., @PRODUCT_TAP_WIN_COMPONENT_ID@ + +;--------------------------------------------------------------- +; Driver Section (Done) +;--------------------------------------------------------------- + +;----------------- Characteristics ------------ +; NCF_PHYSICAL = 0x04 +; NCF_VIRTUAL = 0x01 +; NCF_SOFTWARE_ENUMERATED = 0x02 +; NCF_HIDDEN = 0x08 +; NCF_NO_SERVICE = 0x10 +; NCF_HAS_UI = 0x80 +;----------------- Characteristics ------------ + +[@PRODUCT_TAP_WIN_COMPONENT_ID@...1679...] + CopyFiles = @PRODUCT_TAP_WIN_COMPONENT_ID@...1680..., @PRODUCT_TAP_WIN_COMPONENT_ID@...1681... + AddReg = @PRODUCT_TAP_WIN_COMPONENT_ID@...1682... + AddReg = @PRODUCT_TAP_WIN_COMPONENT_ID@...1683... + Characteristics = @PRODUCT_TAP_WIN_CHARACTERISTICS@ + +[@PRODUCT_TAP_WIN_COMPONENT_ID@...1684...] + AddService = @PRODUCT_TAP_WIN_COMPONENT_ID@, 2, @PRODUCT_TAP_WIN_COMPONENT_ID@...1685... + +[@PRODUCT_TAP_WIN_COMPONENT_ID@...1682...] + HKR, Ndi, Service, 0, "@PRODUCT_TAP_WIN_COMPONENT_ID@" + HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" + HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" + HKR, , Manufacturer, 0, "%Provider%" + HKR, , ProductName, 0, "%DeviceDescription%" + +[@PRODUCT_TAP_WIN_COMPONENT_ID@...1683...] + HKR, Ndi\params\MTU, ParamDesc, 0, "MTU" + HKR, Ndi\params\MTU, Type, 0, "int" + HKR, Ndi\params\MTU, Default, 0, "1500" + HKR, Ndi\params\MTU, Optional, 0, "0" + HKR, Ndi\params\MTU, Min, 0, "100" + HKR, Ndi\params\MTU, Max, 0, "1500" + HKR, Ndi\params\MTU, Step, 0, "1" + HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status" + HKR, Ndi\params\MediaStatus, Type, 0, "enum" + HKR, Ndi\params\MediaStatus, Default, 0, "0" + HKR, Ndi\params\MediaStatus, Optional, 0, "0" + HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled" + HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected" + HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address" + HKR, Ndi\params\MAC, Type, 0, "edit" + HKR, Ndi\params\MAC, Optional, 0, "1" + HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access" + HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum" + HKR, Ndi\params\AllowNonAdmin, Default, 0, "1" + HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0" + HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed" + HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed" + +;---------------------------------------------------------------- +; Service Section +;---------------------------------------------------------------- + +;---------- Service Type ------------- +; SERVICE_KERNEL_DRIVER = 0x01 +; SERVICE_WIN32_OWN_PROCESS = 0x10 +;---------- Service Type ------------- + +;---------- Start Mode --------------- +; SERVICE_BOOT_START = 0x0 +; SERVICE_SYSTEM_START = 0x1 +; SERVICE_AUTO_START = 0x2 +; SERVICE_DEMAND_START = 0x3 +; SERVICE_DISABLED = 0x4 +;---------- Start Mode --------------- + +[@PRODUCT_TAP_WIN_COMPONENT_ID@...1685...] + DisplayName = %DeviceDescription% + ServiceType = 1 + StartType = 3 + ErrorControl = 1 + LoadOrderGroup = NDIS + ServiceBinary = %12%\@PRODUCT_TAP_WIN_COMPONENT_ID@...1686... + +;----------------------------------------------------------------- +; File Installation +;----------------------------------------------------------------- + +;----------------- Copy Flags ------------ +; COPYFLG_NOSKIP = 0x02 +; COPYFLG_NOVERSIONCHECK = 0x04 +;----------------- Copy Flags ------------ + +; SourceDisksNames +; diskid = description[, [tagfile] [, , subdir]] +; 1 = "Intel Driver Disk 1",e100bex.sys,, + +[SourceDisksNames] + 1 = %DeviceDescription%, @PRODUCT_TAP_WIN_COMPONENT_ID@...1686... + +; SourceDisksFiles +; filename_on_source = diskID[, [subdir][, size]] +; e100bex.sys = 1,, ; on distribution disk 1 + +[SourceDisksFiles] +@PRODUCT_TAP_WIN_COMPONENT_ID@...1686... = 1 + +[DestinationDirs] + @PRODUCT_TAP_WIN_COMPONENT_ID@...1681... = 11 + @PRODUCT_TAP_WIN_COMPONENT_ID@...1680... = 12 + +[@PRODUCT_TAP_WIN_COMPONENT_ID@...1681...] +; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK +; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK + +[@PRODUCT_TAP_WIN_COMPONENT_ID@...1680...] + @PRODUCT_TAP_WIN_COMPONENT_ID@...1686...,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK + +;--------------------------------------------------------------- +; End +;--------------------------------------------------------------- diff --git a/src/SOURCES.in b/src/SOURCES.in index 2f77365..3e1ee81 100755 --- a/src/SOURCES.in +++ b/src/SOURCES.in @@ -4,7 +4,7 @@ MAJORCOMP=ntos MINORCOMP=ndis -TARGETNAME=@@PRODUCT_TAP_ID@@ +TARGETNAME=@PRODUCT_TAP_WIN_COMPONENT_ID@ TARGETTYPE=DRIVER TARGETPATH=. TARGETLIBS=$(DDK_LIB_PATH)\ndis.lib $(DDK_LIB_PATH)\ntstrsafe.lib @@ -13,8 +13,9 @@ INCLUDES=$(DDK_INCLUDE_PATH) .. # The TAP version numbers here must be >= # PRODUCT_TAP_WIN32_MIN_x values defined in version.m4 C_DEFINES= -C_DEFINES=$(C_DEFINES) -DTAP_DRIVER_MAJOR_VERSION=@@PRODUCT_TAP_MAJOR_VER@@ -C_DEFINES=$(C_DEFINES) -DTAP_DRIVER_MINOR_VERSION=@@PRODUCT_TAP_MINOR_VER@@ +C_DEFINES=$(C_DEFINES) @EXTRA_C_DEFINES@ +C_DEFINES=$(C_DEFINES) -DTAP_DRIVER_MAJOR_VERSION=@PRODUCT_TAP_WIN_MAJOR@ +C_DEFINES=$(C_DEFINES) -DTAP_DRIVER_MINOR_VERSION=@PRODUCT_TAP_WIN_MINOR@ # Produce the same symbolic information for both free & checked builds. # This will allow us to perform full source-level debugging on both diff --git a/src/config.h.in b/src/config.h.in new file mode 100644 index 0000000..322afa8 --- /dev/null +++ b/src/config.h.in @@ -0,0 +1,9 @@ +#define PRODUCT_NAME "@PRODUCT_NAME@" +#define PRODUCT_VERSION "@PRODUCT_VERSION@" +#define PRODUCT_VERSION_RESOURCE @PRODUCT_VERSION_RESOURCE@ +#define PRODUCT_TAP_WIN_COMPONENT_ID "@PRODUCT_TAP_WIN_COMPONENT_ID@" +#define PRODUCT_TAP_WIN_MAJOR @PRODUCT_TAP_WIN_MAJOR@ +#define PRODUCT_TAP_WIN_MINOR @PRODUCT_TAP_WIN_MINOR@ +#define PRODUCT_TAP_WIN_PROVIDER "@PRODUCT_TAP_WIN_PROVIDER@" +#define PRODUCT_TAP_WIN_DEVICE_DESCRIPTION "@PRODUCT_TAP_WIN_DEVICE_DESCRIPTION@" +#define PRODUCT_TAP_WIN_RELDATE "@PRODUCT_TAP_WIN_RELDATE@" diff --git a/src/error.c b/src/error.c index 271dafc..69e9ec6 100755 --- a/src/error.c +++ b/src/error.c @@ -95,7 +95,9 @@ MyDebugPrint (const unsigned char* format, ...) format, args); va_end (args); - +va_start (args, format); +vDbgPrintEx(DPFLTR_IHVDRIVER_ID , 1, format, args); +va_end (args); if (status == STATUS_SUCCESS) g_Debug.out = (unsigned int) (end - g_Debug.text); else diff --git a/src/i386/OemWin2k.inf.in b/src/i386/OemWin2k.inf.in deleted file mode 100755 index 34888f2..0000000 --- a/src/i386/OemWin2k.inf.in +++ /dev/null @@ -1,195 +0,0 @@ -; **************************************************************************** -; * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. * -; * This program is free software; you can redistribute it and/or modify * -; * it under the terms of the GNU General Public License version 2 * -; * as published by the Free Software Foundation. * -; **************************************************************************** - -; SYNTAX CHECKER -; cd \WINDDK\3790\tools\chkinf -; chkinf c:\src\openvpn\tap-win32\i386\oemwin2k.inf -; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm - -; INSTALL/REMOVE DRIVER -; tapinstall install OemWin2k.inf TAP0901 -; tapinstall update OemWin2k.inf TAP0901 -; tapinstall remove TAP0901 - -;********************************************************* -; Note to Developers: -; -; If you are bundling the TAP-Windows driver with your app, -; you should try to rename it in such a way that it will -; not collide with other instances of TAP-Windows defined -; by other apps. Multiple versions of the TAP-Windows -; driver, each installed by different apps, can coexist -; on the same machine if you follow these guidelines. -; NOTE: these instructions assume you are editing the -; generated OemWin2k.inf file, not the source -; OemWin2k.inf.in file which is preprocessed by winconfig -; and uses macro definitions from settings.in. -; -; (1) Rename all tapXXXX instances in this file to -; something different (use at least 5 characters -; for this name!) -; (2) Change the "!define TAP" definition in openvpn.nsi -; to match what you changed tapXXXX to. -; (3) Change TARGETNAME in SOURCES to match what you -; changed tapXXXX to. -; (4) Change TAP_COMPONENT_ID in common.h to match what -; you changed tapXXXX to. -; (5) Change SZDEPENDENCIES in service.h to match what -; you changed tapXXXX to. -; (6) Change DeviceDescription and Provider strings. -; (7) Change PRODUCT_STRING in constants.h to what you -; set DeviceDescription to. -; -;********************************************************* - -[Version] - Signature = "$Windows NT$" - CatalogFile = @@PRODUCT_TAP_ID@@.cat - ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} - Provider = %Provider% - Class = Net - -; This version number should match the version -; number given in SOURCES. - DriverVer=@@PRODUCT_TAP_RELDATE@@,@@PRODUCT_TAP_MAJOR_VER@@.00.00.@@PRODUCT_TAP_MINOR_VER@@ - -[Strings] - DeviceDescription = "@@PRODUCT_TAP_DEVICE_DESCRIPTION@@" - Provider = "@@PRODUCT_TAP_PROVIDER@@" - -;---------------------------------------------------------------- -; Manufacturer + Product Section (Done) -;---------------------------------------------------------------- -[Manufacturer] -!ifdef AMD64 - %Provider% = @@PRODUCT_TAP_ID@@, NTamd64 -!else - %Provider% = @@PRODUCT_TAP_ID@@ -!endif - -!ifdef AMD64 -[@@PRODUCT_TAP_ID@@.NTamd64] -!else -[@@PRODUCT_TAP_ID@@] -!endif - %DeviceDescription% = @@PRODUCT_TAP_ID@@.ndi, @@PRODUCT_TAP_ID@@ - -;--------------------------------------------------------------- -; Driver Section (Done) -;--------------------------------------------------------------- - -;----------------- Characteristics ------------ -; NCF_PHYSICAL = 0x04 -; NCF_VIRTUAL = 0x01 -; NCF_SOFTWARE_ENUMERATED = 0x02 -; NCF_HIDDEN = 0x08 -; NCF_NO_SERVICE = 0x10 -; NCF_HAS_UI = 0x80 -;----------------- Characteristics ------------ - -[@@PRODUCT_TAP_ID@@.ndi] - CopyFiles = @@PRODUCT_TAP_ID@@.driver, @@PRODUCT_TAP_ID@@.files - AddReg = @@PRODUCT_TAP_ID@@.reg - AddReg = @@PRODUCT_TAP_ID@@.params.reg - Characteristics = @@PRODUCT_TAP_CHARACTERISTICS@@ - -[@@PRODUCT_TAP_ID@@.ndi.Services] - AddService = @@PRODUCT_TAP_ID@@, 2, @@PRODUCT_TAP_ID@@.service - -[@@PRODUCT_TAP_ID@@.reg] - HKR, Ndi, Service, 0, "@@PRODUCT_TAP_ID@@" - HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" - HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" - HKR, , Manufacturer, 0, "%Provider%" - HKR, , ProductName, 0, "%DeviceDescription%" - -[@@PRODUCT_TAP_ID@@.params.reg] - HKR, Ndi\params\MTU, ParamDesc, 0, "MTU" - HKR, Ndi\params\MTU, Type, 0, "int" - HKR, Ndi\params\MTU, Default, 0, "1500" - HKR, Ndi\params\MTU, Optional, 0, "0" - HKR, Ndi\params\MTU, Min, 0, "100" - HKR, Ndi\params\MTU, Max, 0, "1500" - HKR, Ndi\params\MTU, Step, 0, "1" - HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status" - HKR, Ndi\params\MediaStatus, Type, 0, "enum" - HKR, Ndi\params\MediaStatus, Default, 0, "0" - HKR, Ndi\params\MediaStatus, Optional, 0, "0" - HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled" - HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected" - HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address" - HKR, Ndi\params\MAC, Type, 0, "edit" - HKR, Ndi\params\MAC, Optional, 0, "1" - HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access" - HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum" - HKR, Ndi\params\AllowNonAdmin, Default, 0, "1" - HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0" - HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed" - HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed" - -;---------------------------------------------------------------- -; Service Section -;---------------------------------------------------------------- - -;---------- Service Type ------------- -; SERVICE_KERNEL_DRIVER = 0x01 -; SERVICE_WIN32_OWN_PROCESS = 0x10 -;---------- Service Type ------------- - -;---------- Start Mode --------------- -; SERVICE_BOOT_START = 0x0 -; SERVICE_SYSTEM_START = 0x1 -; SERVICE_AUTO_START = 0x2 -; SERVICE_DEMAND_START = 0x3 -; SERVICE_DISABLED = 0x4 -;---------- Start Mode --------------- - -[@@PRODUCT_TAP_ID@@.service] - DisplayName = %DeviceDescription% - ServiceType = 1 - StartType = 3 - ErrorControl = 1 - LoadOrderGroup = NDIS - ServiceBinary = %12%\@@PRODUCT_TAP_ID@@.sys - -;----------------------------------------------------------------- -; File Installation -;----------------------------------------------------------------- - -;----------------- Copy Flags ------------ -; COPYFLG_NOSKIP = 0x02 -; COPYFLG_NOVERSIONCHECK = 0x04 -;----------------- Copy Flags ------------ - -; SourceDisksNames -; diskid = description[, [tagfile] [, , subdir]] -; 1 = "Intel Driver Disk 1",e100bex.sys,, - -[SourceDisksNames] - 1 = %DeviceDescription%, @@PRODUCT_TAP_ID@@.sys - -; SourceDisksFiles -; filename_on_source = diskID[, [subdir][, size]] -; e100bex.sys = 1,, ; on distribution disk 1 - -[SourceDisksFiles] -@@PRODUCT_TAP_ID@@.sys = 1 - -[DestinationDirs] - @@PRODUCT_TAP_ID@@.files = 11 - @@PRODUCT_TAP_ID@@.driver = 12 - -[@@PRODUCT_TAP_ID@@.files] -; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK -; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK - -[@@PRODUCT_TAP_ID@@.driver] - @@PRODUCT_TAP_ID@@.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK - -;--------------------------------------------------------------- -; End -;--------------------------------------------------------------- diff --git a/src/resource.rc b/src/resource.rc index ed7cf20..b669c34 100755 --- a/src/resource.rc +++ b/src/resource.rc @@ -1,6 +1,8 @@ #include #include +#include "config.h" + #undef VER_PRODUCTVERSION #undef VER_PRODUCTVERSION_STR #undef VER_COMPANYNAME_STR @@ -36,18 +38,18 @@ #define VER_COMPANYNAME_STR "The OpenVPN Project" #define VER_FILEDESCRIPTION_STR "TAP-Windows Virtual Network Driver" -#define VER_ORIGINALFILENAME_STR PRODUCT_TAP_ID ".sys" +#define VER_ORIGINALFILENAME_STR PRODUCT_TAP_WIN_COMPONENT_ID ".sys" #define VER_LEGALCOPYRIGHT_YEARS "2003-2010" #define VER_LEGALCOPYRIGHT_STR "OpenVPN Technologies, Inc." #define VER_PRODUCTNAME_STR VER_FILEDESCRIPTION_STR -#define VER_PRODUCTVERSION TAP_DRIVER_MAJOR_VERSION,00,00,TAP_DRIVER_MINOR_VERSION +#define VER_PRODUCTVERSION PRODUCT_TAP_WIN_MAJOR,00,00,PRODUCT_TAP_WIN_MINOR #define XSTR(s) STR(s) #define STR(s) #s -#define VSTRING PACKAGE_VERSION " " XSTR(TAP_DRIVER_MAJOR_VERSION) "/" XSTR(TAP_DRIVER_MINOR_VERSION) +#define VSTRING PRODUCT_VERSION " " XSTR(PRODUCT_TAP_WIN_MAJOR) "/" XSTR(PRODUCT_TAP_WIN_MINOR) #ifdef DBG #define VER_PRODUCTVERSION_STR VSTRING " (DEBUG)" diff --git a/src/tapdrvr.c b/src/tapdrvr.c index d183902..43eca58 100755 --- a/src/tapdrvr.c +++ b/src/tapdrvr.c @@ -36,6 +36,7 @@ //====================================================== #include "tap-windows.h" +#include "config.h" #define NDIS_MINIPORT_DRIVER #define BINARY_COMPATIBLE 0 @@ -1028,8 +1029,8 @@ NDIS_STATUS AdapterQuery // Vendor & Driver version Info //=================================================================== case OID_GEN_VENDOR_DESCRIPTION: - l_QueryPtr = (TapAdapterQueryPointer) PRODUCT_STRING; - l_QueryLength = strlen (PRODUCT_STRING) + 1; + l_QueryPtr = (TapAdapterQueryPointer) PRODUCT_TAP_WIN_DEVICE_DESCRIPTION; + l_QueryLength = strlen (PRODUCT_TAP_WIN_DEVICE_DESCRIPTION) + 1; break; case OID_GEN_VENDOR_ID: @@ -1045,8 +1046,8 @@ NDIS_STATUS AdapterQuery case OID_GEN_VENDOR_DRIVER_VERSION: l_Query.m_Long = - (((USHORT) TAP_DRIVER_MAJOR_VERSION) << 8 | (USHORT) - TAP_DRIVER_MINOR_VERSION); + (((USHORT) PRODUCT_TAP_WIN_MAJOR) << 8 | (USHORT) + PRODUCT_TAP_WIN_MINOR); break; //================================================================= diff --git a/version.m4 b/version.m4 new file mode 100644 index 0000000..95fe9e0 --- /dev/null +++ b/version.m4 @@ -0,0 +1,11 @@ +dnl define the TAP version +define([PRODUCT_NAME], [TAP-Windows]) +define([PRODUCT_VERSION], [9.9]) +define([PRODUCT_VERSION_RESOURCE], [9,0,0,9]) +define([PRODUCT_TAP_WIN_COMPONENT_ID], [tap0901]) +define([PRODUCT_TAP_WIN_MAJOR], [9]) +define([PRODUCT_TAP_WIN_MINOR], [9]) +define([PRODUCT_TAP_WIN_PROVIDER], [TAP-Windows Provider V9]) +define([PRODUCT_TAP_WIN_CHARACTERISTICS], [0x81]) +define([PRODUCT_TAP_WIN_DEVICE_DESCRIPTION], [TAP-Windows Adapter V9]) +define([PRODUCT_TAP_WIN_RELDATE], [04/19/2010]) -- 1.7.3.4