Skip to content

Commit fbf83ef

Browse files
committed
1. Language Add Zig module
2. Database Add Qdrant module
1 parent 679e9c4 commit fbf83ef

10 files changed

Lines changed: 61 additions & 12 deletions

File tree

.github/workflows/windows-version-build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,14 @@ jobs:
5353
5454
- name: Build Go helper with build-win.ps1
5555
run: |
56+
go install github.com/tc-hib/go-winres@latest
57+
$GOBIN = $(go env GOPATH) + "\bin"
58+
$env:PATH = "$GOBIN;$env:PATH"
5659
cd "$env:GITHUB_WORKSPACE/src/helper-go"
5760
go clean -modcache
5861
go mod download
5962
go mod tidy
63+
go-winres make
6064
# 使用 PowerShell 脚本构建
6165
.\build-win.ps1
6266

build/macos.build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 10
1+
version: 11

build/windows.build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 16
1+
version: 17

configs/electron-builder.linux.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const desktop: any = {
1515
const conf: Configuration = {
1616
productName: 'FlyEnv',
1717
executableName: 'FlyEnv',
18-
buildVersion: '4.13.0',
18+
buildVersion: '4.13.1',
1919
electronVersion: '35.7.5',
2020
appId: 'com.xpf0000.flyenv',
2121
asar: true,

configs/electron-builder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const currentArch = process.arch === 'arm64' ? 'arm64' : 'x64'
1919
const conf: Configuration = {
2020
productName: 'FlyEnv',
2121
executableName: 'FlyEnv',
22-
buildVersion: '4.13.0',
22+
buildVersion: '4.13.1',
2323
electronVersion: '35.7.5',
2424
appId: 'phpstudy.xpfme.com',
2525
asar: true,
@@ -69,7 +69,7 @@ const conf: Configuration = {
6969
extendInfo: {
7070
'Icon file': 'icon.icns',
7171
CFBundleDisplayName: 'FlyEnv',
72-
CFBundleExecutable: 'PhpWebStudy'
72+
CFBundleExecutable: 'FlyEnv'
7373
},
7474
type: 'distribution',
7575
darkModeSupport: true,

configs/electron-builder.win.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import AfterSign from '../build/afterSign'
33

44
const conf: Configuration = {
55
productName: 'FlyEnv',
6-
executableName: 'PhpWebStudy',
7-
buildVersion: '4.13.0',
6+
executableName: 'FlyEnv',
7+
buildVersion: '4.13.1',
88
electronVersion: '35.7.5',
99
appId: 'phpstudy.xpfme.com',
1010
asar: true,
@@ -14,7 +14,6 @@ const conf: Configuration = {
1414
files: [
1515
'dist/electron/**/*',
1616
'dist/render/**/*',
17-
'static/sh/Windows/flyenv-helper-init.ps1',
1817
'!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme,LICENSE}',
1918
'!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}',
2019
'!**/node_modules/*.d.ts',
@@ -31,7 +30,7 @@ const conf: Configuration = {
3130
to: 'app.asar.unpacked/node_modules/helper/flyenv-helper.exe'
3231
}
3332
],
34-
signExts: ['flyenv-helper.exe', 'flyenv-helper-init.ps1'],
33+
signExts: ['flyenv-helper.exe'],
3534
icon: 'build/icon.ico',
3635
target: [
3736
{

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "PhpWebStudy",
3-
"version": "4.13.0",
2+
"name": "FlyEnv",
3+
"version": "4.13.1",
44
"description": "All-In-One Full-Stack Environment Management Tool",
55
"author": {
66
"name": "Pengfei Xu",

src/helper-go/build-win.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ $env:CGO_ENABLED = "0"
7070
$buildOutput = Join-Path -Path $BUILD_DIR -ChildPath $OUTPUT_FILENAME
7171
$buildArgs = @(
7272
"build",
73-
"-ldflags=`"-H windowsgui`"",
73+
"-ldflags=`"-s -w -H windowsgui`"",
7474
"-o",
7575
$buildOutput,
7676
$MAIN_PACKAGE

src/helper-go/winres.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"RT_VERSION": {
3+
"vars": {
4+
"FileDescription": "FlyEnv Helper - System Service Manager",
5+
"ProductName": "FlyEnv",
6+
"CompanyName": "FlyEnv Project",
7+
"OriginalFilename": "flyenv-helper.exe",
8+
"LegalCopyright": "Copyright © Pengfei Xu",
9+
"FileVersion": "1.0.0.8",
10+
"ProductVersion": "4.13.0"
11+
}
12+
}
13+
}

src/main/index.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,42 @@
1+
import { app } from 'electron'
12
import path from 'path'
23
import Launcher from './Launcher'
34
import { fileURLToPath } from 'node:url'
45
import { dirname } from 'node:path'
6+
import { existsSync } from 'node:fs'
7+
import fs from 'fs-extra' // 建议使用 fs-extra 处理文件夹复制
8+
59
const __dirname = dirname(fileURLToPath(import.meta.url))
610

11+
const appData = app.getPath('appData')
12+
const oldPath = path.join(appData, 'PhpWebStudy')
13+
const nowPath = path.join(appData, 'FlyEnv')
14+
15+
/**
16+
* 迁移逻辑:如果新文件夹不存在且旧文件夹存在,则进行同步复制
17+
*/
18+
try {
19+
if (!existsSync(nowPath) && existsSync(oldPath)) {
20+
console.log('Detected legacy data, migrating from PhpWebStudy to FlyEnv...')
21+
// 使用 copySync 同步复制整个目录,确保在应用完全启动前数据到位
22+
fs.copySync(oldPath, nowPath, {
23+
overwrite: false,
24+
errorOnExist: true
25+
})
26+
console.log('Migration successful.')
27+
}
28+
} catch (err) {
29+
console.error('Data migration failed: ', err)
30+
}
31+
32+
// 重要:强制将当前的 userData 指向 nowPath
33+
// 这样无论 package.json 里的 name 是什么,都会使用 FlyEnv 目录
34+
app.setPath('userData', nowPath)
35+
app.setPath('sessionData', nowPath)
36+
37+
// 打印确认最终路径
38+
console.log('Final userData path: ', app.getPath('userData'))
39+
740
global.__static = path.resolve(__dirname, 'static/').replace(/\\/g, '\\\\')
841
global.launcher = new Launcher()
942

0 commit comments

Comments
 (0)