如何为已编译的MATLAB创建安装程序,该安装程序要求用户接受我们的许可条款? [英] How can I create an installer for compiled MATLAB which requests that a user accept our licence terms?

查看:105
本文介绍了如何为已编译的MATLAB创建安装程序,该安装程序要求用户接受我们的许可条款?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用MATLAB编写程序以分发给Windows用户.我正在将MATLAB编译器与MATLAB版本r2014a配合使用来创建程序.我可以使用MATLAB应用程序编译器创建Windows安装程序,并且可以正常工作.

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.

但是,我希望安装程序要求我的用户在安装软件之前先阅读并接受许可协议. MATLAB安装程序不提供这种可能性.

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.

有人可以建议打包我编译的MATLAB应用程序的另一种方法吗?我会接受两级安装程序,其中第一个安装程序会提供将MATLAB安装程序解包的许可条款,需要在第二个安装阶段中运行.单相解决方案显然会更好.

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.

推荐答案

您可以使用无设置(适用于Windows的免费安装程序)和 inno脚本工作室(第三方界面来编辑安装程序的脚本).

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

Inno安装程序还允许以Pascal语言编写自定义代码,因此您甚至可以在开始安装之前检查目标计算机上是否已安装Matlab运行时:

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;

注意:对于单阶段安装,您只能使用inno设置部署由matlab编译器创建的可执行文件.

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

修改

要添加具有inno设置的许可证页面,只需在安装程序脚本的[Setup]部分中将指针设置为许可证文本即可.请参见 http://www.jrsoftware.org/ishelp/index.php?topic = setup_licensefile 了解更多信息.

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.

如果要显示以下内容的自定义文本,另请参见 https://stackoverflow.com/a/12599237/684399 每种语言.

See also https://stackoverflow.com/a/12599237/684399 if you want to display custom text for each language.

这篇关于如何为已编译的MATLAB创建安装程序,该安装程序要求用户接受我们的许可条款?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆