preprocessor


I want to nest include files inside include files. Why cant I do that in Inno Setup?


So lets say I have a Inno Setup file (let's call it master.iss) with a files section like this:
[Files]
#include PathToIncludeFile\IncludeFile.iss
That works beautiful and fine. The content of IncludeFile.iss is effectively inserted into the master.iss file where the #include exists.
So now I want the content of the #include file to me nested in more includes. So the IncludeFile.iss looks like this:
#include C:\PathToFile\FileWithRealFilesDataForProject1.iss
#include C:\PathToFile\FileWithRealFilesDataForProject2.iss
#include C:\PathToFile\FileWithRealFilesDataForProject3.iss
#include C:\PathToFile\FileWithRealFilesDataForProject4.iss
#include C:\PathToFile\FileWithRealFilesDataForProject5.iss
#include C:\PathToFile\FileWithRealFilesDataForProject6.iss
The compiler for Inno Setup compiling Master.iss will say
(File: PathToIncludeFile\IncludeFile.iss \n Line 1: \n Column 11:)
[ISSP] Undeclaired Identifier C"
I suppose I could achieve what I want with a batch file or something, but it would be a lot more straight forward if I could just do this with nested #includes.
BTW: My current Inno Setup Compiler is 5.5.6 (u)
You can nest include files.
Your problem is that in Inno Setup preprocessor the string literals must be enclosed in double-quotes (or single-quotes), like:
#include "C:\PathToFile\FileWithRealFilesDataForProject1.iss"
When you omit the quotes, the preprocessor tries to interpret the #include argument as an expression. Hence it treats the C (leading alphanumeric sequence) as an identifier.
See these topics in Inno Setup Preprocessor documetation:
Expression Syntax.
#include directive
For the same reason, your primary include, the way you have it in your post, won't compile either. You must have enclosed it in double quotes.
For this:
#include PathToIncludeFile\IncludeFile.iss
I'm getting
[ISPP] Undeclared identifier: "PathToIncludeFile".
(as expected)

Related Links

Preprocessor, Postprocessor, Geometric Processor and NC processor
Gfortran pre-processor directives for Different Operating systems
Good data set for Pre-processing
IDE inserts incorrect #include statement
Save string in C preprocessor
Fortran preprocessing with Portland compiler
Making a macro expansion dependent on its arguments
How to set ISPP defines based on default Inno Setup variables?
standalone C++ preprocessor
Annotations in OCaml
Obtaining the include paths cpp searches
Test for empty macro definition
m4 does not obey expansion?
Detect compilation on Bada OS
Which of the C-family languages have a preprocessor?
Generic preprocessor: How to use for any kind of file?

Categories

HOME
google-cloud-platform
cobalt
codenvy
fpga
phpmyadmin
mjml
3d
serialization
oracle-apex-5
nsbundle
cakephp-3.4
elasticsearch-5
extjs4.2
openstreetmap
windows-ce
java.util.logging
flatpak
selectize.js
azure-powershell
google-data-studio
foreign-keys
identity-management
sar
symbols
postscript
resourcebundle
ms-access-2003
handler
exchangewebservices
boost-asio
eviews
mustache
carriage-return
yowsup
batching
navigator
sql-server-ce
dm-script
modernizr
password-protection
news
subclipse
show-hide
builder
wcftestclient
datamaps
corruption
page-replacement
scalding
stdmap
otp
jtree
django-1.10
ampps
testrail
cubism.js
winusb
redbeard-ios
jboss-tools
i386
google-query-language
kango-framework
ellucian-scribe
grass
cycle2
jparsec
dllimport
ember-cli-rails
finalbuilder
viola-jones
wso2greg
pyobjc
omnifaces
aspectj-maven-plugin
mraid
kubuntu
filesplitting
cocos3d
kissfft
ora-00904
vsx
vbe
conditionaltagsupport
android-audiorecord
ora-06550
notorm
model-driven-development
jeromq
cnf
poker
node-blade
joomla-template
apache-abdera
inkcanvas
virtualpathprovider
luabind
pinch
denied
entitydatasource
twitterizer
collectionviewsource
photolibrary
presentation-layer
load-time
silent
ajax-polling
request-headers
data-mapping
glui
mathematical-notation
firefox-3

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App