mirror of
https://github.com/amnezia-vpn/amneziawg-windows-client.git
synced 2026-05-17 08:15:44 +03:00
4
build.bat
Normal file → Executable file
4
build.bat
Normal file → Executable file
@@ -49,7 +49,7 @@ if exist .deps\prepared goto :render
|
||||
if "%SigningCertificate%"=="" goto :success
|
||||
if "%TimestampServer%"=="" goto :success
|
||||
echo [+] Signing
|
||||
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
|
||||
signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d WireGuard x86\amneziawg.exe x86\awg.exe amd64\amneziawg.exe amd64\awg.exe arm64\amneziawg.exe arm64\awg.exe || goto :error
|
||||
|
||||
:success
|
||||
echo [+] Success. Launch amneziawg.exe.
|
||||
@@ -78,7 +78,7 @@ if exist .deps\prepared goto :render
|
||||
del .deps\src\*.exe .deps\src\*.o .deps\src\wincompat\*.o .deps\src\wincompat\*.lib 2> NUL
|
||||
set LDFLAGS=-s
|
||||
make --no-print-directory -C .deps\src PLATFORM=windows CC=%~2-w64-mingw32-gcc WINDRES=%~2-w64-mingw32-windres V=1 RUNSTATEDIR= SYSTEMDUNITDIR= -j%NUMBER_OF_PROCESSORS% || exit /b 1
|
||||
move /Y .deps\src\wg.exe "%~1\awg.exe" > NUL || exit /b 1
|
||||
move /Y .deps\src\awg.exe "%~1\awg.exe" > NUL || exit /b 1
|
||||
)
|
||||
if not exist "%~1\wintun.dll" (
|
||||
copy /Y ".deps\wintun\bin\%~1\wintun.dll" "%~1\wintun.dll" > NUL || exit /b 1
|
||||
|
||||
4
installer/build.bat
Normal file → Executable file
4
installer/build.bat
Normal file → Executable file
@@ -43,7 +43,7 @@ if exist .deps\prepared goto :build
|
||||
if "%SigningCertificate%"=="" goto :success
|
||||
if "%TimestampServer%"=="" goto :success
|
||||
echo [+] Signing
|
||||
signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d "WireGuard Setup" "dist\wireguard-*-%WIREGUARD_VERSION%.msi" || goto :error
|
||||
signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d "AmneziaWG Setup" "dist\amneziawg-*-%WIREGUARD_VERSION%.msi" || goto :error
|
||||
|
||||
:success
|
||||
echo [+] Success.
|
||||
@@ -64,7 +64,7 @@ if exist .deps\prepared goto :build
|
||||
if "%SigningCertificate%"=="" goto :skipsign
|
||||
if "%TimestampServer%"=="" goto :skipsign
|
||||
echo [+] Signing %1
|
||||
signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d "WireGuard Setup Custom Actions" "%~1\customactions.dll" || exit /b 1
|
||||
signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d "AmneziaWG Setup Custom Actions" "%~1\customactions.dll" || exit /b 1
|
||||
:skipsign
|
||||
"%WIX%bin\candle" %WIX_CANDLE_FLAGS% -dWIREGUARD_PLATFORM="%~1" -out "%~1\wireguard.wixobj" -arch %3 wireguard.wxs || exit /b %errorlevel%
|
||||
echo [+] Linking %1
|
||||
|
||||
2
installer/fetcher/Makefile
Normal file → Executable file
2
installer/fetcher/Makefile
Normal file → Executable file
@@ -34,7 +34,7 @@ deploy: $(TARGET)
|
||||
scp $< $(DEPLOYMENT_HOST):$(DEPLOYMENT_PATH)
|
||||
|
||||
sign: deploy
|
||||
ssh $(DEPLOYMENT_HOST) '"C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe"' sign /sha1 $(SIGNING_CERTIFICATE) /fd sha256 /tr $(TIMESTAMP_SERVER) /td sha256 /d '"WireGuard Installer"' '$(DEPLOYMENT_PATH)\$(TARGET)'
|
||||
ssh $(DEPLOYMENT_HOST) '"C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe"' sign /sha1 $(SIGNING_CERTIFICATE) /fd sha256 /tr $(TIMESTAMP_SERVER) /td sha256 /d '"AmneziaWG Installer"' '$(DEPLOYMENT_PATH)\$(TARGET)'
|
||||
scp -T '$(DEPLOYMENT_HOST):$(DEPLOYMENT_PATH)\$(TARGET)' .
|
||||
|
||||
.PHONY: clean deploy sign
|
||||
|
||||
4
installer/fetcher/constants.h
Normal file → Executable file
4
installer/fetcher/constants.h
Normal file → Executable file
@@ -7,9 +7,9 @@
|
||||
#define _CONSTANTS_H
|
||||
|
||||
#define release_public_key_base64 "RWRNqGKtBXftKTKPpBPGDMe8jHLnFQ0EdRy8Wg0apV6vTDFLAODD83G4"
|
||||
#define msi_arch_prefix "wireguard-%s-"
|
||||
#define msi_arch_prefix "amneziawg-%s-"
|
||||
#define msi_suffix ".msi"
|
||||
#define server "download.wireguard.com"
|
||||
#define server "download.amnezia.org"
|
||||
#define port (443)
|
||||
#define latest_version_file "latest.sig"
|
||||
#define msi_path "/windows-client/"
|
||||
|
||||
8
main.go
Normal file → Executable file
8
main.go
Normal file → Executable file
@@ -101,7 +101,7 @@ func checkForWow64() {
|
||||
fatalf("Unable to determine whether the process is running under WOW64: %v", err)
|
||||
}
|
||||
if b {
|
||||
fatalf("You must use the native version of WireGuard on this computer.")
|
||||
fatalf("You must use the native version of AmneziaWG on this computer.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,14 +114,14 @@ func checkForAdminGroup() {
|
||||
}
|
||||
defer processToken.Close()
|
||||
if !elevate.TokenIsElevatedOrElevatable(processToken) {
|
||||
fatalf("WireGuard may only be used by users who are a member of the Builtin %s group.", elevate.AdminGroupName())
|
||||
fatalf("AmneziaWG may only be used by users who are a member of the Builtin %s group.", elevate.AdminGroupName())
|
||||
}
|
||||
}
|
||||
|
||||
func checkForAdminDesktop() {
|
||||
adminDesktop, err := elevate.IsAdminDesktop()
|
||||
if !adminDesktop && err == nil {
|
||||
fatalf("WireGuard is running, but the UI is only accessible from desktops of the Builtin %s group.", elevate.AdminGroupName())
|
||||
fatalf("AmneziaWG is running, but the UI is only accessible from desktops of the Builtin %s group.", elevate.AdminGroupName())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ func main() {
|
||||
}
|
||||
checkForAdminDesktop()
|
||||
time.Sleep(30 * time.Second)
|
||||
fatalf("WireGuard system tray icon did not appear after 30 seconds.")
|
||||
fatalf("AmneziaWG system tray icon did not appear after 30 seconds.")
|
||||
return
|
||||
case "/uninstallmanagerservice":
|
||||
if len(os.Args) != 2 {
|
||||
|
||||
2
ui/raise.go
Normal file → Executable file
2
ui/raise.go
Normal file → Executable file
@@ -67,7 +67,7 @@ func WaitForRaiseUIThenQuit() {
|
||||
return 0
|
||||
}, 0, 0, win.WINEVENT_SKIPOWNPROCESS|win.WINEVENT_OUTOFCONTEXT)
|
||||
if err != nil {
|
||||
showErrorCustom(nil, l18n.Sprintf("WireGuard Detection Error"), l18n.Sprintf("Unable to wait for WireGuard window to appear: %v", err))
|
||||
showErrorCustom(nil, l18n.Sprintf("AmneziaWG Detection Error"), l18n.Sprintf("Unable to wait for AmneziaWG window to appear: %v", err))
|
||||
}
|
||||
for {
|
||||
var msg win.MSG
|
||||
|
||||
2
ui/ui.go
Normal file → Executable file
2
ui/ui.go
Normal file → Executable file
@@ -80,7 +80,7 @@ func RunUI() {
|
||||
if shouldQuitManagerWhenExiting {
|
||||
_, err := manager.IPCClientQuit(true)
|
||||
if err != nil {
|
||||
showErrorCustom(nil, l18n.Sprintf("Error Exiting WireGuard"), l18n.Sprintf("Unable to exit service due to: %v. You may want to stop WireGuard from the service manager.", err))
|
||||
showErrorCustom(nil, l18n.Sprintf("Error Exiting AmneziaWG"), l18n.Sprintf("Unable to exit service due to: %v. You may want to stop AmneziaWG from the service manager.", err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6454
zgotext.go
6454
zgotext.go
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user