如何在Inno Setup中使用同一脚本构建两个不同的安装程序? [英] How do I build two different installers from the same script in Inno Setup?

查看:222
本文介绍了如何在Inno Setup中使用同一脚本构建两个不同的安装程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想进行标准"安装以供外部使用,但我也想使用相同的脚本并告诉它(也许带有命令行参数?)包括另一组文件(用于调试的PDB文件),我们的实验室装置. (并制作完全不同的安装exe)

I want to make a "standard" install for external use, but I also want to use the same script and tell it (with a command line param perhaps?) to include another set of files (PDB files for debugging) for our lab installations. (And make a totally different install exe)

我该怎么做?有可能吗?

How can I do this? Is it possible?

我没有看到如何在[Files]部分中进行设置(有条件地根据某些值/参数添加文件)

I don't see how to set this in the [Files] section (conditionally add files based on some value/param)

注意–这不是允许用户在安装过程中选择的选项.我希望在我的hudson构建文件或批处理文件中设置构建时选项.

Note – this is not for allowing the user an option DURING the install. I want a build-time option to set in my hudson build or batch file.

我想我可以为pdbs创建一个单独的安装程序,但是我只想用一个文件来做所有的事情.

I suppose I can just create a separate installer for the pdbs, but I'd rather just have one file to do everything.

推荐答案

您可以简单地使用

#ifdef DebugVersion
File: *.pdb ...
#endif

然后像这样调用Inno编译器:

and then call the Inno compiler like this:

iscc.exe -DDebugVersion ...

我还要添加类似的内容,以便获得不同的输出文件名:

I'd also add something like this so you get different output file names:

#ifdef DebugVersion
OutputBaseFileName=mysetup-dbg
#else
OutputBaseFileName=mysetup
#endif

请注意,您可能需要为此使用InnoSetup预编译器,由于某些无法解释的原因,该预编译器不属于默认InnoSetup程序包.最简单的方法是从InnoSetup下载页面获取快速入门包".

Note that you'll probably need the InnoSetup precompiler for this, which, for some inexplicable reason, is not part of the default InnoSetup package. The easiest way to get it is to get the "Quick Start Pack" from the InnoSetup download page.

这篇关于如何在Inno Setup中使用同一脚本构建两个不同的安装程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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