如何通过 Inno Setup 向 msi 传递值

发布于 2024-08-26 02:02:07 字数 293 浏览 2 评论 0原文

我使用 Innosetup 作为我的 msi 设置的引导程序。它包含了主要的错误文件和其他先决条件。当我们使用完整的 UI 时它工作得很好。现在我想以静默模式安装整个设置。对于 InnoSetup,我们可以给出 /SILENT 或 /VERYSILENT。我如何将值传递给 msi(即解锁密钥、要安装的功能等)。如果我单独安装 msi,我可以在命令行中给出它。但是当作为单个exe使用时,我该如何给出它?我应该为此编写任何 inf 或 bat 文件吗?相同的 exe 将用于以静默模式和完整 UI 进行安装。

等待回复。

谢谢和问候, 瓦伦

I'm using Innosetup as a bootstrapper for my msi setup. It packs the main mis file and other prerequisites. It works fine when we use full UI. Now i want to install the whole setup in silent mode. For InnoSetup we can give /SILENT OR /VERYSILENT. How can i pass values to msi (i.e., Unlock Key, Features to be installed etc.). If i install msi alone, i can able to give it in a command line. But when using as a single exe, how can i give it ? should i write any inf or bat files for this ? The same exe will be used to install in silent mode as well as in full UI.

Waiting for the reply.

Thanks and Regards,
Varun

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

王权女流氓 2024-09-02 02:02:07

您可以使用:

function ParamStr(Index: Integer): String;

描述
返回传递给安装程序或卸载程序的第索引命令行参数。

在您的脚本中,您可以使用 ParamStr[i] 中的值运行 msi。

You can use:

function ParamStr(Index: Integer): String;

Description:
Returns the Index-th command line parameter passed to Setup or Uninstall.

In your script you can run msi with value from ParamStr[i].

罗罗贝儿 2024-09-02 02:02:07

这是我的 mariadb 安装程序的解决方案。在运行部分中输入:

Filename: "msiexec.exe"; Parameters: "/i {app}\mariadb-5.2.9-win32.msi PORT=3306 PASSWORD=xxxxxx SERVICENAME=MySQL ADDLOCAL=ALL REMOVE=DEVEL,HeidiSQL INSTALLDIR=""C:\mariadb"" /L*v log.txt /qb"; WorkingDir: {app}; Flags: waituntilterminated skipifdoesntexist

我的问题是 /i 之后的双引号,一旦删除双引号,安装就会完美无声地执行(/ qb),并为 mariadb 安装创建一个 log.txt 文件。

This is my solution for mariadb installer. In the run section put:

Filename: "msiexec.exe"; Parameters: "/i {app}\mariadb-5.2.9-win32.msi PORT=3306 PASSWORD=xxxxxx SERVICENAME=MySQL ADDLOCAL=ALL REMOVE=DEVEL,HeidiSQL INSTALLDIR=""C:\mariadb"" /L*v log.txt /qb"; WorkingDir: {app}; Flags: waituntilterminated skipifdoesntexist

My problem was with double quotation marks after /i and once the ones were removed, the installation was performed perfectly and silently (/ qb) and create a log.txt file for mariadb installation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文