Files - File Options


  On this tab you can set global options that apply to all files and directories that are included by the definition of the distribution tree.
  In the Global excludes section, you can define patterns to exclude files and subdirectories from directory entries in the definition of the distribution tree. If you do not want to distribute file or directories that have certain suffixes, please specify them in the text field as a comma separated list of wildcard entries.

For example, if you want to exclude files from the selected directory that end in .txt and .java, as well as .svn directories, please enter *.txt,*.java,.svn in the text field.

You can add further suffixes to this default for each entry in the definition of the distribution tree

  In the Installation Options section, the following settings are available:
  • Shared file (Windows only)
    Microsoft Windows has a concept of "shared files" where a usage counter is monitored for each file or directory. When the usage counter reaches zero the installer will delete the file or directory. This is especially useful if you install DLLs into the system32 directory that are shared by multiple applications.
  • Overwrite policy
    This setting determines what the installer will do if the file is already present. It does not apply for archives (including RPM archives). The overwrite policy can be one of:
    • Always ask, except for update
      If the file is already present, the installer asks the user whether to overwrite it, regardless of the file modification dates. However, files that have been proviously installed by install4j will be overwritten.
    • Always ask
      If the file is already present, the installer asks the user whether to overwrite it, regardless of the file modification dates and whether install4j has previously installed this file.
    • If newer, otherwise ask
      If the file is already present, the installer silently overwrites the file if the installed file is newer, otherwise is asks the user.
    • If newer
      If the file is already present, the installer silently overwrites the file if the installed file is newer, otherwise it does not install it.
    • Always
      The installer silently overwrites the file in all cases.
    • never
      The installer does not install the file.
  • Uninstallation policy
    This setting determines how the uninstaller decides whether an installed file should be uninstalled or not. The uninstallation policy can be one of:
    • If created
      If the file or directory was created by the installer, it will be deleted.
    • Always
      The file or directory will always be deleted regardless of whether it was created by the installer. Please be careful when choosing this option, since deleting directories that were not created by the installer can have severe unintended consequences.
    • Never
      The file or directory will not be deleted ny the uninstaller.
    • If created, but not for update
      If the file or directory was created by the installer, it will be deleted. However, if the uninstaller is running as part of the update (invoked by an "Uninstall previous installation" action), the file or directory will not be deleted.
    • Always, but not for update
      The file or directory will always be deleted regardless of whether it was created by the installer. However, if the uninstaller is running as part of the update (invoked by an "Uninstall previous installation" action), the file or directory will not be deleted. Please be careful when choosing this option, since deleting directories that were not created by the installer can have severe unintended consequences.
  • Unix file and directory mode
    On Unix-like platforms (including Linux and macOS), the file mode governs the access rights to the installed files. The access mode is composed of three octal numbers (0-7) and each number completely expresses the access rights for a particular group of users:
    • First number
      The first octal number contains the access rights for the owner of the file.
    • Second number
      The first octal number contains the access rights for the user group that the file is attached to.
    • Third number
      The third octal number contains the access rights for all other users.

    For a desired combination of access rights, the octal number is calculated by adding:

    • 1
      For the right to execute the file or to browse the directory. Only set this flag for directories, executables and shell scripts.
    • 2
      For the right to write to the file or directory.
    • 4
      For the right to read from the file or directory.

    For example, read/write rights are calculated as 2 (for writing) + 4 (for reading) = 6, read-only rights are just 4, and the rights to read/execute a file are calculated as 1 (for executing) + 4 (for reading) = 5.

    The default access rights for files are 644, i.e. the owner can read and write the file and all others can only read it. Since usually applications on Unix-like systems are installed by the administrator (usually called root), this means that users will only be able to read files but not to write to them. For launchers, the installer sets access rights for files to 755, which is equivalent to 644 only that everyone can execute the launchers. If you have files that your users should be able to write to, you have to add these files to the distribution tree with a different access mode. For example, 666 would be appropriate in that case. You can reset the default mode with the Reset to default button.

    The default access rights for directories are 755, i.e. the owner can read and write and browse the directory and all others can only read and browse it. Just as for files, this means that except for root, users will only be able to browse directories and read from them but they will not be able to create files in them. If you have directories that your users should be able to create files in, you have to add these directories to the distribution tree with a different access mode. For example, 777 would be appropriate in that case. You can reset the default mode with the Reset to default button.

These defaults can be customized for each entry in the definition of the distribution tree
  In the Modification Times section, you can choose between two ways to set the modification times of installed files:
  • Keep original file modification times
    The original modification times are kept for the installed files. This is the default mode.
  • Use build timestamp
    All installed files have the build time as the same modification time.
  In the Build Options section, you can define the behavior if some files or directories in the definition of the distribution tree are missing while the project is being compiled. install4j can then take one of the following actions:
  • Ignore
    Do not print any warnings and ignore. This setting is suitable if you intentionally add files or directories to your distribution tree that are no present for all builds. If the Enable extra verbose output option is selected on the Build step, the warning is still printed.
  • Print a warning and continue
    This is the default setting.
  • Raise an error and abort
    If missing files are not acceptable in your project, you should choose this option. If a missing file is encountered, the build will fail with a corresponding error message.