0
votes

I have 4 nsis components, they have several shared files and each of them has a different folder.

How can I include shared files and copy them on the selected components folder? normally if I include the shared files with the File in a section then I will have repetitive files in the installer and the installer will be so heavy.

What can i do for this problem?

1

1 Answers

0
votes

As far as I understand it, the SetDatablockOptimize instruction will optimize the installer and not include duplicate files.

This command tells the compiler whether or not to do datablock optimizations. Datablock optimizations have the compiler check to see if any data being added to the data block is already in the data block, and if so, it is simply referenced as opposed to added (can save a little bit of size). It is highly recommended to leave this option on.

Apart from that, you could always use functions that extract the files and change the output path before calling those functions.

Section
  SetOutPath "first_path"
  Call ExtractBaseFiles

  SetOutPath "second_path"
  Call ExtractBaseFiles
SectionEnd

Function ExtractBaseFiles
  File "first_file"
  File "second_file"
FunctionEnd