View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0019010 | MMW 5 | Extensions framework | public | 2022-04-24 06:46 | 2023-08-30 16:08 |
Reporter | zvezdan | Assigned To | |||
Priority | urgent | Severity | major | Reproducibility | N/A |
Status | closed | Resolution | duplicate | ||
Target Version | 5.0.3 | Fixed in Version | 5.0.3 | ||
Summary | 0019010: Install / uninstall of add-ons without restart | ||||
Description | The install/uninstall of add-ons should be possible without restart. MM3-4 worked like that without problem. Many other programs having extensions don't require restart, at least not always. All my MM3-4 add-ons have properly implemented both install and uninstall files. My MM3-4 add-ons correctly remove all their traces during uninstall, including INI settings, visible menu items and event handlers. Also, they correctly start the add-on after installation as it is loaded on startup. It is possible to do almost the same with MM5 for uninstall, i.e. to uninstall the add-on without requirement for restart. However, the install is a bigger challenge. I managed to register even handlers, a hotkey, and to get a menu items in the main menu within the install.js. I also could get the menu items in the context menus of all newly opened tracklists, i.e. those opened after installation of the add-on. But I cannot find an easier way to get the same menu items in the context menus of the already displayed tracklists, including Playing. Which is the main reason why I reported the feature request for the needed method (0018997). I didn't test adding of the menu items to the context menu of the tree panel during install of the add-on, that should be considered as well. Also, it would be nice if you add some way for scripters to specify if their add-on requires restart or not. For example, you could add one new setting in the info.json, e.g. "restartNeeded" or "installRequiresRestart" or something like that. If that setting is included, the program should not display the message box suggesting the restart. | ||||
Tags | No tags attached. | ||||
Fixed in build | 2618 | ||||
duplicate of | 0017898 | closed | petr | Add a method to only reload window, to facilitate faster skin switching & addon installation without interrupting playback |
related to | 0018997 | closed | Ludek | Method to add menu item to the context menus of all displayed tracklists needed |
related to | 0020213 | closed | Ludek | Prompt to restart MM5 is not shown after installing a new addon (regression) |
|
@Ludek Looks like the most of demands can be handled/archived in 0017898 |
|
If it is still not clear what is currently possible without restarting the program and what is not easily possible, here is the test add-on. install.js: actions.mnuInstallTest = { title: _('Install test'), category: actionCategories.playback, execute: () => { messageDlg('Install test', 'Information', ['btnOK'], {}, undefined); } }; window._menuItems.play.action.submenu.push({ action: actions.mnuInstallTest, order: 60, grouporder: 10 }); window.menus.tracklistMenuItems.push({ action: actions.mnuInstallTest, order: 60, grouporder: 20 }); info.json: { "title": "Install test", "id": "installTest", "description": "Install test", "version": "1.0.0", "minAppVersion": "5.0.0", "type": "general", "installScript": "install.js", "author": "Zvezdan Dimitrijevic" } Steps: 1. install the add-on; 2. choose No to avoid restart of the program; 3. open the main Play menu -> you will see the newly added "Install test" menu item; 4. choose that item -> it works; 5. open context menu of the Playing list -> there is no added new menu item; 6. a) if you have Playing list with "List" layout, change it to "Simplified list"; 6. b) open context menu of the Playing list -> you will see the newly added "Install test" menu item and it works; 6. c) change back the Playing list layout to the "List"; 6. d) open context menu of the Playing list -> you will see the newly added "Install test" menu item and it works; 7. open the context menu of the main tracklist -> there is no added new menu item; 8. change node to any else; 9. open the context menu of the main tracklist -> well, for some nodes you will see the newly added "Install test" menu item, but not for all. |
|
Re 0017898 : yes, this is planned and will speed up js/html/css reloading, but I think Zvezdan request is different. He is looking for a way to modify existing (already loaded UI code) in install.js script. I think this would only complicate things for addon developers and would result in a need to write the same code twice. I am trying to explain this in my note in the other issue 0018997:0067757 |
|
> this would only complicate things for addon developers It is quite opposite. I suggest that you make things easier for add-on developers. I explained about need to write the same code twice in another issue, it wouldn't be needed if you fix localRequirejs. Is it such big problem for you to add two new info.json settings that will determine if that dreadful dialog box asking for restart is needed or not, one for install and another for uninstall? |
|
>>It is quite opposite. I suggest that you make things easier for add-on developers. I explained about need to write the same code twice in another issue, it wouldn't be needed if you fix localRequirejs.<< => localRequireJs is fixed as 0019009 >>Is it such big problem for you to add two new info.json settings that will determine if that dreadful dialog box asking for restart is needed or not, one for install and another for uninstall?<< It isn't a big problem (for sure), actually seeing that it has been already implemented once upon a time, there can be 'showRestartPrompt' property in the info.json specified. In the past there have been difference between soft "reload" and "restart" (related to 0017898 ) and seeing that if "showRestartPrompt":"true" is specified then the dialog text is: ''Please restart MediaMonkey to finish the installation.' So modified it slightly so that in case of "showRestartPrompt":"false" also the reload dialog is supressed. => Fixed in 2617 @Drakinite: Please document |
|
showRestartPrompt is now documented on the wiki. |
|
I suggested two additional settings, one for install and another for uninstall. There are add-ons that require restart only on install but not on uninstall, or otherwise. |
|
Or, if you want to keep the existing showRestartPrompt setting, you could add two new states beside of "true" and "false", since it accepts string instead of boolean value: "install" and "uninstall". I think they are self-explanatory, but if they are not: - "true" show restart message both on install and uninstall; - "false" - doesn't show on install nor on uninstall; - "install" - show on install, but not on uninstall; - "uninstall" - shown on uninstall, but not on install. |
|
Added the "install" and "uninstall" values (as suggested By Zvezdan) in build 2618. Please document. |
|
Documented on wiki. |
|
Verified 2619 |