10

I have an Inno Setup script with preprocessor directives (#defines, #ifs, etc.)

I want to run the Inno Setup preprocessor on my script and see the preprocessor's output (translation in Inno-Setup-speak). That is, I want to look at the result of the preprocessor which it normally feeds into the Inno Setup Compiler, where all the references to {#something} are changed into whatever something was defined as.

I look at the command line options (of iscc.exe) and #pragma directives and did not find what I'm looking for. I see that I can specify not to run the compiler (#pragma -c- | /$c-) but I did not find a way to look at the output of the preprocessor.

In short, how do I look at the output of the Inno Setup preprocessor?

Martin Prikryl
  • 167,268
  • 50
  • 405
  • 846
bandana
  • 3,082
  • 5
  • 25
  • 30

1 Answers1

14

When all else fails look for the answer yourself

Add the following line right at the end of the script.

This will generate a file preprocessed.iss with all macros expanded and #defines, #ifs etc. processed.

#expr SaveToFile(AddBackslash(SourcePath) + "Preprocessed.iss")
Martin Prikryl
  • 167,268
  • 50
  • 405
  • 846
bandana
  • 3,082
  • 5
  • 25
  • 30
  • 4
    I would recommend to add this line at the very end of the script, because `SaveTofile` outputs only the preprocessed part of the script up to the currently processed line. – splash Jul 28 '10 at 13:17