Skip to content

Commit

Permalink
auto launch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EnderWolf006 committed Mar 23, 2024
1 parent 7027825 commit bf40acc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ jobs:
2024/2/24: 已更新窗口置顶选项与上课时间倒计时隐藏
2024/3/09: 已支持课表样式修改,包括字体、透明度、间距等属性修改
2024/3/17: 已支持课上隐藏课表,课上仅保留小窗倒计时,开机自动启动,鼠标靠近降低透明度
2024/3/22: 已修复开机自动启动报错Bug,新增小窗口倒计时课程名称显示
2024/3/22: ~~已修复开机自动启动报错Bug~~,新增小窗口倒计时课程名称显示
2024/3/23: 已修复workingDir未配置导致的开机自动启动报错Bug
喜欢本项目的话, 点击右上角的Star支持一下作者吧😘
draft: false
prerelease: false
Expand Down
6 changes: 5 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ function setAutoLaunch() {
openAsHidden: false
})
if (store.get('isAutoLaunch', true)) {
createShortcut.create(startupFolderPath + '/' + shortcutName, app.getPath('exe'), (e) => { e && console.log(e); })
createShortcut.create(startupFolderPath + '/' + shortcutName,
{
target: app.getPath('exe'),
workingDir: app.getPath('exe').split('\\').slice(0, -1).join('\\'),
}, (e) => { e && console.log(e); })
} else {
fs.unlink(startupFolderPath + '/' + shortcutName, () => { })
}
Expand Down

0 comments on commit bf40acc

Please sign in to comment.