Skip to content

Commit

Permalink
feat: 软件目录有 data 这个文件夹的话,数据放在 data 里面
Browse files Browse the repository at this point in the history
还原卡专属
clansty committed May 4, 2022
1 parent b679756 commit 9780e49
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,14 @@ import tray from './components/tray';
import ipcWindow from './ipc/window';
import minimist from 'minimist';
import WindowName from './types/WindowName';
import fs from 'fs';
import path from 'path';

// 如果是 portable 版本,软件目录有 data 这个文件夹的话,数据放在 data 里面
// 提供的 portable 版本的压缩包里自带这个文件夹
if (fs.existsSync(path.join(path.dirname(process.execPath), 'data'))) {
app.setPath('userData', path.join(path.dirname(process.execPath), 'data'));
}

// Disable GPU Acceleration for Windows 7
if (os.release().startsWith('6.1')) app.disableHardwareAcceleration();

0 comments on commit 9780e49

Please sign in to comment.