Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup IDE and ISCC/ISPP passing define

I would like to use both the InnoIDE and ISCC/ISPP, the difference being that I would like to pass in a parameter, which will override a #define in the script.

In the command line I can pass /Dmyarg=myvalue. That is the same as #define myarg myvalue in the script.

Sadly, the script takes precedence over the command line value. I know, as I tried. I can obviously comment out the #define in the script and the command line define will work, however then I will not be able to use the IDE to build.

Is it possible to set a #define inside InnoIDE somewhere for the project or is there some means to have the command line #define take precedence?

like image 368
Sarah Weinberger Avatar asked Nov 16 '12 19:11

Sarah Weinberger


1 Answers

In your script, do something like this:

#ifndef myarg
# define myarg "mydefault"
#endif

Now, if you compile in the IDE or if you use the command line without specifying /Dmyarg="something", then it will use the default specified in the script. Otherwise, if you do specify something on the command line then it will use that instead.

like image 132
Miral Avatar answered Jan 04 '23 16:01

Miral