mirror of
https://github.com/amnezia-vpn/amneziawg-windows-client.git
synced 2026-06-01 22:18:53 +02:00
safe rebranding: change wireguard to amneziawg
This commit is contained in:
@@ -15,7 +15,7 @@ RESOURCE_FILES := resources.rc version/version.go manifest.xml $(patsubst %.svg,
|
|||||||
DEPLOYMENT_HOST ?= winvm
|
DEPLOYMENT_HOST ?= winvm
|
||||||
DEPLOYMENT_PATH ?= Desktop
|
DEPLOYMENT_PATH ?= Desktop
|
||||||
|
|
||||||
all: amd64/wireguard.exe x86/wireguard.exe
|
all: amd64/amneziawg.exe x86/amneziawg.exe
|
||||||
|
|
||||||
define download =
|
define download =
|
||||||
.distfiles/$(1):
|
.distfiles/$(1):
|
||||||
@@ -53,16 +53,16 @@ resources_386.syso: $(RESOURCE_FILES)
|
|||||||
resources_arm64.syso: $(RESOURCE_FILES)
|
resources_arm64.syso: $(RESOURCE_FILES)
|
||||||
aarch64-w64-mingw32-windres $(RCFLAGS) -i $< -o $@
|
aarch64-w64-mingw32-windres $(RCFLAGS) -i $< -o $@
|
||||||
|
|
||||||
amd64/wireguard.exe: export GOARCH := amd64
|
amd64/amneziawg.exe: export GOARCH := amd64
|
||||||
amd64/wireguard.exe: amd64/wintun.dll resources_amd64.syso $(SOURCE_FILES)
|
amd64/amneziawg.exe: amd64/wintun.dll resources_amd64.syso $(SOURCE_FILES)
|
||||||
go build $(GOFLAGS) -o $@
|
go build $(GOFLAGS) -o $@
|
||||||
|
|
||||||
x86/wireguard.exe: export GOARCH := 386
|
x86/amneziawg.exe: export GOARCH := 386
|
||||||
x86/wireguard.exe: x86/wintun.dll resources_386.syso $(SOURCE_FILES)
|
x86/amneziawg.exe: x86/wintun.dll resources_386.syso $(SOURCE_FILES)
|
||||||
go build $(GOFLAGS) -o $@
|
go build $(GOFLAGS) -o $@
|
||||||
|
|
||||||
arm64/wireguard.exe: export GOARCH := arm64
|
arm64/amneziawg.exe: export GOARCH := arm64
|
||||||
arm64/wireguard.exe: resources_arm64.syso $(SOURCE_FILES)
|
arm64/amneziawg.exe: resources_arm64.syso $(SOURCE_FILES)
|
||||||
go build $(GOFLAGS) -o $@
|
go build $(GOFLAGS) -o $@
|
||||||
|
|
||||||
amd64/wintun.dll:
|
amd64/wintun.dll:
|
||||||
@@ -93,8 +93,8 @@ crowdin:
|
|||||||
find locales -name messages.gotext.json -exec bash -c '[[ $$(jq ".messages | length" {}) -ne 0 ]] || rm -rf "$$(dirname {})"' \;
|
find locales -name messages.gotext.json -exec bash -c '[[ $$(jq ".messages | length" {}) -ne 0 ]] || rm -rf "$$(dirname {})"' \;
|
||||||
@$(MAKE) --no-print-directory generate
|
@$(MAKE) --no-print-directory generate
|
||||||
|
|
||||||
deploy: amd64/wireguard.exe
|
deploy: amd64/amneziawg.exe
|
||||||
-ssh $(DEPLOYMENT_HOST) -- 'taskkill /im wireguard.exe /f'
|
-ssh $(DEPLOYMENT_HOST) -- 'taskkill /im amneziawg.exe /f'
|
||||||
scp $< $(DEPLOYMENT_HOST):$(DEPLOYMENT_PATH)
|
scp $< $(DEPLOYMENT_HOST):$(DEPLOYMENT_PATH)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -49,10 +49,10 @@ if exist .deps\prepared goto :render
|
|||||||
if "%SigningCertificate%"=="" goto :success
|
if "%SigningCertificate%"=="" goto :success
|
||||||
if "%TimestampServer%"=="" goto :success
|
if "%TimestampServer%"=="" goto :success
|
||||||
echo [+] Signing
|
echo [+] Signing
|
||||||
signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d WireGuard x86\wireguard.exe x86\wg.exe amd64\wireguard.exe amd64\wg.exe arm64\wireguard.exe arm64\wg.exe || goto :error
|
signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d WireGuard x86\amneziawg.exe x86\wg.exe amd64\amneziawg.exe amd64\wg.exe arm64\amneziawg.exe arm64\wg.exe || goto :error
|
||||||
|
|
||||||
:success
|
:success
|
||||||
echo [+] Success. Launch wireguard.exe.
|
echo [+] Success. Launch amneziawg.exe.
|
||||||
exit /b 0
|
exit /b 0
|
||||||
|
|
||||||
:download
|
:download
|
||||||
@@ -72,7 +72,7 @@ if exist .deps\prepared goto :render
|
|||||||
echo [+] Assembling resources %1
|
echo [+] Assembling resources %1
|
||||||
%~2-w64-mingw32-windres -DWIREGUARD_VERSION_ARRAY=%WIREGUARD_VERSION_ARRAY% -DWIREGUARD_VERSION_STR=%WIREGUARD_VERSION% -i resources.rc -o "resources_%~3.syso" -O coff -c 65001 || exit /b %errorlevel%
|
%~2-w64-mingw32-windres -DWIREGUARD_VERSION_ARRAY=%WIREGUARD_VERSION_ARRAY% -DWIREGUARD_VERSION_STR=%WIREGUARD_VERSION% -i resources.rc -o "resources_%~3.syso" -O coff -c 65001 || exit /b %errorlevel%
|
||||||
echo [+] Building program %1
|
echo [+] Building program %1
|
||||||
go build -tags load_wgnt_from_rsrc -ldflags="-H windowsgui -s -w" -trimpath -buildvcs=false -v -o "%~1\wireguard.exe" || exit /b 1
|
go build -tags load_wgnt_from_rsrc -ldflags="-H windowsgui -s -w" -trimpath -buildvcs=false -v -o "%~1\amneziawg.exe" || exit /b 1
|
||||||
if not exist "%~1\wg.exe" (
|
if not exist "%~1\wg.exe" (
|
||||||
echo [+] Building command line tools %1
|
echo [+] Building command line tools %1
|
||||||
del .deps\src\*.exe .deps\src\*.o .deps\src\wincompat\*.o .deps\src\wincompat\*.lib 2> NUL
|
del .deps\src\*.exe .deps\src\*.o .deps\src\wincompat\*.o .deps\src\wincompat\*.lib 2> NUL
|
||||||
|
|||||||
+3
-3
@@ -12,13 +12,13 @@ C:\Projects\wireguard-windows> build
|
|||||||
|
|
||||||
### Running
|
### Running
|
||||||
|
|
||||||
After you've built the application, run `amd64\wireguard.exe` or `x86\wireguard.exe` to install the manager service and show the UI.
|
After you've built the application, run `amd64\amneziawg.exe` or `x86\amneziawg.exe` to install the manager service and show the UI.
|
||||||
|
|
||||||
```text
|
```text
|
||||||
C:\Projects\wireguard-windows> amd64\wireguard.exe
|
C:\Projects\amneziawg-windows-client> amd64\amneziawg.exe
|
||||||
```
|
```
|
||||||
|
|
||||||
Since WireGuard requires a driver to be installed, and this generally requires a valid Microsoft signature, you may benefit from first installing a release of WireGuard for Windows from the official [wireguard.com](https://www.wireguard.com/install/) builds, which bundles a Microsoft-signed driver, and then subsequently run your own wireguard.exe. Alternatively, you can craft your own installer using the `quickinstall.bat` script.
|
Since WireGuard requires a driver to be installed, and this generally requires a valid Microsoft signature, you may benefit from first installing a release of WireGuard for Windows from the official [wireguard.com](https://www.wireguard.com/install/) builds, which bundles a Microsoft-signed driver, and then subsequently run your own amneziawg.exe. Alternatively, you can craft your own installer using the `quickinstall.bat` script.
|
||||||
|
|
||||||
### Optional: Localizing
|
### Optional: Localizing
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -46,13 +46,13 @@ The `PreUp`, `PostUp`, `PreDown`, and `PostDown` configuration options may be sp
|
|||||||
The manager service may be installed or uninstalled using the commands:
|
The manager service may be installed or uninstalled using the commands:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
> wireguard /installmanagerservice
|
> amneziawg /installmanagerservice
|
||||||
> wireguard /uninstallmanagerservice
|
> amneziawg /uninstallmanagerservice
|
||||||
```
|
```
|
||||||
|
|
||||||
This creates a service called `WireGuardManager`, which can be controlled using standard Windows service management utilites, such as `services.msc` or [`sc`](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sc-query).
|
This creates a service called `AmneziaWGManager`, which can be controlled using standard Windows service management utilites, such as `services.msc` or [`sc`](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sc-query).
|
||||||
|
|
||||||
When executing `wireguard` with no arguments, the command first attempts to show the UI if the manager service is already running; otherwise it starts the manager service, waits for it to create a UI in the system tray, and then shows the main manager window. Therefore, `wireguard /installmanagerservice` is suitable for silent installation, whereas `wireguard` alone is suitable for interactive startup.
|
When executing `amneziawg` with no arguments, the command first attempts to show the UI if the manager service is already running; otherwise it starts the manager service, waits for it to create a UI in the system tray, and then shows the main manager window. Therefore, `amneziawg /installmanagerservice` is suitable for silent installation, whereas `amneziawg` alone is suitable for interactive startup.
|
||||||
|
|
||||||
The manager service monitors `%ProgramFiles%\WireGuard\Data\Configurations\` for the addition of new `.conf` files. Upon seeing one, it encrypts the file to a `.conf.dpapi` file, makes it unreadable to users other than Local System, confers the administrator only the ability to remove it, and then deletes the original unencrypted file. (Configurations can always be _exported_ later using the export feature of the UI.) Using this, configurations can programmatically be added to the secure store of the manager service simply by copying them into that directory.
|
The manager service monitors `%ProgramFiles%\WireGuard\Data\Configurations\` for the addition of new `.conf` files. Upon seeing one, it encrypts the file to a `.conf.dpapi` file, makes it unreadable to users other than Local System, confers the administrator only the ability to remove it, and then deletes the original unencrypted file. (Configurations can always be _exported_ later using the export feature of the UI.) Using this, configurations can programmatically be added to the secure store of the manager service simply by copying them into that directory.
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ Or, to log the status of that command:
|
|||||||
One could have Task Scheduler run it daily at 3am:
|
One could have Task Scheduler run it daily at 3am:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
> schtasks /create /f /ru SYSTEM /sc daily /tn "WireGuard Update" /tr "%PROGRAMFILES%\WireGuard\wireguard.exe /update" /st 03:00
|
> schtasks /create /f /ru SYSTEM /sc daily /tn "WireGuard Update" /tr "%PROGRAMFILES%\WireGuard\amneziawg.exe /update" /st 03:00
|
||||||
```
|
```
|
||||||
|
|
||||||
### Driver Removal
|
### Driver Removal
|
||||||
|
|||||||
@@ -7,18 +7,17 @@ require (
|
|||||||
github.com/amnezia-vpn/awg-windows v0.1.4-0.20240424161542-e8e067a05ad4
|
github.com/amnezia-vpn/awg-windows v0.1.4-0.20240424161542-e8e067a05ad4
|
||||||
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794
|
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794
|
||||||
github.com/lxn/win v0.0.0-20210218163916-a377121e959e
|
github.com/lxn/win v0.0.0-20210218163916-a377121e959e
|
||||||
golang.org/x/crypto v0.18.0
|
|
||||||
golang.org/x/sys v0.16.0
|
golang.org/x/sys v0.16.0
|
||||||
golang.org/x/text v0.14.0
|
golang.org/x/text v0.14.0
|
||||||
golang.zx2c4.com/wireguard/windows v0.5.3
|
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/tevino/abool/v2 v2.1.0 // indirect
|
github.com/tevino/abool/v2 v2.1.0 // indirect
|
||||||
|
golang.org/x/crypto v0.18.0 // indirect
|
||||||
golang.org/x/mod v0.8.0 // indirect
|
golang.org/x/mod v0.8.0 // indirect
|
||||||
golang.org/x/net v0.20.0 // indirect
|
golang.org/x/net v0.20.0 // indirect
|
||||||
golang.org/x/tools v0.6.0 // indirect
|
golang.org/x/tools v0.6.0 // indirect
|
||||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
|
||||||
)
|
)
|
||||||
|
|
||||||
replace (
|
replace (
|
||||||
|
|||||||
@@ -26,6 +26,4 @@ golang.zx2c4.com/wireguard/windows v0.0.0-20210121140954-e7fc19d483bd h1:kAUzMAI
|
|||||||
golang.zx2c4.com/wireguard/windows v0.0.0-20210121140954-e7fc19d483bd/go.mod h1:Y+FYqVFaQO6a+1uigm0N0GiuaZrLEaBxEiJ8tfH9sMQ=
|
golang.zx2c4.com/wireguard/windows v0.0.0-20210121140954-e7fc19d483bd/go.mod h1:Y+FYqVFaQO6a+1uigm0N0GiuaZrLEaBxEiJ8tfH9sMQ=
|
||||||
golang.zx2c4.com/wireguard/windows v0.0.0-20210224134948-620c54ef6199 h1:ogXKLng/Myrt2odYTkleySGzQj/GWg9GV1AQ8P9NnU4=
|
golang.zx2c4.com/wireguard/windows v0.0.0-20210224134948-620c54ef6199 h1:ogXKLng/Myrt2odYTkleySGzQj/GWg9GV1AQ8P9NnU4=
|
||||||
golang.zx2c4.com/wireguard/windows v0.0.0-20210224134948-620c54ef6199/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk=
|
golang.zx2c4.com/wireguard/windows v0.0.0-20210224134948-620c54ef6199/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk=
|
||||||
golang.zx2c4.com/wireguard/windows v0.5.3 h1:On6j2Rpn3OEMXqBq00QEDC7bWSZrPIHKIus8eIuExIE=
|
|
||||||
golang.zx2c4.com/wireguard/windows v0.5.3/go.mod h1:9TEe8TJmtwyQebdFwAkEWOPr3prrtqm+REGFifP60hI=
|
|
||||||
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259 h1:TbRPT0HtzFP3Cno1zZo7yPzEEnfu8EjLfl6IU9VfqkQ=
|
gvisor.dev/gvisor v0.0.0-20230927004350-cbd86285d259 h1:TbRPT0HtzFP3Cno1zZo7yPzEEnfu8EjLfl6IU9VfqkQ=
|
||||||
|
|||||||
+1
-1
@@ -68,7 +68,7 @@ if exist .deps\prepared goto :build
|
|||||||
:skipsign
|
:skipsign
|
||||||
"%WIX%bin\candle" %WIX_CANDLE_FLAGS% -dWIREGUARD_PLATFORM="%~1" -out "%~1\wireguard.wixobj" -arch %3 wireguard.wxs || exit /b %errorlevel%
|
"%WIX%bin\candle" %WIX_CANDLE_FLAGS% -dWIREGUARD_PLATFORM="%~1" -out "%~1\wireguard.wixobj" -arch %3 wireguard.wxs || exit /b %errorlevel%
|
||||||
echo [+] Linking %1
|
echo [+] Linking %1
|
||||||
"%WIX%bin\light" %WIX_LIGHT_FLAGS% -out "dist\wireguard-%~1-%WIREGUARD_VERSION%.msi" "%~1\wireguard.wixobj" || exit /b %errorlevel%
|
"%WIX%bin\light" %WIX_LIGHT_FLAGS% -out "dist\amneziawg-%~1-%WIREGUARD_VERSION%.msi" "%~1\wireguard.wixobj" || exit /b %errorlevel%
|
||||||
goto :eof
|
goto :eof
|
||||||
|
|
||||||
:error
|
:error
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
|
|
||||||
#define MANAGER_SERVICE_NAME TEXT("WireGuardManager")
|
#define MANAGER_SERVICE_NAME TEXT("AmneziaWGManager")
|
||||||
#define TUNNEL_SERVICE_PREFIX TEXT("WireGuardTunnel$")
|
#define TUNNEL_SERVICE_PREFIX TEXT("WireGuardTunnel$")
|
||||||
|
|
||||||
enum log_level { LOG_LEVEL_INFO, LOG_LEVEL_WARN, LOG_LEVEL_ERR, LOG_LEVEL_MSIERR };
|
enum log_level { LOG_LEVEL_INFO, LOG_LEVEL_WARN, LOG_LEVEL_ERR, LOG_LEVEL_MSIERR };
|
||||||
@@ -256,7 +256,7 @@ __declspec(dllexport) UINT __stdcall LaunchApplicationAndAbort(MSIHANDLE install
|
|||||||
log_errorf(installer, LOG_LEVEL_WARN, ret, TEXT("MsiGetProperty(\"WireGuardFolder\") failed"));
|
log_errorf(installer, LOG_LEVEL_WARN, ret, TEXT("MsiGetProperty(\"WireGuardFolder\") failed"));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (!path[0] || !PathAppend(path, TEXT("wireguard.exe")))
|
if (!path[0] || !PathAppend(path, TEXT("amneziawg.exe")))
|
||||||
goto out;
|
goto out;
|
||||||
log_messagef(installer, LOG_LEVEL_INFO, TEXT("Launching %1"), path);
|
log_messagef(installer, LOG_LEVEL_INFO, TEXT("Launching %1"), path);
|
||||||
if (!CreateProcess(path, TEXT("wireguard"), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
|
if (!CreateProcess(path, TEXT("wireguard"), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
|
||||||
@@ -365,7 +365,7 @@ __declspec(dllexport) UINT __stdcall KillWireGuardProcesses(MSIHANDLE installer)
|
|||||||
|
|
||||||
if (PathCombine(executable, process_path, TEXT("wg.exe")) && calculate_file_id(executable, &file_ids[file_ids_len]))
|
if (PathCombine(executable, process_path, TEXT("wg.exe")) && calculate_file_id(executable, &file_ids[file_ids_len]))
|
||||||
++file_ids_len;
|
++file_ids_len;
|
||||||
if (PathCombine(executable, process_path, TEXT("wireguard.exe")) && calculate_file_id(executable, &file_ids[file_ids_len]))
|
if (PathCombine(executable, process_path, TEXT("amneziawg.exe")) && calculate_file_id(executable, &file_ids[file_ids_len]))
|
||||||
++file_ids_len;
|
++file_ids_len;
|
||||||
if (!file_ids_len)
|
if (!file_ids_len)
|
||||||
goto out;
|
goto out;
|
||||||
@@ -375,7 +375,7 @@ __declspec(dllexport) UINT __stdcall KillWireGuardProcesses(MSIHANDLE installer)
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
for (bool ret = Process32First(snapshot, &entry); ret; ret = Process32Next(snapshot, &entry)) {
|
for (bool ret = Process32First(snapshot, &entry); ret; ret = Process32Next(snapshot, &entry)) {
|
||||||
if (_tcsicmp(entry.szExeFile, TEXT("wireguard.exe")) && _tcsicmp(entry.szExeFile, TEXT("wg.exe")))
|
if (_tcsicmp(entry.szExeFile, TEXT("amneziawg.exe")) && _tcsicmp(entry.szExeFile, TEXT("wg.exe")))
|
||||||
continue;
|
continue;
|
||||||
process = OpenProcess(PROCESS_TERMINATE | PROCESS_QUERY_LIMITED_INFORMATION, false, entry.th32ProcessID);
|
process = OpenProcess(PROCESS_TERMINATE | PROCESS_QUERY_LIMITED_INFORMATION, false, entry.th32ProcessID);
|
||||||
if (!process)
|
if (!process)
|
||||||
@@ -508,7 +508,7 @@ __declspec(dllexport) UINT __stdcall RemoveAdapters(MSIHANDLE installer)
|
|||||||
log_errorf(installer, LOG_LEVEL_WARN, ret, TEXT("MsiGetProperty(\"CustomActionData\") failed"));
|
log_errorf(installer, LOG_LEVEL_WARN, ret, TEXT("MsiGetProperty(\"CustomActionData\") failed"));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (!path[0] || !PathAppend(path, TEXT("wireguard.exe")))
|
if (!path[0] || !PathAppend(path, TEXT("amneziawg.exe")))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!CreatePipe(&pipe, &si.hStdOutput, NULL, 0)) {
|
if (!CreatePipe(&pipe, &si.hStdOutput, NULL, 0)) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||||
<Product
|
<Product
|
||||||
Id="*"
|
Id="*"
|
||||||
Name="WireGuard"
|
Name="AmneziaWG"
|
||||||
Language="1033"
|
Language="1033"
|
||||||
Version="$(var.WIREGUARD_VERSION)"
|
Version="$(var.WIREGUARD_VERSION)"
|
||||||
Manufacturer="WireGuard LLC"
|
Manufacturer="WireGuard LLC"
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
InstallerVersion="500"
|
InstallerVersion="500"
|
||||||
Compressed="yes"
|
Compressed="yes"
|
||||||
InstallScope="perMachine"
|
InstallScope="perMachine"
|
||||||
Description="WireGuard: Fast, Modern, Secure VPN Tunnel"
|
Description="AmneziaWG: Fast, Modern, Secure VPN Tunnel"
|
||||||
ReadOnly="yes" />
|
ReadOnly="yes" />
|
||||||
|
|
||||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||||
@@ -75,8 +75,8 @@
|
|||||||
-->
|
-->
|
||||||
<ComponentGroup Id="WireGuardComponents">
|
<ComponentGroup Id="WireGuardComponents">
|
||||||
<Component Directory="WireGuardFolder" Id="WireGuardExecutable" Guid="c3508d23-3362-47ce-9220-321bdb1a1acc">
|
<Component Directory="WireGuardFolder" Id="WireGuardExecutable" Guid="c3508d23-3362-47ce-9220-321bdb1a1acc">
|
||||||
<File Source="..\$(var.WIREGUARD_PLATFORM)\wireguard.exe" KeyPath="yes">
|
<File Source="..\$(var.WIREGUARD_PLATFORM)\amneziawg.exe" KeyPath="yes">
|
||||||
<Shortcut Id="WireGuardStartMenuShortcut" Directory="ProgramMenuFolder" Name="WireGuard" Description="WireGuard: Fast, Modern, Secure VPN Tunnel" WorkingDirectory="WireGuardFolder" Advertise="yes" />
|
<Shortcut Id="WireGuardStartMenuShortcut" Directory="ProgramMenuFolder" Name="AmneziaWG" Description="AmneziaWG: Fast, Modern, Secure VPN Tunnel" WorkingDirectory="WireGuardFolder" Advertise="yes" />
|
||||||
</File>
|
</File>
|
||||||
<ServiceControl Id="DummyService.3AA0C492_29F4_4342_B608_DB95B2DECB13" Name="DummyService.3AA0C492_29F4_4342_B608_DB95B2DECB13" /><!-- A dummy to make WiX create ServiceControl table for us. -->
|
<ServiceControl Id="DummyService.3AA0C492_29F4_4342_B608_DB95B2DECB13" Name="DummyService.3AA0C492_29F4_4342_B608_DB95B2DECB13" /><!-- A dummy to make WiX create ServiceControl table for us. -->
|
||||||
</Component>
|
</Component>
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
</InstallExecuteSequence>
|
</InstallExecuteSequence>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Launch wireguard.exe on product reconfiguration (starting same MSI again)
|
Launch amneziawg.exe on product reconfiguration (starting same MSI again)
|
||||||
-->
|
-->
|
||||||
<CustomAction Id="LaunchApplicationAndAbort" BinaryKey="customactions.dll" DllEntry="LaunchApplicationAndAbort" />
|
<CustomAction Id="LaunchApplicationAndAbort" BinaryKey="customactions.dll" DllEntry="LaunchApplicationAndAbort" />
|
||||||
<InstallExecuteSequence>
|
<InstallExecuteSequence>
|
||||||
@@ -153,9 +153,9 @@
|
|||||||
</InstallExecuteSequence>
|
</InstallExecuteSequence>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Launch wireguard.exe after setup complete
|
Launch amneziawg.exe after setup complete
|
||||||
-->
|
-->
|
||||||
<CustomAction Id="LaunchApplication" HideTarget="yes" Impersonate="no" Execute="deferred" FileKey="wireguard.exe" ExeCommand="" Return="asyncNoWait" />
|
<CustomAction Id="LaunchApplication" HideTarget="yes" Impersonate="no" Execute="deferred" FileKey="amneziawg.exe" ExeCommand="" Return="asyncNoWait" />
|
||||||
<InstallExecuteSequence>
|
<InstallExecuteSequence>
|
||||||
<Custom Action="LaunchApplication" Before="InstallFinalize">(&WireGuardFeature = 3) AND NOT DO_NOT_LAUNCH</Custom>
|
<Custom Action="LaunchApplication" Before="InstallFinalize">(&WireGuardFeature = 3) AND NOT DO_NOT_LAUNCH</Custom>
|
||||||
</InstallExecuteSequence>
|
</InstallExecuteSequence>
|
||||||
|
|||||||
+4
-4
@@ -48,7 +48,7 @@ func InstallManager() error {
|
|||||||
|
|
||||||
// TODO: Do we want to bail if executable isn't being run from the right location?
|
// TODO: Do we want to bail if executable isn't being run from the right location?
|
||||||
|
|
||||||
serviceName := "WireGuardManager"
|
serviceName := "AmneziaWGManager"
|
||||||
service, err := m.OpenService(serviceName)
|
service, err := m.OpenService(serviceName)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
status, err := service.Query()
|
status, err := service.Query()
|
||||||
@@ -61,7 +61,7 @@ func InstallManager() error {
|
|||||||
if status.State == svc.StartPending {
|
if status.State == svc.StartPending {
|
||||||
// We were *just* started by something else, so return success here, assuming the other program
|
// We were *just* started by something else, so return success here, assuming the other program
|
||||||
// starting this does the right thing. This can happen when, e.g., the updater relaunches the
|
// starting this does the right thing. This can happen when, e.g., the updater relaunches the
|
||||||
// manager service and then invokes wireguard.exe to raise the UI.
|
// manager service and then invokes amneziawg.exe to raise the UI.
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return ErrManagerAlreadyRunning
|
return ErrManagerAlreadyRunning
|
||||||
@@ -85,7 +85,7 @@ func InstallManager() error {
|
|||||||
ServiceType: windows.SERVICE_WIN32_OWN_PROCESS,
|
ServiceType: windows.SERVICE_WIN32_OWN_PROCESS,
|
||||||
StartType: mgr.StartAutomatic,
|
StartType: mgr.StartAutomatic,
|
||||||
ErrorControl: mgr.ErrorNormal,
|
ErrorControl: mgr.ErrorNormal,
|
||||||
DisplayName: "WireGuard Manager",
|
DisplayName: "AmneziaWG Manager",
|
||||||
}
|
}
|
||||||
|
|
||||||
service, err = m.CreateService(serviceName, path, config, "/managerservice")
|
service, err = m.CreateService(serviceName, path, config, "/managerservice")
|
||||||
@@ -101,7 +101,7 @@ func UninstallManager() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
serviceName := "WireGuardManager"
|
serviceName := "AmneziaWGManager"
|
||||||
service, err := m.OpenService(serviceName)
|
service, err := m.OpenService(serviceName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
+1
-1
@@ -348,7 +348,7 @@ loop:
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Run() error {
|
func Run() error {
|
||||||
return svc.Run("WireGuardManager", &managerService{})
|
return svc.Run("AmneziaWGManager", &managerService{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func LogFile(createRoot bool) (string, error) {
|
func LogFile(createRoot bool) (string, error) {
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@ rem Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
|
|||||||
|
|
||||||
setlocal
|
setlocal
|
||||||
cd /d %~dp0 || exit /b 1
|
cd /d %~dp0 || exit /b 1
|
||||||
echo [+] Building wireguard.exe
|
echo [+] Building amneziawg.exe
|
||||||
call .\build.bat || exit /b 1
|
call .\build.bat || exit /b 1
|
||||||
echo [+] Building installer
|
echo [+] Building installer
|
||||||
call .\installer\build.bat || exit /b 1
|
call .\installer\build.bat || exit /b 1
|
||||||
@@ -13,4 +13,4 @@ for /f %%a in ('reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninsta
|
|||||||
echo [+] Installing new version
|
echo [+] Installing new version
|
||||||
for /f "tokens=3" %%a in ('findstr /r "Number.*=.*[0-9.]*" .\version\version.go') do set WIREGUARD_VERSION=%%a
|
for /f "tokens=3" %%a in ('findstr /r "Number.*=.*[0-9.]*" .\version\version.go') do set WIREGUARD_VERSION=%%a
|
||||||
set WIREGUARD_VERSION=%WIREGUARD_VERSION:"=%
|
set WIREGUARD_VERSION=%WIREGUARD_VERSION:"=%
|
||||||
msiexec /qb /i installer\dist\wireguard-%PROCESSOR_ARCHITECTURE%-%WIREGUARD_VERSION%.msi
|
msiexec /qb /i installer\dist\amneziawg-%PROCESSOR_ARCHITECTURE%-%WIREGUARD_VERSION%.msi
|
||||||
|
|||||||
+9
-9
@@ -30,10 +30,10 @@ BEGIN \
|
|||||||
VALUE "CompanyName", "WireGuard LLC" \
|
VALUE "CompanyName", "WireGuard LLC" \
|
||||||
VALUE "FileDescription", file_desc \
|
VALUE "FileDescription", file_desc \
|
||||||
VALUE "FileVersion", EXPAND(WIREGUARD_VERSION_STR) \
|
VALUE "FileVersion", EXPAND(WIREGUARD_VERSION_STR) \
|
||||||
VALUE "InternalName", "wireguard-windows" \
|
VALUE "InternalName", "amneziawg-windows-client" \
|
||||||
VALUE "LegalCopyright", "Copyright © 2015-2022 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved." \
|
VALUE "LegalCopyright", "Copyright © 2015-2022 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved." \
|
||||||
VALUE "OriginalFilename", "wireguard.exe" \
|
VALUE "OriginalFilename", "amneziawg.exe" \
|
||||||
VALUE "ProductName", "WireGuard" \
|
VALUE "ProductName", "AmneziaWG" \
|
||||||
VALUE "ProductVersion", EXPAND(WIREGUARD_VERSION_STR) \
|
VALUE "ProductVersion", EXPAND(WIREGUARD_VERSION_STR) \
|
||||||
VALUE "Comments", comments \
|
VALUE "Comments", comments \
|
||||||
END \
|
END \
|
||||||
@@ -47,41 +47,41 @@ END
|
|||||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||||
VERSIONINFO_TEMPLATE(
|
VERSIONINFO_TEMPLATE(
|
||||||
"040904b0", 0x409, 0x4b0,
|
"040904b0", 0x409, 0x4b0,
|
||||||
"WireGuard: Fast, Modern, Secure VPN Tunnel",
|
"AmneziaWG: Fast, Modern, Secure VPN Tunnel",
|
||||||
"https://www.wireguard.com/"
|
"https://www.wireguard.com/"
|
||||||
)
|
)
|
||||||
|
|
||||||
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
||||||
VERSIONINFO_TEMPLATE(
|
VERSIONINFO_TEMPLATE(
|
||||||
"040c04b0", 0x40c, 0x4b0,
|
"040c04b0", 0x40c, 0x4b0,
|
||||||
"WireGuard: tunnel VPN rapide, moderne, sécurisé",
|
"AmneziaWG: tunnel VPN rapide, moderne, sécurisé",
|
||||||
"https://www.wireguard.com/"
|
"https://www.wireguard.com/"
|
||||||
)
|
)
|
||||||
|
|
||||||
LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT
|
LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT
|
||||||
VERSIONINFO_TEMPLATE(
|
VERSIONINFO_TEMPLATE(
|
||||||
"041004b0", 0x410, 0x4b0,
|
"041004b0", 0x410, 0x4b0,
|
||||||
"WireGuard: Tunnel VPN veloce, moderno e sicuro",
|
"AmneziaWG: Tunnel VPN veloce, moderno e sicuro",
|
||||||
"https://www.wireguard.com/"
|
"https://www.wireguard.com/"
|
||||||
)
|
)
|
||||||
|
|
||||||
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
|
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
|
||||||
VERSIONINFO_TEMPLATE(
|
VERSIONINFO_TEMPLATE(
|
||||||
"041104b0", 0x411, 0x4b0,
|
"041104b0", 0x411, 0x4b0,
|
||||||
"WireGuard: 高速で、現代的で、セキュアな VPN トンネル",
|
"AmneziaWG: 高速で、現代的で、セキュアな VPN トンネル",
|
||||||
"https://www.wireguard.com/"
|
"https://www.wireguard.com/"
|
||||||
)
|
)
|
||||||
|
|
||||||
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
|
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
|
||||||
VERSIONINFO_TEMPLATE(
|
VERSIONINFO_TEMPLATE(
|
||||||
"042404b0", 0x424, 0x4b0,
|
"042404b0", 0x424, 0x4b0,
|
||||||
"WireGuard: hiter, sodoben, varen tunel VPN",
|
"AmneziaWG: hiter, sodoben, varen tunel VPN",
|
||||||
"https://www.wireguard.com/"
|
"https://www.wireguard.com/"
|
||||||
)
|
)
|
||||||
|
|
||||||
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
|
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
|
||||||
VERSIONINFO_TEMPLATE(
|
VERSIONINFO_TEMPLATE(
|
||||||
"040404b0", 0x404, 0x4b0,
|
"040404b0", 0x404, 0x4b0,
|
||||||
"WireGuard:快速、現代、安全的 VPN 隧道",
|
"AmneziaWG:快速、現代、安全的 VPN 隧道",
|
||||||
"https://www.wireguard.com/"
|
"https://www.wireguard.com/"
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -11,9 +11,9 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/amnezia-vpn/amneziawg-windows-client/version"
|
||||||
"golang.org/x/sys/windows"
|
"golang.org/x/sys/windows"
|
||||||
"golang.org/x/sys/windows/svc"
|
"golang.org/x/sys/windows/svc"
|
||||||
"golang.zx2c4.com/wireguard/windows/version"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
+4
-5
@@ -12,7 +12,6 @@ import (
|
|||||||
"github.com/lxn/walk"
|
"github.com/lxn/walk"
|
||||||
"github.com/lxn/win"
|
"github.com/lxn/win"
|
||||||
"golang.org/x/sys/windows"
|
"golang.org/x/sys/windows"
|
||||||
"golang.zx2c4.com/wireguard/windows/driver"
|
|
||||||
|
|
||||||
"github.com/amnezia-vpn/amneziawg-windows-client/l18n"
|
"github.com/amnezia-vpn/amneziawg-windows-client/l18n"
|
||||||
"github.com/amnezia-vpn/amneziawg-windows-client/version"
|
"github.com/amnezia-vpn/amneziawg-windows-client/version"
|
||||||
@@ -50,7 +49,7 @@ func runAboutDialog(owner walk.Form) error {
|
|||||||
showingAboutDialog = nil
|
showingAboutDialog = nil
|
||||||
}()
|
}()
|
||||||
disposables.Add(showingAboutDialog)
|
disposables.Add(showingAboutDialog)
|
||||||
showingAboutDialog.SetTitle(l18n.Sprintf("About WireGuard"))
|
showingAboutDialog.SetTitle(l18n.Sprintf("About AmneziaWG"))
|
||||||
showingAboutDialog.SetLayout(vbl)
|
showingAboutDialog.SetLayout(vbl)
|
||||||
if icon, err := loadLogoIcon(32); err == nil {
|
if icon, err := loadLogoIcon(32); err == nil {
|
||||||
showingAboutDialog.SetIcon(icon)
|
showingAboutDialog.SetIcon(icon)
|
||||||
@@ -82,7 +81,7 @@ func runAboutDialog(owner walk.Form) error {
|
|||||||
if logo, err := loadLogoIcon(128); err == nil {
|
if logo, err := loadLogoIcon(128); err == nil {
|
||||||
iv.SetImage(logo)
|
iv.SetImage(logo)
|
||||||
}
|
}
|
||||||
iv.Accessibility().SetName(l18n.Sprintf("WireGuard logo image"))
|
iv.Accessibility().SetName(l18n.Sprintf("AmneziaWG logo image"))
|
||||||
|
|
||||||
wgLbl, err := walk.NewTextLabel(showingAboutDialog)
|
wgLbl, err := walk.NewTextLabel(showingAboutDialog)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -91,14 +90,14 @@ func runAboutDialog(owner walk.Form) error {
|
|||||||
wgFont, _ := walk.NewFont("Segoe UI", 16, walk.FontBold)
|
wgFont, _ := walk.NewFont("Segoe UI", 16, walk.FontBold)
|
||||||
wgLbl.SetFont(wgFont)
|
wgLbl.SetFont(wgFont)
|
||||||
wgLbl.SetTextAlignment(walk.AlignHCenterVNear)
|
wgLbl.SetTextAlignment(walk.AlignHCenterVNear)
|
||||||
wgLbl.SetText("WireGuard")
|
wgLbl.SetText("AmneziaWG")
|
||||||
|
|
||||||
detailsLbl, err := walk.NewTextLabel(showingAboutDialog)
|
detailsLbl, err := walk.NewTextLabel(showingAboutDialog)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
detailsLbl.SetTextAlignment(walk.AlignHCenterVNear)
|
detailsLbl.SetTextAlignment(walk.AlignHCenterVNear)
|
||||||
detailsLbl.SetText(l18n.Sprintf("App version: %s\nDriver version: %s\nGo version: %s\nOperating system: %s\nArchitecture: %s", version.Number, driver.Version(), strings.TrimPrefix(runtime.Version(), "go"), version.OsName(), version.Arch()))
|
detailsLbl.SetText(l18n.Sprintf("App version: %s\nWintun version: %s\nGo version: %s\nOperating system: %s\nArchitecture: %s", version.Number, version.WintunVersion(), strings.TrimPrefix(runtime.Version(), "go"), version.OsName(), version.Arch()))
|
||||||
|
|
||||||
copyrightLbl, err := walk.NewTextLabel(showingAboutDialog)
|
copyrightLbl, err := walk.NewTextLabel(showingAboutDialog)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
+6
-6
@@ -53,7 +53,7 @@ func NewTray(mtw *ManageTunnelsWindow) (*Tray, error) {
|
|||||||
func (tray *Tray) setup() error {
|
func (tray *Tray) setup() error {
|
||||||
tray.clicked = tray.onManageTunnels
|
tray.clicked = tray.onManageTunnels
|
||||||
|
|
||||||
tray.SetToolTip(l18n.Sprintf("WireGuard: Deactivated"))
|
tray.SetToolTip(l18n.Sprintf("AmneziaWG: Deactivated"))
|
||||||
tray.SetVisible(true)
|
tray.SetVisible(true)
|
||||||
if icon, err := loadLogoIcon(16); err == nil {
|
if icon, err := loadLogoIcon(16); err == nil {
|
||||||
tray.SetIcon(icon)
|
tray.SetIcon(icon)
|
||||||
@@ -83,7 +83,7 @@ func (tray *Tray) setup() error {
|
|||||||
{label: l18n.Sprintf("&Manage tunnels…"), handler: tray.onManageTunnels, enabled: true, defawlt: true},
|
{label: l18n.Sprintf("&Manage tunnels…"), handler: tray.onManageTunnels, enabled: true, defawlt: true},
|
||||||
{label: l18n.Sprintf("&Import tunnel(s) from file…"), handler: tray.onImport, enabled: true, hidden: !IsAdmin},
|
{label: l18n.Sprintf("&Import tunnel(s) from file…"), handler: tray.onImport, enabled: true, hidden: !IsAdmin},
|
||||||
{separator: true},
|
{separator: true},
|
||||||
{label: l18n.Sprintf("&About WireGuard…"), handler: tray.onAbout, enabled: true},
|
{label: l18n.Sprintf("&About AmneziaWG…"), handler: tray.onAbout, enabled: true},
|
||||||
{label: l18n.Sprintf("E&xit"), handler: onQuit, enabled: true, hidden: !IsAdmin},
|
{label: l18n.Sprintf("E&xit"), handler: onQuit, enabled: true, hidden: !IsAdmin},
|
||||||
} {
|
} {
|
||||||
var action *walk.Action
|
var action *walk.Action
|
||||||
@@ -262,18 +262,18 @@ func (tray *Tray) onTunnelChange(tunnel *manager.Tunnel, state, globalState mana
|
|||||||
case manager.TunnelStarted:
|
case manager.TunnelStarted:
|
||||||
if !wasChecked {
|
if !wasChecked {
|
||||||
icon, _ := iconWithOverlayForState(state, 128)
|
icon, _ := iconWithOverlayForState(state, 128)
|
||||||
tray.ShowCustom(l18n.Sprintf("WireGuard Activated"), l18n.Sprintf("The %s tunnel has been activated.", tunnel.Name), icon)
|
tray.ShowCustom(l18n.Sprintf("AmneziaWG Activated"), l18n.Sprintf("The %s tunnel has been activated.", tunnel.Name), icon)
|
||||||
}
|
}
|
||||||
|
|
||||||
case manager.TunnelStopped:
|
case manager.TunnelStopped:
|
||||||
if wasChecked {
|
if wasChecked {
|
||||||
icon, _ := loadSystemIcon("imageres", -31, 128) // TODO: this icon isn't very good...
|
icon, _ := loadSystemIcon("imageres", -31, 128) // TODO: this icon isn't very good...
|
||||||
tray.ShowCustom(l18n.Sprintf("WireGuard Deactivated"), l18n.Sprintf("The %s tunnel has been deactivated.", tunnel.Name), icon)
|
tray.ShowCustom(l18n.Sprintf("AmneziaWG Deactivated"), l18n.Sprintf("The %s tunnel has been deactivated.", tunnel.Name), icon)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if !tray.mtw.Visible() {
|
} else if !tray.mtw.Visible() {
|
||||||
tray.ShowError(l18n.Sprintf("WireGuard Tunnel Error"), err.Error())
|
tray.ShowError(l18n.Sprintf("AmneziaWG Tunnel Error"), err.Error())
|
||||||
}
|
}
|
||||||
tray.setTunnelState(tunnel, state)
|
tray.setTunnelState(tunnel, state)
|
||||||
})
|
})
|
||||||
@@ -287,7 +287,7 @@ func (tray *Tray) updateGlobalState(globalState manager.TunnelState) {
|
|||||||
actions := tray.ContextMenu().Actions()
|
actions := tray.ContextMenu().Actions()
|
||||||
statusAction := actions.At(0)
|
statusAction := actions.At(0)
|
||||||
|
|
||||||
tray.SetToolTip(l18n.Sprintf("WireGuard: %s", textForState(globalState, true)))
|
tray.SetToolTip(l18n.Sprintf("AmneziaWG: %s", textForState(globalState, true)))
|
||||||
stateText := textForState(globalState, false)
|
stateText := textForState(globalState, false)
|
||||||
stateIcon, err := iconForState(globalState, 16)
|
stateIcon, err := iconForState(globalState, 16)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|||||||
@@ -22,5 +22,5 @@ func Arch() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func UserAgent() string {
|
func UserAgent() string {
|
||||||
return fmt.Sprintf("WireGuard/%s (%s; %s)", Number, OsName(), Arch())
|
return fmt.Sprintf("AmneziaWG/%s (%s; %s)", Number, OsName(), Arch())
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -6,5 +6,5 @@
|
|||||||
package version
|
package version
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Number = "0.5.3"
|
Number = "1.0.0"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
* Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package version
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"golang.zx2c4.com/wintun"
|
||||||
|
)
|
||||||
|
|
||||||
|
func WintunVersion() string {
|
||||||
|
wintunVersion, err := wintun.RunningVersion()
|
||||||
|
if err != nil {
|
||||||
|
return "unknown"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%d.%d", (wintunVersion>>16)&0xffff, wintunVersion&0xffff)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user