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

1 view (last 30 days)
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 Comments
Rob Campbell
Rob Campbell on 14 Jan 2023
Edited: Rob Campbell on 14 Jan 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.

Sign in to comment.

Answers (1)

Shuba Nandini
Shuba Nandini on 1 Mar 2023
Edited: Shuba Nandini on 1 Mar 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 Comments
Rik
Rik on 1 Mar 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 on 3 Mar 2023
Edited: Rob Campbell on 3 Mar 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.

Sign in to comment.

Categories

Find more on Search Path in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!