cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DemonPiggies
Level 7

Retrieving string value from Preprocessor Defines

Hopefully simple answer but currently in our installs we use have 2 different version strings. The first is fully numerical that InstallShield uses and the other is set in the String table that contains "Alpha", "Beta", etc. I want to start moving all of our installations to become more automated.

In the "Compiler Preprocessor Defines" section of the Build tab I've added:

VERSIONSTRING="1.0.whatever.01"


I get compiler errors with this line:

szDisplableVersion = VERSIONSTRING;


It's along the lines of "needing a tydef" or "needing a string type". I need a way of retrieving VERSIONSTRING's actual value.

The compiler is fine is I do this:

#define VERSIONSTRING "1.0.whatever.01"


Any ideas?
Labels (1)
0 Kudos
(3) Replies
RobertDickau
Flexera Alumni

Alas, according to the "Defining Constants Through the Compiler" help topic, only numeric constants can be created there. Depending on your project type and the type of automation you have in mind, could you "automatically" add your #define's in a header file, and #include that in your script?
0 Kudos
DemonPiggies
Level 7

... I completely missed that. Thanks!

I am completely in the InstallScript realm. And honestly I do not want to create a script that parses a particular file to switch versions.

Would I be able to make use of a public property value from command line? I assume from this post I can. Really the only reason I was using the Build tab is for debugging.
0 Kudos
RobertDickau
Flexera Alumni

DP,

Hmm, just curious, since your automation would have to edit the contents of that tab anyway, so thought it might be able to write the value to a text file instead.

If it's pure InstallScript, and passing arguments to setup.exe is an option, you can use the /z switch on the outside, and CMDLINE on the inside.

If it's an option to use InstallShield's Automation interface before a build, you might be able to use the ProductVersion property of ISWiProject, or otherwise use ISWiStringEntry to set a string-table entry that the script can read with @SOMETHING_SOMETHING.

Robert
0 Kudos