- NSIS Discussion
- How determine files to install and NOT install?
Archive: How determine files to install and NOT install?
pospec
29th December 2007 10:11 UTC
How determine files to install and NOT install?
I have trillions of files and every one of them has "rating". I'd like to install only files with rating above some value. The value changes every installation so I need to have that trillions in installation. I have something like "dictionary" that contains filename and its rating. Then I include File *.* into installer but now I stuck.
Do you have any ideas?
kichik
29th December 2007 14:08 UTC
What kind of a dictionary is it? I'd imagine the simplest way would be to write some kind of a script that'd generate your script with or without the files.
pospec
29th December 2007 14:13 UTC
I mean "dictionary" as a form of data type:
file : rating
File1 : 1
File2 : 4
File3 : 5
...
There can be trillions of files and rating can be very smooth - from 0.01 to 1000.00 (for example). User gives ratio limit and installer extracts all files with rating >, <, <= or >= than input. Is this realizable with NSIS?
kichik
29th December 2007 14:17 UTC
It's realizable with any scripting language. It can be a batch file, python, perl, ruby or even NSIS itself.
pospec
29th December 2007 14:19 UTC
Only way how can I do it is 1) extracting ALL files and 2) delete files that doesn't fit into condition.
Aah! Condition! It seems that I need something like CONDITIONAL EXTRACTION. Is it possible with NSIS?
kichik
29th December 2007 14:23 UTC
So the rating is determined at runtime?
pospec
29th December 2007 14:25 UTC
Rating is known on compile time. The RATING LIMIT for extraction is given on runtime.
kichik
29th December 2007 14:29 UTC
Then use one of the methods I've described above to collect a list of all files and create a script that'd check the rating for each of them.
pospec
29th December 2007 14:43 UTC
So you advice me to extract ALL files from installer and leave on target system only that files, that fit into the condition?
kichik
29th December 2007 14:47 UTC
No. Extract only those that are really needed.
pospec
29th December 2007 14:49 UTC
One File instruction for every file? Or File *.*?
kichik
29th December 2007 15:02 UTC
One file per File.
pospec
29th December 2007 15:40 UTC
Sorry for your time kichik. I see that NSIS packs all files defined by File instruction (including File instructions that are in If's or on unreachable lines). I didn't know this.