Skip to content
⌘ NSIS Forum Archive

How determine files to install and NOT install?

13 posts

pospec#

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#
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#
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#
It's realizable with any scripting language. It can be a batch file, python, perl, ruby or even NSIS itself.
pospec#
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#
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#
So you advice me to extract ALL files from installer and leave on target system only that files, that fit into the condition?
pospec#
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.