Skip to content

Commit bf40acc

Browse files
committed
auto launch fix
1 parent 7027825 commit bf40acc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/main.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ jobs:
5959
2024/2/24: 已更新窗口置顶选项与上课时间倒计时隐藏
6060
2024/3/09: 已支持课表样式修改,包括字体、透明度、间距等属性修改
6161
2024/3/17: 已支持课上隐藏课表,课上仅保留小窗倒计时,开机自动启动,鼠标靠近降低透明度
62-
2024/3/22: 已修复开机自动启动报错Bug,新增小窗口倒计时课程名称显示
62+
2024/3/22: ~~已修复开机自动启动报错Bug~~,新增小窗口倒计时课程名称显示
63+
2024/3/23: 已修复workingDir未配置导致的开机自动启动报错Bug
6364
喜欢本项目的话, 点击右上角的Star支持一下作者吧😘
6465
draft: false
6566
prerelease: false

main.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ function setAutoLaunch() {
4545
openAsHidden: false
4646
})
4747
if (store.get('isAutoLaunch', true)) {
48-
createShortcut.create(startupFolderPath + '/' + shortcutName, app.getPath('exe'), (e) => { e && console.log(e); })
48+
createShortcut.create(startupFolderPath + '/' + shortcutName,
49+
{
50+
target: app.getPath('exe'),
51+
workingDir: app.getPath('exe').split('\\').slice(0, -1).join('\\'),
52+
}, (e) => { e && console.log(e); })
4953
} else {
5054
fs.unlink(startupFolderPath + '/' + shortcutName, () => { })
5155
}

0 commit comments

Comments
 (0)