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

4 visualizzazioni (ultimi 30 giorni)
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?

Risposte (1)

Malay Agarwal
Malay Agarwal il 20 Gen 2025
Modificato: Malay Agarwal il 20 Gen 2025
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 Commenti
Malay Agarwal
Malay Agarwal il 21 Gen 2025
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 il 22 Gen 2025
Modificato: Oktay Alkin il 22 Gen 2025
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.

Accedi per commentare.

Categorie

Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange

Prodotti


Release

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by