Skip to content

Commit

Permalink
test: frp
Browse files Browse the repository at this point in the history
  • Loading branch information
chenfan0 committed Oct 30, 2024
1 parent edff5e7 commit fc97640
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ files:
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
asarUnpack:
- ./resources/iconTemplate.png
- ./resources/index.html
- ./resources/*
win:
target:
- target: "nsis"
Expand All @@ -24,6 +23,8 @@ win:
to: "Resources"
- from: "./resources/index.html"
to: "Resources"
- from: "./resources/*"
to: "Resources"
nsis:
oneClick: false
artifactName: ${name}-${version}-${arch}.${ext}
Expand Down
Binary file added resources/frpc.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/download-dep/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,5 @@ async function makeSureFrpDependenciesExist(dirname: string) {

export async function makeSureDependenciesExist(dirname: string) {
await makeSureFfmpegDependenciesExist(dirname)
await makeSureFrpDependenciesExist(dirname)
// await makeSureFrpDependenciesExist(dirname)
}
12 changes: 8 additions & 4 deletions src/main/frpc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,17 @@ export async function startFrpcProcess(

writeLog('frpc', 'frpcConfigPath: ' + frpcConfigPath)

const resourcePath = is.dev
? join(__dirname, '../../../resources/')
: process.resourcesPath

const frpcPath = isMac
? isArm
? join(userPath, 'frp-mac-arm64/frpc')
: join(userPath, 'frp-mac-amd64/frpc')
? join(resourcePath, 'frp-mac-arm64/frpc')
: join(resourcePath, 'frp-mac-amd64/frpc')
: isArm
? join(userPath, 'frp-win-arm64/frpc.exe')
: join(userPath, 'frp-win-amd64/frpc.exe')
? join(resourcePath, 'frpc.exe')
: join(resourcePath, 'frpc.exe')

const frpcProcess = spawn(frpcPath, ['-c', frpcConfigPath])

Expand Down

0 comments on commit fc97640

Please sign in to comment.