Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Autostart option does not work when Ueli is installed via Microsoft Store #1137

Open
oliverschwendener opened this issue Jul 8, 2024 · 13 comments · Fixed by #1231 or #1331
Open

Comments

@oliverschwendener
Copy link
Owner

Autostart option does not work when Ueli is installed via Microsoft Store

To Reproduce
Steps to reproduce the behavior:

  1. Open settings
  2. Go to "General" settings
  3. Enable "Autostart"
  4. Check if app has been added to autostart apps in Windows Task Manager
  5. The app is not listed

Expected behavior
That the app is added/removed to/from the autostart apps when toggling the "Autostart" option

Environment

  • OS: Windows
  • Version 9.0.2
@oliverschwendener
Copy link
Owner Author

Possible workaround:

electron/electron#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

@sacp
Copy link

sacp commented Aug 24, 2024

The issue is still happening on version 9.3.2 (Win 10)
Is there a way we can apply directly this possible workaround, or it needs to be done via the normal code cycle/release?

Thanks.

@oliverschwendener
Copy link
Owner Author

Sorry for the confusion. This is still an issue and as far as I know there is no workaround that you can apply. You have to wait until we fix this (with the workaround mentioned above) in the code.

@sacp
Copy link

sacp commented Oct 27, 2024

Hello.
I still have this issue.
Even tried uninstalling, cleaned remains (bulk crap uninstaller), and reinstalled from the Windows store.
I'm in version 9.7.0. Nothing appears on the debug option.

@tkohlmeier
Copy link
Collaborator

I also have this issue. I think the problem is, that the autostart entry directs to a directory my user has no access rights for:
C:\Program Files\WindowsApps\1915OliverSchwendener.Ueli_9.14.2.0_x64__a397x08q5x7rp\app

When I try to run it via cmd I get an access denied error. With this command I can open ueli:

start shell:AppsFolder\1915OliverSchwendener.Ueli_a397x08q5x7rp!OliverSchwendener.Ueli

@tkohlmeier tkohlmeier reopened this Jan 19, 2025
@tkohlmeier
Copy link
Collaborator

tkohlmeier commented Jan 21, 2025

@oliverschwendener: Calling shell.writeShortcutLink with target shell:AppsFolder\1915OliverSchwendener.Ueli_a397x08q5x7rp!OliverSchwendener.Ueli creates a working link, so this would fix the problem. Do you know what a397x08q5x7rp is? Is it the same on any machine or do we need to determine it at runtime?

@tkohlmeier
Copy link
Collaborator

tkohlmeier commented Jan 21, 2025

I just found it out, it's the publisher id. So this should be constant and I think we can hard-code it. What do you think?

@oliverschwendener
Copy link
Owner Author

The next release contains a fix for this.

@oliverschwendener
Copy link
Owner Author

oliverschwendener commented Jan 28, 2025

@tkohlmeier This still doesn't work for me. The shortcut is being created and it works when I open it manually, but Ueli won't start automatically when I log in.

@tkohlmeier
Copy link
Collaborator

It does work on my machine. Do you see an error in the Windows event log (eventvwr.msc)?

@oliverschwendener
Copy link
Owner Author

No, no errors. Does it show up in the task manager under "Startup apps" for you?

@oliverschwendener
Copy link
Owner Author

Are you using Windows 11 or 10? I'm using Windows 11.

@tkohlmeier
Copy link
Collaborator

Yes, it does show up under "Startup apps". I cannot open its properties though.

I'm using Windows 11.

I even checked it on another computer, also Windows 11. It does also work. Strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants