ISCC-/D编译器参数似乎无效 [英] ISCC - /D compiler-parameter seems to have no effect
本文介绍了ISCC-/D编译器参数似乎无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Inno Setup命令行编译器的/D参数来选择应在我的设置中包含哪些文件.
I'm trying to use the /D parameter of the Inno Setup Command Line Compiler to choose which files should be included in my setup.
代码如下:
#define MyAppName "MyApp"
#define MyAppVersion "1.0.0"
(....)
#define PHASE
[Setup]
AppVersion={#MyAppVersion}
(....)
[Files]
Source: "C:\temp\myfile.txt"; DestDir: "{app}";
#if PHASE == "test"
Source: "C:\temp\onlyInTestBuildNeeded.txt"; DestDir: "{app}";
#endif
我尝试编译脚本ISCC /DPHASE=test "D:\foo\bar.iss"
,但它似乎对我的PHASE定义没有影响.
I try to compile the script ISCC /DPHASE=test "D:\foo\bar.iss"
but it seems to have no effect on my PHASE define.
那么有人可以向我解释我在做什么错吗?在 Inno设置帮助中找不到更多信息.
So can anyone explain me what I'm doing wrong? I can't find any more information at the Inno Setup Help.
推荐答案
您用
#define PHASE
删除该行或使用#ifdef对其进行检查,以便仅在未通过命令行/D
开关设置该行时对其进行定义:
Delete that line or check it with #ifdef in order to define it only when it is not set via command line /D
switch:
#ifndef PHASE
#define PHASE
#endif
这篇关于ISCC-/D编译器参数似乎无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文