diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d69e4d7b..3e2fd5f5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ option(TESTNET "testnet build" ) if(WIN32) set(CMAKE_CXX_STANDARD 17) + ENABLE_LANGUAGE(RC) else() set(CMAKE_CXX_STANDARD 11) endif(WIN32) @@ -682,8 +683,13 @@ else() #add_executable(${CLIENT_EXE} ${CLIENT_SRC}) #add_executable(${DNS_EXE} ${DNS_SRC}) add_subdirectory(${GTEST_DIR}) +if(NOT WIN32) add_executable(${TEST_EXE} ${TEST_SRC}) add_executable(${EXE} ${EXE_SRC}) +else() + add_executable(${TEST_EXE} ${TEST_SRC} llarp/version.rc) + add_executable(${EXE} ${EXE_SRC} llarp/version.rc) +endif(NOT WIN32) target_include_directories(${TEST_EXE} PRIVATE ${GTEST_DIR}/include ${GTEST_DIR}) install(TARGETS ${EXE} RUNTIME DESTINATION bin) if(WIN32) diff --git a/llarp/app.xml b/llarp/app.xml new file mode 100644 index 000000000..943ded257 --- /dev/null +++ b/llarp/app.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/llarp/resource.h b/llarp/resource.h new file mode 100644 index 000000000..7097a903f --- /dev/null +++ b/llarp/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by version.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/llarp/version.rc b/llarp/version.rc new file mode 100644 index 000000000..7085c6218 --- /dev/null +++ b/llarp/version.rc @@ -0,0 +1,99 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" +#include +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 1033,1 +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,3,1,0 + PRODUCTVERSION 0,3,1,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x3L +#else + FILEFLAGS 0x2L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "includes relay/exit functionality, such code is highly experimental on non UNIX/Linux/Macintosh targets!" + VALUE "CompanyName", "Loki Foundation" + VALUE "FileDescription", "LokiNET daemon for Microsoft® Windows® NT™" + VALUE "FileVersion", "0.3.1-dev" + VALUE "InternalName", "llarpd" + VALUE "LegalCopyright", "Copyright ©2018 Loki Foundation, Jeff Becker, Rick V. All rights reserved. This software is provided under the terms of the zlib-libpng licence; see the file LICENSE for details." + VALUE "OriginalFilename", "llarpd.exe" + VALUE "ProductName", "LokiNET for Windows" + VALUE "ProductVersion", "0.3.1-dev" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// RT_MANIFEST +// + +1 RT_MANIFEST "app.xml" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/win32-setup/lokinet-win32.iss b/win32-setup/lokinet-win32.iss index 3d151df96..fc45bfb28 100644 --- a/win32-setup/lokinet-win32.iss +++ b/win32-setup/lokinet-win32.iss @@ -43,7 +43,6 @@ InternalCompressLevel=ultra64 MinVersion=0,5.0 ArchitecturesInstallIn64BitMode=x64 VersionInfoCopyright=Copyright ©2018 Loki Project -AlwaysRestart=yes [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" @@ -57,10 +56,8 @@ Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescrip Source: "{#DevPath}build\lokinet.exe"; DestDir: "{app}"; Flags: ignoreversion 32bit; Check: not IsWin64 Source: "{#DevPath}build64\lokinet.exe"; DestDir: "{app}"; Flags: ignoreversion 64bit; Check: IsWin64 ; eh, might as well ship the 32-bit port of everything else -; do we _need_ to ship these? -Source: "{#DevPath}build\dns.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#DevPath}build\llarpc.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#DevPath}build\rcutil.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#DevPath}build\testAll.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#DevPath}LICENSE"; DestDir: "{app}"; Flags: ignoreversion ; delet this after finishing setup, we only need it to extract the drivers ; and download an initial RC Source: "{#DevPath}lokinet-bootstrap.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall @@ -68,8 +65,8 @@ Source: "{#DevPath}win32-setup\7z.exe"; DestDir: "{tmp}"; Flags: deleteafterinst ; if nonexistent, then inet6 was already installed Source: "{tmp}\inet6.7z"; DestDir: "{app}"; Flags: ignoreversion external deleteafterinstall skipifsourcedoesntexist; MinVersion: 0,5.0; OnlyBelowVersion: 0,5.1 ; Copy the correct tuntap driver for the selected platform -Source: "{tmp}\tuntapv9.7z"; DestDir: "{app}"; Flags: ignoreversion external deleteafterinstall; OnlyBelowVersion: 0, 6.0 -Source: "{tmp}\tuntapv9_n6.7z"; DestDir: "{app}"; Flags: ignoreversion external deleteafterinstall; MinVersion: 0,6.0 +Source: "{tmp}\tuntapv9.7z"; DestDir: "{app}"; Flags: ignoreversion external deleteafterinstall skipifsourcedoesntexist; OnlyBelowVersion: 0, 6.0 +Source: "{tmp}\tuntapv9_n6.7z"; DestDir: "{app}"; Flags: ignoreversion external deleteafterinstall skipifsourcedoesntexist; MinVersion: 0,6.0 ; NOTE: Don't use "Flags: ignoreversion" on any shared system files @@ -96,7 +93,7 @@ begin GetWindowsVersionEx(Version); if Version.NTPlatform and (Version.Major = 5) and (Version.Minor = 0) and (FileExists(ExpandConstant('{tmp}\inet6.7z')) = true) then // I need a better message... - MsgBox('Set up IPv6 in Network Connections after reboot.', mbInformation, MB_OK); + MsgBox('Restart your computer, then set up IPv6 in Network Connections.\n[Adapter] > Properties > Install... > Protocol > Microsoft IPv6 Driver...', mbInformation, MB_OK); end; end; @@ -106,26 +103,31 @@ var S: String; begin GetWindowsVersionEx(Version); + // if we already have a generic openvpn tap driver installed, then skip all the downloading + // lokinet is coded to enumerate all generic tap virtual adapters and use the first free device + if (FileExists(ExpandConstant('{sys}\drivers\tap0901.sys')) = false) then + begin if Version.NTPlatform and (Version.Major < 6) then begin // Windows 2000, XP, .NET Svr 2003 - // these have a horribly crippled WinInet that issues Triple-DES as its most secure + // these have a horribly crippled WinInet that issues TLSv1-RSA-SHA1-Triple-DES as its most secure // cipher suite idpAddFile('http://www.rvx86.net/files/tuntapv9.7z', ExpandConstant('{tmp}\tuntapv9.7z')); - // Windows 2000 only, we need to install inet6 separately - if (FileExists(ExpandConstant('{sys}\drivers\tcpip6.sys')) = false) and (Version.Major = 5) and (Version.Minor = 0) then - begin - idpAddFile('http://www.rvx86.net/files/inet6.7z', ExpandConstant('{tmp}\inet6.7z')); - end; end else begin // current versions of windows :-) // (Arguably, one could pull this from any of the forks.) idpAddFile('https://github.com/despair86/loki-network/raw/master/contrib/tuntapv9-ndis/tap-windows-9.21.2.7z', ExpandConstant('{tmp}\tuntapv9_n6.7z')); + end; + // Windows 2000 only, we need to install inet6 separately + if (FileExists(ExpandConstant('{sys}\drivers\tcpip6.sys')) = false) and (Version.Major = 5) and (Version.Minor = 0) then + begin + idpAddFile('http://www.rvx86.net/files/inet6.7z', ExpandConstant('{tmp}\inet6.7z')); end; idpDownloadAfter(wpReady); + end; end; [Icons] @@ -139,14 +141,14 @@ Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBa [Run] Filename: "{app}\{#MyAppExeName}"; Flags: nowait postinstall skipifsilent; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}" ; wait until either one or two of these terminates -Filename: "{tmp}\7z.exe"; Parameters: "x tuntapv9.7z"; WorkingDir: "{app}"; Flags: runascurrentuser waituntilterminated; Description: "extract TUN/TAP-v9 driver"; StatusMsg: "Extracting driver..."; OnlyBelowVersion: 0, 6.0 -Filename: "{tmp}\7z.exe"; Parameters: "x tuntapv9_n6.7z"; WorkingDir: "{app}"; Flags: runascurrentuser waituntilterminated; Description: "extract TUN/TAP-v9 driver"; StatusMsg: "Extracting driver..."; MinVersion: 0, 6.0 -Filename: "{tmp}\7z.exe"; Parameters: "x inet6.7z"; WorkingDir: "{app}"; Flags: skipifdoesntexist runascurrentuser waituntilterminated; Description: "extract inet6 driver"; StatusMsg: "Extracting IPv6 driver..."; MinVersion: 0, 5.0; OnlyBelowVersion: 0, 5.1 +Filename: "{tmp}\7z.exe"; Parameters: "x tuntapv9.7z"; WorkingDir: "{app}"; Flags: runascurrentuser waituntilterminated skipifdoesntexist; Description: "extract TUN/TAP-v9 driver"; StatusMsg: "Extracting driver..."; OnlyBelowVersion: 0, 6.0 +Filename: "{tmp}\7z.exe"; Parameters: "x tuntapv9_n6.7z"; WorkingDir: "{app}"; Flags: runascurrentuser waituntilterminated skipifdoesntexist; Description: "extract TUN/TAP-v9 driver"; StatusMsg: "Extracting driver..."; MinVersion: 0, 6.0 +Filename: "{tmp}\7z.exe"; Parameters: "x inet6.7z"; WorkingDir: "{app}"; Flags: skipifdoesntexist runascurrentuser waituntilterminated skipifdoesntexist; Description: "extract inet6 driver"; StatusMsg: "Extracting IPv6 driver..."; MinVersion: 0, 5.0; OnlyBelowVersion: 0, 5.1 Filename: "{tmp}\lokinet-bootstrap.exe"; WorkingDir: "{app}"; Flags: runascurrentuser waituntilterminated; Description: "bootstrap dht"; StatusMsg: "Downloading initial RC..." ; then ask to install drivers -Filename: "{app}\tap-windows-9.9.2\install.bat"; WorkingDir: "{app}\tap-windows-9.9.2\"; Flags: runascurrentuser waituntilterminated; Description: "Install TUN/TAP-v9 driver"; StatusMsg: "Installing driver..."; OnlyBelowVersion: 0, 6.0 -Filename: "{app}\tap-windows-9.21.2\install.bat"; WorkingDir: "{app}\tap-windows-9.21.2\"; Flags: runascurrentuser waituntilterminated; Description: "Install TUN/TAP-v9 driver"; StatusMsg: "Installing driver..."; MinVersion: 0, 6.0 +Filename: "{app}\tap-windows-9.9.2\install.bat"; WorkingDir: "{app}\tap-windows-9.9.2\"; Flags: runascurrentuser waituntilterminated skipifdoesntexist; Description: "Install TUN/TAP-v9 driver"; StatusMsg: "Installing driver..."; OnlyBelowVersion: 0, 6.0; Check: not FileExists(ExpandConstant('{sys}\drivers\tap0901.sys')) +Filename: "{app}\tap-windows-9.21.2\install.bat"; WorkingDir: "{app}\tap-windows-9.21.2\"; Flags: runascurrentuser waituntilterminated skipifdoesntexist; Description: "Install TUN/TAP-v9 driver"; StatusMsg: "Installing driver..."; MinVersion: 0, 6.0; Check: not FileExists(ExpandConstant('{sys}\drivers\tap0901.sys')) ; install inet6 if not present. (I'd assume netsh displays something helpful if inet6 is already set up and configured.) ; if it doesn't exist, then the inet6 driver appears to be installed -Filename: "{app}\inet6_driver\setup\hotfix.exe"; Parameters: "/m /z"; WorkingDir: "{app}\inet6_driver\setup\"; Flags: runascurrentuser waituntilterminated skipifdoesntexist; Description: "Install IPv6 driver"; StatusMsg: "Installing IPv6..."; OnlyBelowVersion: 0, 5.1 +Filename: "{app}\inet6_driver\setup\hotfix.exe"; Parameters: "/m /z"; WorkingDir: "{app}\inet6_driver\setup\"; Flags: runascurrentuser waituntilterminated skipifdoesntexist; Description: "Install IPv6 driver"; StatusMsg: "Installing IPv6..."; OnlyBelowVersion: 0, 5.1; Check: not FileExists(ExpandConstant('{sys}\drivers\tcpip6.sys')) Filename: "{sys}\netsh.exe"; Parameters: "int ipv6 install"; Flags: runascurrentuser waituntilterminated; Description: "install ipv6 on whistler"; StatusMsg: "Installing IPv6..."; MinVersion: 0,5.1; OnlyBelowVersion: 0,6.0 \ No newline at end of file