mirror of
https://github.com/dream-pep/koring-launcher.git
synced 2026-09-12 05:45:18 +08:00
fix: 修复打包版背景图黑屏问题,重构数据路径逻辑
新增背景图路径归一化函数,将旧版使用的绝对路径 `/background.png` 转换为适配全环境的正确相对路径;重构Electron主进程的数据基准路径计算逻辑,修复Linux/AppImage打包版的只读目录限制
This commit is contained in:
+3
-3
@@ -20,6 +20,7 @@ import { saveConfig, configExists, getConfig, flushConfig, configPath } from './
|
||||
import { findCachedBackgroundRaw, optimizeBackgroundFile, recoverBackgroundFromDataUrl } from './core/background-image';
|
||||
import { registerResourceSchemePrivileges, registerResourceProtocol } from './resource-protocol';
|
||||
import { createLogger, setDebugModeProvider, installIpcLogging, registerRendererLogBridge } from './core/logger';
|
||||
import { dataBasePath } from './core/paths';
|
||||
|
||||
const { app } = electron;
|
||||
|
||||
@@ -73,9 +74,8 @@ function migrateLegacyFiles(): void {
|
||||
|
||||
// Startup checks: .minecraft dir + config file + first launch detection
|
||||
function runStartupChecks(): { isFirstLaunch: boolean; config: ReturnType<typeof getConfig> } {
|
||||
const dataPath = app.isPackaged
|
||||
? path.dirname(app.getPath('exe'))
|
||||
: path.join(__dirname, '..');
|
||||
// 数据基准:开发→项目根;Windows 打包→exe 目录;Linux/AppImage→userData(exe 目录是只读挂载)
|
||||
const dataPath = dataBasePath();
|
||||
|
||||
// 1. Ensure .minecraft directory exists
|
||||
const minecraftDir = path.join(dataPath, '.minecraft');
|
||||
|
||||
Reference in New Issue
Block a user