How can I create one installer for multiple deployable components built using MATLAB Compiler or MATLAB Compiler SDK?

19 views (last 30 days)

I am using MATLAB Compiler and MATLAB Compiler SDK in MATLAB R2024b to deploy a standalone application and other deployable software components.
Using the various "compiler.build" functions, I have built several deployable components and kept the "compiler.build.Results" objects returned from these functions. Using the "compiler.package.installer" function, I want to create one installer for all my deployable components.
How can I accomplish this task?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 May 2025
As of MATLAB R2024b, the "compiler.package.installer" function does not accept multiple "compiler.build.Results" objects. To work around this, the specific files of the deployable components can be used with the "compiler.package.installer" function to package all the deployable components into one installer.
For the following example, a standalone application and two C++ shared libraries (DLLs) will be packaged into one installer.
  1. Using the "compiler.build.standaloneApplication" function, build a deployable standalone application and return a "compiler.build.Results" object named "buildResults".
>> buildResults = compiler.build.standaloneApplication(myAppFile);
  1. Using the appropriate "compiler.build" functions, build the other deployable software components.
>> compiler.build.cppSharedLibrary(myAppFile2, 'Interface', 'mwarray'); >> compiler.build.cppSharedLibrary(myAppFile3, 'Interface', 'mwarray');
  1. Open the multiple "requiredMCRProducts.txt" files generated from running the functions in the prior steps and merge their contents into one "requiredMCRProducts.txt" file.
  2. Create a string array variable named "fileList" that contains the file names of the deployable components to include in the installer.
>> fileList = [buildResults.Files; {'foo.dll'; 'bar.dll'}];
  1. Using the merged "requiredMCRProducts.txt" file from step 3 and the "fileList" variable from step 4, create an installer using the "compiler.package.installer" function. Refer to the MATLAB Compiler documentation for more information on creating an installer using files.
>> compiler.package.installer(fileList, 'requiredMCRProducts.txt', 'ApplicationName', 'MyApp');
Note that in this example, the workaround will install the standalone application but not the other deployable software components on the target machine. The other components will just be located in the same directory as the standalone application executable.

More Answers (0)

Categories

Find more on Get Started with MATLAB Compiler SDK in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!