Inno Setup中的自定义命令行参数具有默认值,因此我可以通过构建配置 [英] Custom command line parameter in Inno Setup with default value so I can pass build configuration
问题描述
我正在使用Inno Setup .iss文件为.NET项目创建安装程序.
我想默认安装程序版本使用Debug版本输出路径,以便开发人员可以创建本地安装程序进行测试,但是我希望能够将参数传递给Inno编译器,以告诉它在执行操作时使用Release输出路径.正确的生产方式.
根据我的收集,我无法向 [Setup]
部分添加自定义变量,因为我尝试过
[设置]Config = {param:config | Debug}
如此SO答案中所述,但我明白了
无法识别的[Setup]节指令"Config"
因此,在我看来,唯一的选择是在 #define
部分中添加一些内容.
我看到可以在命令行使用 那么有什么好办法可以做我想要的事情,在命令行中如果没有传递任何东西,我可以使用默认值运行编译,并且在可用时使用命令行值? 当前,我的命令行调用如下所示: 我正在使用Inno Setup 5.5.9. 使用 I'm working with an Inno Setup .iss file to create an installer for a .NET project. From what I can gather I can't add a custom variable to the as described in this SO answer, but I get Unrecognized [Setup] section directive "Config" So it appears to me that the only option is to have something in the I see that it's possible to define parameters at the command line with Unknown filename prefix "..\project\bin\{param:" And if I So is there any neat way to do what I want, where I can run the compile with a default value if nothing is passed into the command line, and use the command line value if it's available? Currently my command line call looks like this: I'm using Inno Setup 5.5.9. Use the
这篇关于Inno Setup中的自定义命令行参数具有默认值,因此我可以通过构建配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!/Dparamname = value
定义参数.因此,我按照,则在命令行中传递/DConfig = Release
不会覆盖Debug值./p>
还是有一种我更缺少的更简单的方法来做到这一点. iscc path \ to \ my \ iss \ file/DConfig = Release
#ifndef
:
#ifndef配置#define配置调试"#万一
I want to default the installer build to use the Debug build output paths so devs can create local installer for testing, but I want to be able to pass a parameter to the Inno compiler to tell it to use the Release output paths instead when doing a proper production build.[Setup]
section, because I tried[Setup]
Config = {param:config|Debug}
#define
section./Dparamname=value
.
So I tried the {param:Config|Debug}
and {param:#Config|Debug}
as suggested in this answer, but again I get compiler errors:
#define Config "Debug"
in the iss file then passing /DConfig=Release
at the command line doesn't override the Debug value.
Or is there an altogether easier way to do this that I'm missing.
iscc path\to\my\iss\file /DConfig=Release
#ifndef
:#ifndef Config
#define Config "Debug"
#endif