cf92ac7a0c
1.Subfolders in the Config/ directory now show up as submenus. 2.Added a way to run TunSafe as a Windows Service. Foreground Mode: The service will disconnect when TunSafe closes. Background Mode: The service will stay connected in the background. No longer required to run the TunSafe client as Admin as long as the service is running. 3.New config setting [Interface].ExcludedIPs to configure IPs that should not be routed through TunSafe. 4.Can now automatically start TunSafe when Windows starts 5.New UI with tabs and graphs 6.Cache DNS queries to ensure DNS will succeed if connection fails 7.Recreate tray icon when explorer.exe restarts 8.Renamed window title to TunSafe instead of TunSafe VPN Client 9.Main window is now resizable 10.Disallow roaming endpoint when using AllowedIPs=0.0.0.0/0 Only the original endpoint is added in the routing table so this would result in an endless loop of packets. 11.Display approximate Wireguard framing overhead in stats 12.Preparations for protocol handling with multiple threads 13.Delete the routes we made when disconnecting 14.Fix error message about unable to delete a route when connecting
96 lines
3.1 KiB
Python
96 lines
3.1 KiB
Python
# SPDX-License-Identifier: AGPL-1.0-only
|
|
# Copyright (C) 2018 Ludvig Strigeus <info@tunsafe.com>. All Rights Reserved.
|
|
import os
|
|
import shutil
|
|
import win32crypt
|
|
import base64
|
|
import sys
|
|
import zipfile
|
|
import re
|
|
|
|
MSBUILD_PATH = r"C:\Dev\VS2017\MSBuild\15.0\Bin\MSBuild.exe"
|
|
NSIS_PATH = r'C:\Dev\NSIS\makeNSIS.EXE'
|
|
|
|
|
|
SIGNTOOL_PATH = r'c:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\signtool.exe'
|
|
SIGNTOOL_KEY_PATH = "" # path to key file
|
|
SIGNTOOL_PASS = "" # password
|
|
|
|
def RmTree(path):
|
|
try:
|
|
print ('Deleting %s' % path)
|
|
shutil.rmtree(path)
|
|
except FileNotFoundError:
|
|
pass
|
|
|
|
def Run(s):
|
|
print ('Running %s' % s)
|
|
x = os.system(s)
|
|
if x:
|
|
raise Exception('Command failed (%d) : %s' % (x, s))
|
|
|
|
def CopyFile(src, dst):
|
|
shutil.copyfile(src, dst)
|
|
|
|
def SignExe(src):
|
|
print ('Signing %s' % src)
|
|
cmd = r'""c:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\signtool.exe" sign /f "%s" /p %s /t http://timestamp.verisign.com/scripts/timstamp.dll "%s"' % (SIGNTOOL_KEY_PATH, SIGNTOOL_PASS, src)
|
|
#cmd = r'""c:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86\signtool.exe" sign %s ' % (SIGNTOOL_KEY_PATH, )
|
|
x = os.system(cmd)
|
|
if x:
|
|
raise Exception('Signing failed (%d) : %s' % (x, cmd))
|
|
|
|
def GetVersion():
|
|
for line in open(BASE + '/tunsafe_config.h', 'r'):
|
|
m = re.match('^#define TUNSAFE_VERSION_STRING "TunSafe (.*)"$', line)
|
|
if m:
|
|
return m.group(1)
|
|
raise Exception('Version not found')
|
|
|
|
#
|
|
|
|
#os.system(r'""')
|
|
|
|
command = sys.argv[1]
|
|
|
|
BASE = r'D:\Code\TunSafe'
|
|
|
|
|
|
if command == 'build_tap':
|
|
Run(r'%s /V4 installer\tap\tap-windows6.nsi' % NSIS_PATH)
|
|
SignExe(r'installer\tap\TunSafe-TAP-9.21.2.exe')
|
|
sys.exit(0)
|
|
|
|
if 1:
|
|
RmTree(BASE + r'\Win32\Release')
|
|
RmTree(BASE + r'\x64\Release')
|
|
Run('%s TunSafe.sln /t:Clean;Rebuild /p:Configuration=Release /p:Platform=x64' % MSBUILD_PATH)
|
|
Run('%s TunSafe.sln /t:Clean;Rebuild /p:Configuration=Release /p:Platform=Win32' % MSBUILD_PATH)
|
|
|
|
if 1:
|
|
CopyFile(BASE + r'\Win32\Release\TunSafe.exe',
|
|
BASE + r'\installer\x86\TunSafe.exe')
|
|
|
|
SignExe(BASE + r'\installer\x86\TunSafe.exe')
|
|
CopyFile(BASE + r'\x64\Release\TunSafe.exe',
|
|
BASE + r'\installer\x64\TunSafe.exe')
|
|
SignExe(BASE + r'\installer\x64\TunSafe.exe')
|
|
|
|
VERSION = GetVersion()
|
|
|
|
Run(r'%s /V4 -DPRODUCT_VERSION=%s installer\tunsafe.nsi ' % (NSIS_PATH, VERSION))
|
|
SignExe(BASE + r'\installer\TunSafe-%s.exe' % VERSION)
|
|
|
|
zipf = zipfile.ZipFile(BASE + '\installer\TunSafe-%s-x86.zip' % VERSION, 'w', zipfile.ZIP_DEFLATED)
|
|
zipf.write(BASE + r'\installer\x86\TunSafe.exe', 'TunSafe.exe')
|
|
zipf.write(BASE + r'\installer\License.txt', 'License.txt')
|
|
zipf.write(BASE + r'\installer\ChangeLog.txt', 'ChangeLog.txt')
|
|
zipf.write(BASE + r'\installer\TunSafe.conf', 'Config\\TunSafe.conf')
|
|
zipf.close()
|
|
|
|
zipf = zipfile.ZipFile(BASE + '\installer\TunSafe-%s-x64.zip' % VERSION, 'w', zipfile.ZIP_DEFLATED)
|
|
zipf.write(BASE + r'\installer\x64\TunSafe.exe', 'TunSafe.exe')
|
|
zipf.write(BASE + r'\installer\License.txt', 'License.txt')
|
|
zipf.write(BASE + r'\installer\ChangeLog.txt', 'ChangeLog.txt')
|
|
zipf.write(BASE + r'\installer\TunSafe.conf', 'Config\\TunSafe.conf')
|
|
zipf.close()
|