[go: nahoru, domu]

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

Discord Portable creates a shortcut in start menu on launch #13

Closed
neodyne opened this issue Dec 7, 2018 · 6 comments
Closed

Discord Portable creates a shortcut in start menu on launch #13

neodyne opened this issue Dec 7, 2018 · 6 comments

Comments

@neodyne
Copy link
neodyne commented Dec 7, 2018

Using the latest discord-portable-win32-0.0.301-24-setup.exe, fully updated, on Windows 10 x64 v1809. No other instances of Discord installed.

Each time the app is run (from discord-portable.exe), it creates a shortcut to the main executable (not the wrapper) in start menu. This can also be seen when inspecting discord-portable.log:

INFO : 2018/12/06 01:52:13.326320 main.go:51: --------
INFO : 2018/12/06 01:52:13.383700 main.go:52: Starting Discord...
INFO : 2018/12/06 01:52:13.383700 main.go:53: Current path: D:\discord_portable
INFO : 2018/12/06 01:52:13.383700 sys.go:197: Create folder D:\discord_portable\data...
INFO : 2018/12/06 01:52:13.384359 electron.go:10: Lookup app folder in: D:\discord_portable\app
INFO : 2018/12/06 01:52:13.384359 electron.go:14: Electron app folder found: app-0.0.301
INFO : 2018/12/06 01:52:13.392847 sys.go:37: Create shortcut for D:\discord_portable\app\app-0.0.301\Discord.exe in C:\Users\xxxx\AppData\Roaming/Microsoft/Windows/Start Menu/Programs/Discord Portable.lnk...
INFO : 2018/12/06 01:52:13.531733 exec.go:29: Process: D:\discord_portable\app\app-0.0.301\Discord.exe
INFO : 2018/12/06 01:52:13.531733 exec.go:30: Args:
INFO : 2018/12/06 01:52:13.531733 exec.go:31: Working dir: D:\discord_portable\app\app-0.0.301
INFO : 2018/12/06 01:52:13.531733 exec.go:32: Data path: D:\discord_portable\data
INFO : 2018/12/06 01:52:13.531733 exec.go:34: Launch Discord...
INFO : 2018/12/06 01:52:13.531733 exec.go:41: Exec D:\discord_portable\app\app-0.0.301\Discord.exe

If another shortcut with the same name already exists (pointing elsewhere), it is replaced with the one above. This may be general electron behavior, as it occasionally happens with another electron-based application made portable (Streamlink Twitch GUI), but not on every launch. If this is intentional, it defeats the purpose of the app being portable, as it leaves unnecessary shortcuts, especially not to the wrapper, but the main executable.

@crazy-max
Copy link
Member
crazy-max commented Dec 8, 2018

@neodyne This behavior was introduced by portapps/rocketchat-portable#3 :

On Windows 8 / 10, notifications are made through an Application User Model ID with Electron. A shortcut to the application must be added in the start menu to make dekstop notifications working.

For the moment we use the default shortcut created by Squirrel and we override the target path because I cannot handle appUserModelId and toastActivatorCLSID properties. More info on Squirrel repository.

We could remove the shortcut on close for example. What do you think ?

@neodyne
Copy link
Author
neodyne commented Dec 8, 2018

Thank you, that would be a possible solution. If I understand correctly, the wrapper keeps running in the background anyway, so it would just have to wait for the main discord process to close, then remove %APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Portable.lnk on exit.

Unfortunately I have no idea how to achieve this in golang - to counter this with other apps I use regular batch script with start /wait on the execution of the main process, then deleting temp files as necessary.

@crazy-max
Copy link
Member

@neodyne I remove temp data on skype-portable for example.
As you can see, this is done after Launch(os.Args[1:]) instruction. This function takes care of the child process and waits the process to exit.

@neodyne
Copy link
Author
neodyne commented Dec 8, 2018

Good to know! By the way, this may be relevant to Discord PTB as well.

@crazy-max
Copy link
Member

Yes indeed and others Portapp based on Electron too. I will push an update asap, thanks for your input

@crazy-max
Copy link
Member

Should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants