Open oliverschwendener opened 1 month ago
Possible workaround:
https://github.com/electron/electron/issues/42016
Dependency: node_modules/create-desktop-shortcuts
setLoginItemSettings(e, settings){
if(!settings) return;
if(AppCtrl.getOS() === Constants.os.win32){
AppCtrl.createWindowsLoginShortcut(settings);
return;
}
app.setLoginItemSettings(settings);
}
// AppCtrl.js
static createWindowsLoginShortcut({openAtLogin = false} = {}){
const exePath = cuppa.replace(UtilsCtrl.exePath(), '\\\\', '/');
const homePath = cuppa.replace(app.getPath('home'), '\\\\', '/');
if(openAtLogin){
const shortcutDest = `${homePath}/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/`;
createDesktopShortcut({
windows: { filePath: exePath, outputPath:shortcutDest},
});
}else{
const fileDesc = cuppa.fileDescription(exePath);
const shortcutDest = `${homePath}/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/${fileDesc.name}.lnk`;
FileCtrl.removeFileSync(shortcutDest);
}
}
Same for: app.getLoginItemSettings
Autostart option does not work when Ueli is installed via Microsoft Store
To Reproduce Steps to reproduce the behavior:
Expected behavior That the app is added/removed to/from the autostart apps when toggling the "Autostart" option
Environment