How to launch .avi files that sit on a DVD - SOLVED

I’ve really tried to find a solution for this, and I’m not getting it.

I am distributing a Teacher’s Guide on DVD.
The HTMLexe file, which will sit at the top level of the DVD will have all the interface files and the various articles.
Linked from one of my HTML pages are several video files in .avi format.

I have tried several ways to do this and I’m not having success.
I need to have the HTMLexe file open the avi files and read them
from the DVD as they are playing. The files are large, and if they were
compiled into the HTMLexe file, would make it huge.

I’m under a tight deadline and I turn to everyone here for help.


I can help you in configuring your project and writing a script to launch your AVI files.
Could you please first post the structure of your DVD:
for instance:

  • avi subfolder
    The most important is to know the path to your AVI files, relative to the EXE file.
    For instance, you place the EXE file in the DVD root. If you have “video1” in the “avi” subfolder, the relative path would be:

Then you have to manually exclude the AVI from your filelist: go to File Manager, select all of your AVI files, click Properties
( and choose “Exclude the selected file”. Press OK to save.

Thus your AVI files won’t be compiled inside the EXE.

Thank you for your help.

At the top level of the work folder, before I compile the .exe
are the following folders:


Also at the same level are the following html pages:

On the final DVD (or CD, depending on how small I can make the video files)
would be the following:

  1. Final_compiled_project.exe
  2. [video_files] folder

Looking forward to your speedy reply

First, open your HEPX project and go to the User Script editor:

Copy/paste this script code:

procedure StartVideo(Filename: String);
EbookPath, MyProgram: String;
// Read the path to the folder that contains our ebook .exe
EbookPath := GetGlobalVar("HEPublicationPath", "");
// Construct the path to the AVI file we want to launch. 
// Video AVI files are located in the [video_files] subfolder.
MyProgram := EbookPath + "video_files\" + Filename + ".avi";                
// Execute the program!
if OpenFile(MyProgram, "",  SW_SHOWNORMAL) < 32 then
  MessageBox("Unable to execute the external file: " + MyProgram, "Ebook Error", MB_OK+MB_ICONERROR);

like this:

Click Save Script.

Now you can use the following hyperlink code in any HTML page to start an AVI located in the subfolder “video_files”:

<a href="hescript://UserMain.StartVideo|01">Show video 1</a>
<br />
<a href="hescript://UserMain.StartVideo|02">Show video 2</a>

After the | character, enter the filename of the AVI file you want to play. Don’t add the .AVI extension, the script adds it for you.

Now the publication can launch external AVI files in the default media player of the end user. And it doesn’t use hardcoded paths since the drive letter can change on different computers…

I realized my file size will be too large with .avi files.
I’ll be using .mp4 files. Wherever you’ve put .avi
can I just change it to mp4?

Also in the code you sent me to insert in the HTML page you have a close tag for the

Show video 1

Show video 2

Where was the open

Wow! It works!
You’re offering a lot of value for the price.
A fantastic program, and I’m grateful for your kind assistance.

One point – this scripting, while intuitive to a programmer,
is impossible for the avarage user. As opposed to a script,
can you make linking to external video files a feature,
so it’s only a few buttons away?

Thank you, thank you, thank you…

Great that it works for you.
I think we’ll add an easier way in a future version, like a simple %url%.

This topic was automatically closed after 24 hours. New replies are no longer allowed.