View Issue Details

IDProjectCategoryView StatusLast Update
0019010MMW 5Extensions frameworkpublic2023-08-30 16:08
Reporterzvezdan Assigned To 
PriorityurgentSeveritymajorReproducibilityN/A
Status closedResolutionduplicate 
Target Version5.0.3Fixed in Version5.0.3 
Summary0019010: Install / uninstall of add-ons without restart
DescriptionThe 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.
TagsNo tags attached.
Fixed in build2618

Relationships

duplicate of 0017898 closedpetr Add a method to only reload window, to facilitate faster skin switching & addon installation without interrupting playback 
related to 0018997 closedLudek Method to add menu item to the context menus of all displayed tracklists needed 
related to 0020213 closedLudek Prompt to restart MM5 is not shown after installing a new addon (regression) 

Activities

peke

2022-04-25 00:27

developer   ~0067746

@Ludek
Looks like the most of demands can be handled/archived in 0017898

zvezdan

2022-04-25 09:16

updater   ~0067754

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.

Ludek

2022-04-25 10:50

developer   ~0067758

Last edited: 2022-04-25 10:54

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

zvezdan

2022-04-25 16:32

updater   ~0067771

> 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?

Ludek

2022-04-25 18:52

developer   ~0067777

Last edited: 2022-04-26 20:57

>>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

drakinite

2022-04-26 17:17

developer   ~0067802

showRestartPrompt is now documented on the wiki.

zvezdan

2022-04-28 06:39

updater   ~0067838

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.

zvezdan

2022-04-28 11:07

updater   ~0067842

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.

Ludek

2022-04-28 18:57

developer   ~0067858

Added the "install" and "uninstall" values (as suggested By Zvezdan) in build 2618.
Please document.

drakinite

2022-04-30 01:58

developer   ~0067891

Documented on wiki.

peke

2022-05-01 16:06

developer   ~0067895

Verified 2619