How can I get a .mltbx package to display a license dialog?

조회 수: 7 (최근 30일)
Oktay Alkin
Oktay Alkin 2025년 1월 17일
편집: Oktay Alkin 2025년 1월 22일
I have been trying to create a toolbox install file (.mltbx) using the "Package Toolbox" app. I would like to implement what I've seen some packages on File Central do: Display a license page, and wait for the user to accept it before proceeding with the install. I tried to place files with names "license.txt", "license.html", "license.xml" and "license" in the root folder to no avail. Root folder structure is like this:
root
myToolbox
file1.m
file2.m
myToolboxDocs
html
file1.html
file2.html
index.html
helptoc.xml
info.xml
license.txt
license.html
license.xml
license.
The generated .mltbx file installs fine, but does not display a license dialog. Dissecting a downloaded package that is able to display a license dialog (I have unzipped it) I can see that the "metadata" folder has a file named "license.xml" that my generated .mltbx file does not have. I must be missing something here, but I cannot figure out what. Any ideas?

답변 (1개)

Malay Agarwal
Malay Agarwal 2025년 1월 20일
편집: Malay Agarwal 2025년 1월 20일
According to the documentation for creating and sharing toolboxes, you need to provide a valid URL to the license file for the license agreement dialog to show up for your users: https://www.mathworks.com/help/releases/R2023a/matlab/matlab_prog/create-and-share-custom-matlab-toolboxes.html#:~:text=install%20a%20toolbox.-,License%20URL,-%E2%80%94%20The%20URL%20of.
To do this, please modify the "Install Actions" section in the Package a Toolbox dialog box that appears after you select a toolbox folder.
Hope this helps!
  댓글 수: 3
Malay Agarwal
Malay Agarwal 2025년 1월 21일
After looking at your requirements a bit more closely, I think MATLAB currently does not provide a way to add a license for custom toolboxes. The reason why the "GUI Layout Toolbox" shows a license is because it is a toolbox made by MathWorks. However, if you'd like to protect the code used by your toolbox, you can look into obfuscating the code. The following resource provides more details on this: https://www.mathworks.com/help/releases/R2023a/matlab/matlab_prog/protect-your-source-code.html
Oktay Alkin
Oktay Alkin 2025년 1월 22일
편집: Oktay Alkin 2025년 1월 22일
Must be an undocumented feature then. Obfuscation of code is not the issue here. I think a mechanism should be provided to allow the display of a typical BSD license with standard disclaimers of liability. Anyway, thanks for looking into it.

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

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by