ptz
31st January 2012 15:38 UTC
Conditionally extract files
I want to have a single large installer file from which I will only extract parts, depending on the user's choice. How can I achieve this? I only know the "File" command for adding files to the installer, but it seems to have a dual action - it also extracts everything that's been added.
Thanks.
Afrow UK
31st January 2012 16:47 UTC
You cannot conditionally extract files if you are using /r (this is what I assume you have done). You need individual File instructions and conditionally execute them using LogicLib.
Stu
ptz
31st January 2012 17:09 UTC
Let me rephrase. Suppose I have 2 files that I need to include (this happens at compile time) in my installer so that one of them is extracted (this happens at runtime) depending on user's choice. In order to have both files in my installer file I need to have
File file1
File file2
But this, to the best of my knowledge, will not only add (at compile time) file1 and file2 to the installer, but will also extract (at runtime) both of them without asking. I need to separate the compile-time and runtime events.
Afrow UK
31st January 2012 18:03 UTC
${If} [user wants file 1]
File file1
${EndIf}
${If} [user wants file 2]
File file2
${EndIf}
The compiler will still bundle both files in the package, but will only extract the file (execute the File instruction) if you do not jump over it. Having multiple Sections and a Components page effectively gives you the same behaviour.
Stu
ptz
1st February 2012 08:52 UTC
Thank you, Stu. I thought I have - but clearly haven't - experiment enough to understand that the compiler will bundle both file1 and file2 with such code.