snapcrafters / sommelier-core

Package a Windows application for Linux using a Snap with Wine.
MIT License
30 stars 10 forks source link

[Enhancement]: Support initializing Wine during snap installation to accelerate first-time launch speed #29

Closed brlin-tw closed 2 years ago

brlin-tw commented 2 years ago

What changes would you like?

It appears that the gnome extension uses the configure hook(e.g. /snap/notepad-plus-plus/current/snap/command-chain/hooks-configure-desktop) to create the FontConfig cache during snap installation, this cuts down first launch time as it won't need to do it in runtime.

I wonder whether we can use the same mechanism in Wine initialization as well as it also takes a great amount of time(~minutes) during the first launch?

Any extra information?

No response

merlijn-sebrechts commented 2 years ago

Hm, this is an interesting idea.

I have one concern though: wine initialization is quite a complicated process which might contact the internet and show a GUI. This happens, for example, if wine-mono isn't available yet and the dll hack to stop that dialogue isn't present. :thinking:

I don't think Snap hooks support showing GUIs, do they? Feel free to create a PoC of this to see if it works.

brlin-tw commented 2 years ago

I've dived into this issue these days and here what I discover by far:

As it isn't currently possible/feasible to implement, closing.

merlijn-sebrechts commented 2 years ago

Ok, thanks for the deep-dive!

brlin-tw commented 2 years ago

I put my work-in-progress PoC code here, just if anyone likes to take the challenge: https://github.com/brlin-tw/sommelier-hook-speedup-poc