PDA

View Full Version : Changing [PRODUCTVER] and [EXENAME]



Larry Teames
06-01-2007, 10:46 AM
The help for compiler variables [PRODUCTVER] and [EXENAME] indicates they are read/write, and indeed I can change them and display the changes in a message dialog, but those changes have no effect on the EXENAME used to generate the install exe.

Is there a way to "create" the output exe name at build time using code in the script? IOW, I want to create a different exe name whenever I change the version (e.g. 6.01.01 becomes fw60101.exe), rather than having to go into the Project Definitions and change the 2 compiler vars.

Is this possible?

linder
06-01-2007, 10:58 AM
Larry,

Yes, that should work fine.

To "manipulate" [PRODUCTVER], you can do the following in the script:

#const $MYVER$ = "2.00"
#set compiler variable [PRODUCTVER] = "$MYVER$"

To manipulate [EXENAME], do the following:

1. Create a new compiler variable, say, [MYEXE] in the Compiler Variables Visualizer
2. General Information -> Product Properties -> Executable Name [EXENAME] -> Set [EXENAME] to [MYEXE]

Then you can use again:

#const $MYEXE$ = "Larry.exe"
#set compiler variable [MYEXE] = "$MYEXE$"

Does this help?

BTW, I have tested the above with the latest SetupBuilder 6.5. I don't know if the same works with a previous version.

Friedrich

Larry Teames
06-01-2007, 12:06 PM
Friedrich,

I'm almost there with your help. I am using 6.5.1876. What I need (want) to do is specify a dot delimited version (6.02.03) and develop the exe name by removing the dots and sandwiching the result between other constants. IOW, I want to start with "6.02.03" and end with "fw60203.exe". Then set [MYEXENAME] to that value.

My problem is two-fold:
(1) I don't see a way to replace the dots in a constant or compiler var
(2) If I try to work backwards (starting without dots) I am unsuccessfull in concatenating multiple constants into a single constant:
#const $MAJ$ = "6"
#const $INT$ = "02"
#const $MIN$ = "03"
#const $MYVER$ = $MAJ$.$INT$.$MIN$
The above issues an error saying $MAJ$.$INT$.$MIN$ is not defined.

I can make it work if I define 2 constants ("6.02.03" and "60203"), but I am hoping there is a way where I only need to specify either, and not both.

Is this possible?

linder
06-02-2007, 10:35 AM
Larry,

I have to give this some thoughts...

Friedrich

Larry Teames
06-03-2007, 03:40 PM
Friedrich:

Thanks. I'll await you next response.