You are here

Help for MuseScore 3.2.3 portable

5 posts / 0 new
Last post
AntonioBL
Offline
Last seen: 2 years 10 months ago
Joined: 2019-08-17 08:07
Help for MuseScore 3.2.3 portable

Hello,
since Bart.S can no more work on creating MuseScore 3.x PortableApp (because Windows XP support was dropped by the underlying Qt infrastructure), I tried to step in and automatize the creation of the PortableApp for MuseScore future releases.
I think I managed to find and modify all the parts in the code which lead to saving files in user or system data folders and redirect them to the PortableApp folder. However, I still have a problem with Qt registry keys.
In particular, I found that when opening the file dialog (for example with File->Open..), or when saving a custom color in the color selector dialog (for example, select a note or rest, click on the color selector in the inspector on the right and save a custom color in the color dialog), Qt is writing a couple of registry keys in HKCU. I tried to get rid of them by using the "Registry" option and backup-delete in the launcher ini file, but when I tested the resulting application in a vanilla Windows 7 virtual machine (I used one from here: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ ), those keys are still present after exiting the application (I checked they were not present before launching it).
Here are the keys:
HKU\S-1-5-21-1716914095-909560446-1177810406-1000\Software\QtProject\OrganizationDefaults\FileDialog
HKU\S-1-5-21-1716914095-909560446-1177810406-1000\Software\QtProject\OrganizationDefaults\Qt\customColors
while the launcher ini reads:
https://github.com/musescore/MuseScore/blob/0a75ff545cae18ef107c2633e892...
In case, you can try the application here: https://ci.appveyor.com/api/buildjobs/dl0m1cinnh3yxevo/artifacts/MuseSco...
Have I done something wrong in the above ini file? How should I modify it?

I think that after this problem is dealt with, the application should be ok as a PortableApp: should I submit it on this forum for review and approval?

Thank you for your help.
Ciao,
Antonio

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 1 hour 6 min ago
DeveloperModerator
Joined: 2008-07-24 18:46
QtKeysCleanup

Rather than using RegistryValueBackupDelete and RegistryCleanupIfEmpty, instead use QtKeysCleanup, starting after QtProject\OrganizationDefaults.

There are multiple examples of how to do this in officially released applications.

When you feel it's ready for testing, please submit it to the Beta Testing forum, using the Development Test Forum Template. We'll review it at that time, providing any feedback necessary prior to updating the official release.

Bart.S
Offline
Last seen: 6 months 1 week ago
Developer
Joined: 2008-07-23 07:56
QtKeysCleanup

Does this work with QtProject\OrganizationDefaults or just with Trolltech\OrganizationDefaults? The documentation mentions the second one only.

AntonioBL
Offline
Last seen: 2 years 10 months ago
Joined: 2019-08-17 08:07
I tried with QtKeysCleanup,

I tried with QtKeysCleanup, but it didn't work. From the documentation and from the source files of PortableApps.comLauncherGenerator, at the moment it works only on Trolltech\OrganizationDefaults.
However, I found the solution for the problem: I was not making MuseScorePortable save the registry modifications on a reg file. By simply adding:
[RegistryKeys]
qtfiledialog=HKCU\Software\QtProject\OrganizationDefaults\FileDialog
qtcustomcolors=HKCU\Software\QtProject\OrganizationDefaults\Qt\customColors
instead of the RegistryValueBackupDelete it saves the keys before MuseScorePortable execution and restores them back after closing it (with also the RegistryCleanupIfEmpty to remove those keys if they were initially empty).
I think the only problem could be if two PortableApps using Qt 5 run at the same time and they are closed in the reversed order in which they were opened; in that case there could maybe be residual Qt keys in the registry.

By the way, I am preparing for the submission on the Beta forum.
@Bart.S: again thank you very much for the work you have done in these years for a portable version of MuseScore.

Bart.S
Offline
Last seen: 6 months 1 week ago
Developer
Joined: 2008-07-23 07:56
PortableApps.comLauncher

The PortableApps.comLauncher is a bit out of date, best thing is to create custom code. Wink

Log in or register to post comments