필터 지우기
필터 지우기

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

조회 수: 6 (최근 30일)
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
Rob Campbell
Rob Campbell 2023년 1월 14일
편집: Rob Campbell 2023년 1월 14일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Shuba Nandini
Shuba Nandini 2023년 3월 1일
편집: Shuba Nandini 2023년 3월 1일
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
Rik
Rik 2023년 3월 1일
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 2023년 3월 3일
편집: Rob Campbell 2023년 3월 3일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by