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

寵の児 提交于 2019-12-03 17:08:13
CitizenInsane

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://stackoverflow.com/a/12599237/684399 if you want to display custom text for each language.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!