How can I create an installer for compiled MATLAB which requests that a user accept our licence terms?
Asked Answered
J

1

3

I am writing programs in MATLAB to distribute to Windows users. I am using the MATLAB compiler with MATLAB release r2014a to create the programs. I can create a Windows installer using the MATLAB application compiler and it works acceptably.

However, I would like the installer to require that my users review and accept a licence agreement before they install the software. The MATLAB installer does not provide this possibility.

Can anyone suggest an alternative way to package my compiled MATLAB applications? I would accept a two level installer, where the first installer presents the licence terms the unpacks the MATLAB installers, which need to be run in a second installation phase. A single phase solution would clearly be better.

Junette answered 2/2, 2016 at 8:38 Comment(0)
H
6

You may use inno setup (a free installer for windows) and inno script studio (a third party interface to edit installer's scripts).

Inno setup allows also to write custom code in pascal language so you can even check that matlab runtime is installed on target machine prior to start installation:

[Code]
function IsMCR90Installed : Boolean;
begin
    Result := RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\MathWorks\MATLAB Runtime\9.0');
end;

function InitializeSetup(): Boolean;
begin
    Result := true;

    if (not IsMCR90Installed) then
    begin
        MsgBox('This setup requires the Matlab Component runtime v9.0.'#13'Please install the Matlab Component Runtime and run this setup again.', mbError, MB_OK) ;
        Result:=false;
        Exit;
    end;
end;

NB: For a single phase installation, you may only deploy the executable created by the matlab compiler with inno setup.

Edit

To add a license page with inno setup just set pointer to license text in the [Setup] section of installer's script. See http://www.jrsoftware.org/ishelp/index.php?topic=setup_licensefile for more detail.

See also https://mcmap.net/q/1924341/-different-license-files-for-different-languages-in-inno-setup if you want to display custom text for each language.

Hemihedral answered 2/2, 2016 at 9:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.