PDA

View Full Version : Compiler variable depending compilation and disk size



Tommyknocker
03-15-2010, 08:29 AM
Hello,

I have a SetupBuilder project that contains some user defined compiler variables to decide which languages should be compiled into the Setup.exe:

_UD_COMPILE_ENGLISH
_UD_COMPILE_FRENCH
...


If one of those compiler variables is set to 1, the Setup.exe will contain the files for that language. By run time the user can select from a list box (filled dynamically due to the compiler variables for the languages).
Depending on the compiler variable I add files to my Setup.exe with the following code. This code handles the setup of the language files during runtime, too:



[Install Files]
! --- Common files ---
Install File "C:\MySetup\Common\*.* to "%_SB_INSTALLDIR%\*.*" (Always Install)

! --- English files ---
! --- check compiler variable to add files to Setup.exe ---
#ifcompvar [_UD_COMPILE_ENGLISH] Equals "1" Then
!--- check user selection during runtime to install the correct language files ---
If %_UD_SELECTED_LANGUAGE% Equals "English" Then
Install File "C:\MySetup\English\*.* to "%_SB_INSTALLDIR%\*.*" (Always Install)
End
#end

! --- French files ---
#ifcompvar [_UD_COMPILE_FRENCH] Equals "1" Then
If %_UD_SELECTED_LANGUAGE% Equals "French" Then
Install File "C:\MySetup\French\*.* to "%_SB_INSTALLDIR%\*.*" (Always Install)
End
#end


That means I only have one Setup.exe, containing all the files for all languages. New languages can be added easily. If some person does not need a language, I can cset the compiler variable for that language to 0 and re-compile the Setup.

Question 1:
Is my approach of creating the compiler variable depending Setup.exe correct?

Problem: When running the install, the required disk size is wrong!
I think the size of all files was accumulated:
Common files' size
+ English files' size
+ French files' size

Question 2:
How can I calculate the correct disk size in this case?

Thank you for your help.

linder
03-15-2010, 10:31 AM
Hello,

Question 1:
From what I see here, it's perfect! You can fine tune it by using the SKU Management Wizard. Similar to this:

http://www.lindersoft.com/forums/showthread.php?p=39593&highlight=sku#post39593

Advanced documentation can be found here:

http://www.lindersoft.com/forums/showthread.php?t=22491

Question 2:

The size of the required disk space is correct because you do not use Features and Setup Types here. You simply include/exclude Install File actions by using "If Statements". In other words, the required disk space is not available at the beginning of the installation. In the "best" case scenario, 0 files are installed, in the "worst" case scenario, all files are installed (depending on the conditional statement).

What you can do is to use a combination of Features and Setup Types. If you are interested, we can develop a demo for you.

Friedrich

Tommyknocker
03-16-2010, 01:32 AM
Hello Friedrich,

thank you for your reply.

It would be great if you can develop a little demo to illustrate the use of Features and Setup Types.
I am thanking you in anticipation.

Best regards

linder
03-16-2010, 03:58 AM
Hello,

We'll post the demo when we have uploaded the new development build.

Friedrich

linder
03-16-2010, 09:09 AM
Hello,

We have uploaded a quick demo:

http://www.lindersoft.com/projects/featuressetuptypedemo.zip

The demo installs (based on the selected Language), an english.txt, an italian.txt or a german.txt file (different file sizes). The Disk Space Requirement always reflects the correct required disk space.

Does this help?

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

SetupBuilder is Windows 7 installation -- "point. click. ship"

Tommyknocker
03-16-2010, 10:31 AM
Hello,

thank you for the demo project.

But when running the compiled setup the calculated disk size is always 0K.
Is there an error in the project?

Best regards

linder
03-16-2010, 10:35 AM
Hello,

Please make sure you are using the latest development build #2903 (see attached screenshot).

Does this help?

Friedrich

Tommyknocker
03-17-2010, 09:28 AM
Hello,

with the development build #2903 it works!
Thank you very much :)

linder
03-17-2010, 09:43 AM
Perfect! Thank you :)

Friedrich