Media File Wizard: Data Files

## Media File Wizard: Data Files |

| In this step of the media file wizard you define where the installer data should be placed.

| Typically, installers are single files that contain all data that they install on the user's request. There are three common use cases where this is not the case: CD/DVD installers with large data files If your application relies on large amounts of data, it is often distributed on a CD or DVD. In that case, you typically ship a number of external data files that you do not wish to package inside the installer. The installer should start up quickly and the data files should not be extracted from the installer in order to save time. The user might decide to install only certain components, so some data files might not be needed at all. If they are included in the installer executable, all this data would have to be read from disk. Installers with large optional components Some applications have large optional components that are not relevant for the typical user. To reduce download size for the majority, the optional component should be downloadable on demand. Net installers Some application are highly modular, so it is not feasible to build a set of installers for typical use cases. A net installer lets the user select the desired components and downloads them on demand. The download size of the net installer is small since no parts of the application are contained in the installer itself.

| To accommodate the above use cases, install4j offers three different ways to handle the installer data files: Included in media file All data files are included in the installer so you can ship it as a single download. External This mode covers the "CD/DVD installers with large data files" use case. All data files are placed in a directory next to your installer that has the name of your installer with the extension .dat. For example, if your media file name is `hello_4_0` (resulting in a Windows installer executable `hello_4_0.exe`), the directory containing the external data files is named `hello_4_0.dat`. You have to ship this directory in the same relative location on your CD or DVD. The number of data files depends the definition of your installation components. The data files are generated in such a way that the files for an installation component are contained in one or more data files there are no files in those data files that do not belong to this installation component If components do not overlap, there's a one-to-one correspondence between data files and installation components. Downloadable This mode covers the "Installers with large optional components" and "Net installers" use cases. It can only be used if you define installation components. Data files are generated just like for the "External" mode, but only for installation components that have been marked as downloadable in the installation component definition. If no installation components are marked as "downloadable", this mode will behave like the "Included in media file" mode. For a "net installer", all installation components are "downloadable". For this mode, you have to enter a HTTP download URL, so the installer knows from where it should download the data files at runtime if the user requests downloadable components. The URL must begin with http:// and point to a directory where you place the data files. For example, if the data file `hello_windows_4_0.000` is downloadable and the download URL is `http://www.test.com/components`, the data file must be uploaded to the web server, so that the installer can download the data file from the URL `http://www.test.com/components/hello_windows_4_0.000`. Any data files that you leave in the data file directory next to the installer will not be downloaded. This means that if you test your installer directory from the location where it was generated, the installer finds all data files in the data file directory and does not try to download them.