About External Files

See also File Properties Editor

Large source files such as audio and video files may be kept outside of the publication because Windows handles EXE filesizes up to 4 GB only.

Moreover, HTML Executable allows you to encrypt external files so that they can only be opened/viewed by the publication. Learn more about encrypting external files.

External files must be deployed with the publication .exe file, so this option is especially useful if you plan to distribute your publication on standard media supports like CDs, DVDs…

To set a file as external, select it in the File Manager and click Properties. The “File Properties” window is displayed; turn on “Keep the selected file(s) external”. You are then prompted to enter the future path to the external file.

Accessing external files from the publication

Your application can automatically load external resource files (not compiled into the EXE file): for instance, you can have image and media files outside the EXE file (in the same folder or a subfolder).

Examples:

  • If an HTML file references image1.png, the application will look for the image1.png file into its compiled data; if it is not found, it will try to locate it in the same folder as the EXE file (depending on the URI) and load it.

  • If you have image file in a subfolder, e.g. <img src="myfolder/my image.png" />, the application will expect the my image.png file to be in a subfolder named myfolder (if you leave the file external).

External files have to be deployed with the application’s EXE file, in their respective folders.

Path to the folder where the file will be available

If you do not place external files in their expected folders as explained above, you can tell the publication where each file is located. In this field, you can enter the full path to the external file. Since you can’t always guess the path of the latter on the end user’s computer, HTML Executable provides you with a %PATH% variable. This variable denotes the path to the publication .exe file. Therefore you can now tell the runtime viewer the external file’s relative path.

  • the external file will be in the same folder as the publication .exe file: just enter %PATH%
  • the external file will be in a subfolder (say “MyFolder1”): enter %PATH%\MyFolder1

The %PATH% variable will never include the final path backslash so do not forget to insert it for subfolders: %PATH%\Subfolder is correct while %PATH%Subfolder is wrong. Note that you can also have several subfolders: %PATH%\MyFolder1\MyFolder2\MyFolder3

Example

Take this set of files; [root] is the path to the root folder that contains the publication. It can have any values.

[root]\MYPUB.EXE is the publication .exe file built by HTML Executable. It will require the five following external files:

  • [root]\docs\INFO1.PDF

  • [root]\docs\INFO2.PDF

  • [root]\MAP.PDF

  • [root]\video\codec1\VIDEO1.AVI

  • [root]\video\codec1\VIDEO2.AVI

You could imagine that [root] will be the root of a CD that you will distribute. You cannot guess the letter to the CD drive on the user computer, so you will need to use the %PATH% variable and enter the following values in the full path’s field:

[root]\docs\INFO1.PDF -> %PATH%\docs [root]\docs\INFO2.PDF -> %PATH%\docs
[root]\MAP.PDF -> %PATH%
[root]\video\codec1\VIDEO1.AVI -> %PATH%\video\codec1
[root]\video\codec1\VIDEO2.AVI -> %PATH%\video\codec1

Notes

  • Do not insert filenames in the full path field: %PATH%\docs is correct, %PATH%\docs\INFO1.PDF is wrong.

  • HTML Executable will automatically exclude external files from compilation, but they will remain in the file list.

  • Only media files should be kept external: for instance you should not use this feature for HTML pages.

See also Encrypt External Files.


Copyright G.D.G. Software 2018. All rights reserved