This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Retrieving string value from Preprocessor Defines
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 02, 2012
02:26 PM
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:
I get compiler errors with this line:
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:
Any ideas?
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?
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 02, 2012
03:52 PM
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?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 02, 2012
04:09 PM
... 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.
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 02, 2012
05:15 PM
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
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
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)