Azzera filtri
Azzera filtri

Appdesigner: Package standalone app with large datafiles and easy installation for non-Matlab users

10 visualizzazioni (ultimi 30 giorni)
Hi. I've been working with the appdesigner to try to make some of my scripts more accessible to my colleagues and students. So far, I quite like the appdesigner, and have finished one app that works well on my computer. However, I have struggled to package/distribute the app to colleagues who are not Matlab users. I've run into two categories of problems:
(1) Even when I include the relevant .csv data files in the materials to be packaged, once installed on another system (within-matlab app or as a standalone app), the app can no longer find those data files. If it is a path issue, I am not sure how to hard code the path so it works on anyone's computer with any install. I would like some guidance about the most user friendly way to package data files with the app. Also, note that I cannot save the 2 GB *.csv files as *.mat files because they get too large.
(2) While within-Matlab apps work well so far (meaning, I can install Matlab on a colleague's computer, install my app, and then show them how to run it), I would much rather distribute a standalone app that inexperienced users can just double-click and install on their Mac laptops. I have had no luck at all creating a standalone app that does not require Matlab or internet. I've tried packaging with or without the Matlab runtime. My colleagues report endless permission problems and failed installations on their Macs, and I am not there to troubleshoot for them.
So, all that said, I guess what i am looking for are any tips/advice/examples of packaging standalone apps that need access to large locally-stored datasets. Many Thanks!

Risposte (3)

Sachin Lodhi
Sachin Lodhi il 22 Mar 2024
Hi Narwhal, providing a standalone application directly to users is feasible if they have the same MATLAB Runtime version that the application requires. Otherwise, it's necessary to generate an installer that includes both your application and the MATLAB Runtime. The simplest method for accomplishing this is through the Application Compiler app, where you can create an installer executable (e.g., MyAppInstaller_web.exe located in the for_redistribution folder) to distribute.
Here's a brief overview of available methods :
  • Application Compiler: Utilizes a graphical user interface for the development of standalone applications. The "Package" option generates a standalone app within the for_redistribution_files_only directory and an installer within the for_redistribution directory. It offers an option to include the MATLAB Runtime in the installer, otherwise, it prompts users to download the MATLAB Runtime from the web during the installation.
  • compiler.build.standaloneApplication: A command-line tool that exclusively produces a standalone application without an installer.
  • compiler.package.installer: Another command-line tool, but this one solely generates an installer. It's imperative to have created a standalone application beforehand.
  • mcc: A command-line utility for converting MATLAB scripts/apps into standalone applications or libraries for other languages. It only produces a standalone application.
Please note that, starting from R2020a, using compiler.build.standaloneApplication is recommended for a more straightforward process in creating standalone applications compared to mcc.

daffodil software
daffodil software il 12 Apr 2024
Modificato: Steven Lord il 17 Apr 2024
Packaging a standalone app with large data files in MATLAB's AppDesigner for easy installation by non-MATLAB users involves a few steps. [SL: Removed links that look unrelated to this answer]
1. Develop the App: Design and test your app within MATLAB using AppDesigner, ensuring it functions as expected with the large data files.
2. Optimize Data Handling: If the data files are large, consider strategies to optimize their handling. This could involve:
- Compressing the data files.
- Loading only necessary parts of the data into memory at a time.
- Ensuring efficient data access and storage methods within the app.
3. Compile the App: Use MATLAB Compiler or MATLAB Compiler SDK to compile the app into a standalone application. During this process, you can include the large data files as part of the package. The exact steps are:
- Open MATLAB Compiler: In MATLAB, go to the "Apps" tab and select "Application Compiler" or run `mcc` in the command window.
- Add the main file of your app (the `.mlapp` file) to the project.
- Include any required files in the "Files required for your application to run" section. You can add your large data files here.
- Specify the output directory where the compiled app will be saved.
4. Customize Installation: You might need to create a custom installer if the data files are particularly large or if you need to manage special installation steps. This can be done using:
- MATLAB's Application Compiler which allows you to create an installer for the compiled app.
- Third-party installer creation tools (such as Inno Setup, NSIS, or Advanced Installer) to package your compiled app and data files into a custom installer.
5. Distribute the App: Share the installer with non-MATLAB users. They can run the installer on their machine, which will set up the standalone application without needing MATLAB.

Unthinkable sol
Unthinkable sol il 17 Apr 2024
Modificato: Steven Lord il 17 Apr 2024
Packaging a standalone application with large data files in MATLAB AppDesigner for easy installation by non-MATLAB users requires a few steps. Here is a general approach to achieve this. [SL: Removed links that look unrelated to this answer]
1. Application development: Design and test your app in MATLAB with AppDesigner and make sure it works as expected with large files.
2. Optimizing data processing: If data files are large, consider strategies to optimize their processing. This may include:- Compressing data files.- Loading only the necessary parts into memory at a time.- Ensuring efficient data access and storage methods in the application.
3. Compiling the application: Use the MATLAB Compiler or the MATLAB Compiler SDK to compile the application as a standalone application. During this process, you can include large data files as part of the package.
The exact steps are as follows:-
Open the MATLAB Compiler: In MATLAB, go to the "Applications" tab and select "Application Compiler" or run "mcc" in the command window.- Add the main file of your application ( ` .mlapp` file) to the project.- Include all required files in the "Files required to run the application" section. Here you can add your large data files.

Categorie

Scopri di più su Package and Share Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by