2023-10-20 08:23:48 +02:00
|
|
|
/** 在主进程中获取关键信息存储到环境变量中,从而在预加载脚本中及渲染进程中使用 */
|
2023-10-18 05:34:40 +02:00
|
|
|
/** 注意: app.isPackaged 可能被被某些方法改变所以请将该文件放到 main.js 必须位于非依赖项的顶部 */
|
2023-10-20 18:21:18 +02:00
|
|
|
import fixPath from 'fix-path'
|
2023-10-18 05:34:40 +02:00
|
|
|
|
|
|
|
import { app } from 'electron'
|
|
|
|
|
2023-10-20 18:21:18 +02:00
|
|
|
if (process.platform === 'darwin') {
|
|
|
|
fixPath()
|
|
|
|
}
|
|
|
|
|
2023-10-18 05:34:40 +02:00
|
|
|
process.env.IS_PACKAGED = JSON.stringify(app.isPackaged)
|
2023-10-20 08:23:48 +02:00
|
|
|
|
|
|
|
process.env.DESKTOP_PATH = app.getPath('desktop')
|
2023-10-21 10:28:14 +02:00
|
|
|
|
|
|
|
process.env.CWD = process.cwd()
|
2023-10-23 12:14:41 +02:00
|
|
|
|
|
|
|
process.env.LOCALE = process.env.LANG?.split('.')?.[0] || 'zh_CN'
|