From 1b40ee15ddbd84d9a5068bf550b70fecfcbdd769 Mon Sep 17 00:00:00 2001 From: jyyi1 Date: Thu, 14 Nov 2024 15:46:25 -0500 Subject: [PATCH] pr comment and zig on Windows action --- .github/workflows/build_and_test_debug_client.yml | 5 +++++ client/electron/app_paths.ts | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_and_test_debug_client.yml b/.github/workflows/build_and_test_debug_client.yml index 22a85dd527..a43eb87438 100644 --- a/.github/workflows/build_and_test_debug_client.yml +++ b/.github/workflows/build_and_test_debug_client.yml @@ -129,6 +129,11 @@ jobs: with: go-version-file: '${{ github.workspace }}/go.mod' + - name: Install zig + uses: mlugg/setup-zig@v1 + with: + version: 0.13.0 + - name: Build Windows Client run: npm run action client/electron/build windows diff --git a/client/electron/app_paths.ts b/client/electron/app_paths.ts index 7aa4e04a3e..5b99b20a63 100644 --- a/client/electron/app_paths.ts +++ b/client/electron/app_paths.ts @@ -17,7 +17,7 @@ import * as path from 'path'; import {app} from 'electron'; -const isWindows = os.platform() === 'win32'; +const IS_WINDOWS = os.platform() === 'win32'; /** * Get the unpacked asar folder path. @@ -39,7 +39,7 @@ function unpackedAppPath() { */ export function getAppPath() { const electronAppPath = app.getAppPath(); - if (isWindows && electronAppPath.includes('app.asar')) { + if (IS_WINDOWS && electronAppPath.includes('app.asar')) { return path.dirname(app.getPath('exe')); } return electronAppPath; @@ -51,8 +51,8 @@ export function pathToEmbeddedTun2socksBinary() { 'client', 'output', 'build', - isWindows ? 'windows' : 'linux', - 'tun2socks' + (isWindows ? '.exe' : '') + IS_WINDOWS ? 'windows' : 'linux', + 'tun2socks' + (IS_WINDOWS ? '.exe' : '') ); } @@ -62,8 +62,8 @@ export function pathToBackendLibrary() { 'client', 'output', 'build', - isWindows ? 'windows' : 'linux', - isWindows ? 'backend.dll' : 'libbackend.so' + IS_WINDOWS ? 'windows' : 'linux', + IS_WINDOWS ? 'backend.dll' : 'libbackend.so' ); } @@ -74,7 +74,7 @@ export function pathToBackendLibrary() { * @returns A string representing the path of the directory that contains service binaries. */ export function pathToEmbeddedOutlineService() { - if (isWindows) { + if (IS_WINDOWS) { return getAppPath(); } return path.join(