I have a tree structure that I'm building the installer from containing files specifically for windows (in dirs names win64) or specifically for linux (in dirs named lnx_x23.64), e.g. I have:

plugins/win64/, plugins/lnx_x23.64, exe/win64, exe/lnx_x23.64, etc

I'd like to have 2 components, 1 for Linux and 1 for windows. The Linux one would exclude any directory (and its sub-directories) that are called win64, the windows one would exclude any directory (and its sub-directories) that are called lnx_x23.64. Everything else in the tree is shared. I cannot see a simple way to do this, the filters defy all logic. Is it possible, and if so how, please ?

asked 22 May '12, 12:30

hulahoopian's gravatar image

hulahoopian
356710
accept rate: 0%


You can simply specify pattern of /win64/ with <allowWildcards> set to 1 and contents of for example */win64 it will be installed in destination folder.

For example:

<component>
  <!-- ... -->
  <folderList>
    <folder>
      <description>Linux</description>
      <destination>${installdir}</destination>
      <name>linux</name>
      <platforms>linux</platforms>
      <distributionFileList>
        <distributionFile allowWildcards="1">
          <origin>/path/to/*/lnx_x23.64/*</origin>
        </distributionFile>
      </distributionFileList>
    </folder>
    <folder>
      <description>Windows</description>
      <destination>${installdir}</destination>
      <name>windows</name>
      <platforms>windows</platforms>
      <distributionFileList>
        <distributionFile allowWildcards="1">
          <origin>/path/to/*/win64/*</origin>
        </distributionFile>
      </distributionFileList>
    </folder>
  </folderList>
</component>

Based on feedback from the comment, the best solution is to use advanced filters and simply exclude all files and directories matching pattern - such as:

<folder>
  <description>Windows</description>
  <destination>${installdir}</destination>
  <name>windows</name>
  <platforms>windows</platforms>
  <distributionFileList>
    <distributionFile allowWildcards="1">
      <origin>/path/to/*/win64/*</origin>
      <onPackingFilterList>
        <fileNameFilter logic="does_not_match" pattern="*/lnx_x23.6/*"/>
      </onPackingFilterList>
    </distributionFile>
  </distributionFileList>
</folder>

The filters are described in Advanced Filters section of InstallBuilder User Guide.

link

answered 23 May '12, 04:34

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Thanks for the suggestion, but that simply dumps the entire contents of every directory called win64 into the same directory, which is not what I want. I need to retain the directory structure but specifically exclude directories with a certain name.

I have

version/config
version/docs
version/examples
version/exe/win64/...
version/exe/lnx_x23.64/...
version/extensions/win64
version/extensions/lnx_x23.64
version/help
version/languages
version/plugins/win64
version/plugins/lnx_x23.64

So rather than specifically include all the files/folders that I want, I need to specifically exclude the folders that I don't want. Hence for a windows target I'll be left with:

version/config
version/docs
version/examples
version/exe/win64/...
version/extensions/win64
version/help
version/languages
version/plugins/win64
(23 May '12, 10:19) hulahoopian

The answer based on your feedback has been added to the original answer I have made.

(23 May '12, 10:33) wojciechka ♦♦

Thanks! That did the trick.

(24 May '12, 07:09) hulahoopian
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2

Asked: 22 May '12, 12:30

Seen: 1,128 times

Last updated: 24 May '12, 07:09