Skip to content

Commit

Permalink
pr comment and zig on Windows action
Browse files Browse the repository at this point in the history
  • Loading branch information
jyyi1 committed Nov 14, 2024
1 parent 1387385 commit 1b40ee1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build_and_test_debug_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 7 additions & 7 deletions client/electron/app_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand All @@ -51,8 +51,8 @@ export function pathToEmbeddedTun2socksBinary() {
'client',
'output',
'build',
isWindows ? 'windows' : 'linux',
'tun2socks' + (isWindows ? '.exe' : '')
IS_WINDOWS ? 'windows' : 'linux',
'tun2socks' + (IS_WINDOWS ? '.exe' : '')
);
}

Expand All @@ -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'
);
}

Expand All @@ -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(
Expand Down

0 comments on commit 1b40ee1

Please sign in to comment.