Controlling which folders are added on add-on install and notifying user of updates

1 visualización (últimos 30 días)
Hi,
I uploaded a project to the file exchange and I have tried installing it via the add-on manager. This works but MATLAB adds all folders to the path. I wish to have it only add the "code" sub-folder and not add other folders, such as test folders. Is there any way to acheive that?
Secondly, I want to have some way of notifying the user when a new version becomes available on the FEX. At present it seems to me that the only way they can know if there is a new version is if they go to the Add On Manager and look.
  3 comentarios
Rob Campbell
Rob Campbell el 14 de En. de 2023
Editada: Rob Campbell el 14 de En. de 2023
I see. I think maybe I will just roll me own. It's easy enough to remove the extra folders. I can probably watch the releases on GitHub for the version change (https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#list-releases). That has the advantage that it will alert all users, not just though who installed via the App ribbon.

Iniciar sesión para comentar.

Respuestas (1)

Shuba Nandini
Shuba Nandini el 1 de Mzo. de 2023
Editada: Shuba Nandini el 1 de Mzo. de 2023
Hi Rob,
I understand that you are having an issue with adding only code subfolder but no other folders and update users when there is a new version available on FEX.
Please follow the below steps that can help you the create path for only code subfolder:
  1. Create a file named “startup.m” in the MATLAB “startup” folder. You can find the folder by typing “userpath” in the MATLAB command window. This will give you the path to your MATLAB user folder, where you can find the “startup” folder.
  2. In this file, “addpath” and “rmpath” commands can be used to modify the MATLAB path. To add “code” subfolder to the MATLAB path, use this command.
addpath(genpath('path/to/your/project/code'));
3. To remove the other folders from the MATLAB path, you can use the “rmpath” command. To remove all folders named “test” from the MATLAB path, use this command.
rmpath(genpath('path/to/your/project/test'));
4. Save the “startup.m” file and restart the MATLAB. The modified path will be used automatically when MATLAB starts.
Refer this links for more information:
To Update the users when there is a new version available on FEX, you can use the MATLAB Central File Exchange Alerts Service, which allow users to sign up for email notifications.
Here are few steps which you can follow to get updates:
  1. Go to the FEX page for your add-on.
  2. Click on the “Alerts” button on the right-hand side of the page.
  3. Click the “Create Alert” button and select the types of alerts you want to receive (such as new releases or updates to reviews).
Thanks
  2 comentarios
Rik
Rik el 1 de Mzo. de 2023
I don't think it is a good idea to edit the startup.m for users of your FEX submission. I would not appreciate that.
The second part relies on users being savy enough to sign up for notifications on their own, which is a very high barrier. I would be curious to see statistics about what percentage of downloaders sign up for notifications.
Rob Campbell
Rob Campbell el 3 de Mzo. de 2023
Editada: Rob Campbell el 3 de Mzo. de 2023
I manage the alerts myself by parsing the Releases info from GitHub. This is pretty easy:
The path stuff I would just do each time the software is started and not save the path. I don't think there is a need for startup.m here.

Iniciar sesión para comentar.

Categorías

Más información sobre Search Path en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by