PDA

View Full Version : How To Change list of files to install based on release?



CMS Software
01-23-2008, 10:54 AM
Hello,

In the prior versions of our software product we compiled single user, 5 user, 10 user, etc versions of the program. All have the same EXE name but are kept in different folders named SglUsr, Net5Usr, etc. We could set a flag in the old setup builder (INNO Setup 5.2 by Jordan Russell) to tell the setup compiler which executable to include in the batch.

In the new version of our program we are going to do that differently. The main executable (say MyProg.exe) will be the same for any number of users. However, there is going to be an encrypted file named ABCcfg01.dbf that will ship with the main executable. Regardless of the number of users (1,5,10, etc) there will always be a file named ABCcfg01.dbf. The difference is that the contents of ABCcfg01.dbf will be different depending on the number of users allowed. The contents of ABCcfg01.dbf will tell the main exe file whether it should allow one, five, ten or more users at the same time.

We will have folders named SGLuser, Net5Usr, etc and in each of these folders will be a copy of ABCcfg01.dbf containing the correct data values for the version being compiled by SB6. If I compile release SGLUsr, then the program should fetch ABCcfg01.dbf from the SGLusr folder. If I compile release Net5Usr, then SB6 should fetch ABCcfg01.dbf from the Net5Usr folder and so on.

I have tried to set this up using the "Release" feature of SB6, but there does not seem to be any way to pick which files go in the file list based on the release chosen at compile time.

The user does not get to choose how many simultaneous users are allowed, we choose that when we build the installer exe.

Is there a better wasy to do this or am I missing something?

-O. D. Williams-

linder
01-23-2008, 12:20 PM
Hello,

Yes, this is absolutely no problem. We are doing this in most (90%) of all Consulting projects. Are you already using the #ifcompvar [SB_RELEASEID] yadayada functionalty to control which files go into the list?

Friedrich

CMS Software
01-23-2008, 09:58 PM
No, but that would solve the problem. This leads to two more questions.

1. What are the values of SB_RELEASEID? I could not find anything in the docs. Does the first release defined get a value of 1 and the second one defined get 2? Now if Release 1 is deleted, what happens to the value of Release 2 which is now the only release?

2. If each release calls for installing 10 different files, do you use 10 different #IfCompVar statements on each release? Or would it be better to have #IfCompVar set the value of a compiler variable and then use that variable in a "IF...EndIf" statement to put all 10 files under the control of a single IF statement rather than 10 #IfCompVar statements?

O. D. Williams

linder
01-24-2008, 12:24 AM
Hello,

In the Release Properties, you define a "Release Id". At compile time, the [SB_RELEASEID] compiler variable holds the value of the selected Release.

For example, if you have defined three Releases:

1. DownloadTrialWithHelp
2. DownloadTrialWithoutHelp
3. DownloadFull

If you compile the first Release, then [SB_RELEASEID] compiler variable holds the value "DownloadTrialWithHelp"

You can then do something like this:

#ifcompvar [SB_RELEASEID] Equals "DownloadTrialWithHelp" Then
! Install Help File Here
#end

Does this help?

Friedrich

CMS Software
01-24-2008, 10:08 AM
It does indeed help. Thanks for the prompt reply.

I have searched everything in the manual on releases and cannot find anything about the ReleaseID variable and its values. Is this documented?

-O. D.-

linder
01-24-2008, 10:37 AM
Hmm, of course it is *NOT* documented. Your are completely right. It's not in the latest .chm or .pdf documentation :(

The "January 2008 Update" will have it documented.

Thank you for bringing this to our attention :)

Friedrich