How can I deploy an additional folder next to a compiled MATLAB application executable?

I want to compile an application with compile app (standaloneApplicationCompiler) and deploy a folder with the installed application. My goal is to place that folder in the same installation directory as the executable, for example:
  C:\Program Files\xxx\
  |- appname.exe
  |- folder_name
The "Files Packaged" in the compile app in the Installer section can include extra files, but it does not provide a standard way to expand a folder into the same path as the executable after installation. I also tried using "copyfile in" the main script, but it was difficult to identify the packaged files at runtime.

 Risposta accettata

The compile app (standaloneApplicationCompiler) does not provide a standard GUI feature to install additional files or folders directly into the same directory as the executable.
As a workaround, export the build script from the compile app by using "Export Build Script", copy the generated script into a new editable .m file, and add the additional folder in the package options, for example:
>>  packageOpts.AdditionalFiles = fullfile("folder_name");
Then build the installer from the edited script instead of relying only on the GUI.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by