PDA

View Full Version : Using IF/ELSE - should be using compiler directives???



NewsArchive
07-06-2007, 02:42 AM
I have IF/ELSE logic all through my setup, determining if MyExe.EXE from
SetupIn\Basic should be used, or that from SetupIn\Deluxe, etc, including
similar logic for choice of several large dlls and hundreds of megabytes of
large data files. My resulting setup.exe is almost 700MB instead of the
expected 300MB or so.

Here is a short excerp from my installation - what would I need to do to
make this use compiler directives instead?

If %CGT_EDITION% Equals "Deluxe" Then
Install File "CGT_Data\*.TPS" to "%_SB_INSTALLDIR%\*.TPS
Install File "CGT_Documents\*.*" to "%_SB_INSTALLDIR%\*.*
Elsif %CGT_EDITION% Equals "Basic" Then
Install File "CGT_Data\*.TPS" to "%_SB_INSTALLDIR%\*.TPS
Else
Install File "CGT_Data_6Yr\*.TPS" to "%_SB_INSTALLDIR%\*.TPS
Install File "CGT_Documents_6Yr\*.*" to "%_SB_INSTALLDIR%\*.*
End

Regards and thanks
Warren

NewsArchive
07-06-2007, 02:42 AM
Worked it out (I think)

Regards
Warren

NewsArchive
07-06-2007, 02:42 AM
Hi Warren,

You are using Conditional Statements that are executed at installer
run-time.

Compiler Directives are processed at compile-time. Use #ifcompvar, #ifconst
or #ifdef compiler directives to mark the beginning of the block of code
that will only be compiled conditionally. Of course, you cannot use runtime
variables (e.g. %CGT_EDITION%) in this case.

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.5
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner