Skip to content

Commit

Permalink
fix: better cwd detection
Browse files Browse the repository at this point in the history
  • Loading branch information
KochiyaOcean committed Aug 16, 2022
1 parent 897cd0f commit 1271437
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,19 @@ if (process.platform === 'win32' && config.get('poi.misc.shortcut', true)) {
app.getPath('appData') + '\\Microsoft\\Windows\\Start Menu\\Programs\\poi.lnk'
const targetPath = app.getPath('exe')
const argPath = app.getAppPath()
const cwdPath = process.cwd()
const cwdPath = process.cwd().startsWith(app.getPath('appData'))
? ROOT.endsWith('.asar')
? path.dirname(targetPath)
: ROOT
: process.cwd()
const option = {
target: targetPath,
args: argPath,
cwd: cwdPath,
appUserModelId: 'org.poooi.poi',
description: 'poi the KanColle Browser Tool',
}
if (!ROOT.includes('.asar')) {
if (!ROOT.endsWith('.asar')) {
Object.assign(option, {
icon: path.join(ROOT, 'assets', 'icons', 'poi.ico'),
iconIndex: 0,
Expand Down

0 comments on commit 1271437

Please sign in to comment.