PDA

View Full Version : Compile-time version info



timbojones
09-20-2006, 05:15 PM
Our build process puts a version resource in each of our exes and dlls. I don't think it should be necessary to check the sb5 out of and back into source control just to release a new version.

Is there a way to retrieve the version information from one of our files at compile time to populate the [PRODUCTVER] field? Currently I'm doing this by setting [PRODUCTVER] = $VERSION$ and passing our version number in a command line build. This causes problems when compiling inside SetupBuilder's IDE because the constant is not defined.

I tried making $VERSION$ a Standard constant, but then /SC has no effect on its value. It doesn't appear that I can specify a compile-time constant to use a default value, but optionally override from the command line. I know you've said this works for runtime variables.

linder
09-21-2006, 05:32 AM
What about reading a constant at compile time from an INI file and then set the value of the compiler variable to that constant value? We are doing this in all of our own projects.

Does this help?

Thanks,

timbojones
09-22-2006, 01:50 PM
I think that will work fine.

It still would be extremely useful to have compile-time variables with default values that can be overridden on the command line.