Problems with Windows 7 UAC


I am using version 4.5.2 of HTML Executable to build splash screens for installations CDs

On a Windows 7 machine, the link that I use to launch the installation does not seem to work when I run the HTML Executable file in non Administrative Mode

The link that I am using inside the html looks as follows:

The following happens:

Double click on HTML Executable file, try to click link that launches Installshield executable, nothing happens
Right Click on HTML Executable file, run as administrator, try to click link that launches Installshield executable, installation executable starts.

The Installshield executable is a setup.exe file that is signed by our company. Inside of HTML exe, the file is listed as external. at the following path: %PATH%\DataServer

This all worked in previous version of HTML Executable. It seems as it is localized to just this version (I have previous HTML Executable files that work just fine.)

If I turn off UAC on the Windows 7 machine, things work fine. I just can’t make our customers do this.

Please help.

The problem is that the HTML exe is not already elevated so the _heopenit will fail: the latter can launch an application but for some reason, Windows does not allow it if the application has higher privilege requirement. A solution would be using the ShellExecute API with “runas” parameter. Please contact our support team.

I’ve just re-emailed support with my request.

Couple more questions:

This only seems to be happening for the most recent version of the HTML Executable. Can you tell me when this changed?

Can you post a script that will launch an executable as an administrator?

In previous versions of HTML exe, the UAC prompt would show up when I tried to launch the executable that had Administrator rights. In this version, the UAC prompt does not show, and the executable tries to start, but then is killed.

We are working on a script, or we’ll add a new built-in feature to the next release of HTMLEXE.

I have tried the following with no luck:

procedure openFileAsAdmin(filename: String);
**OpenFileAdv(filename, “/trustlevel:0x40000” , “runas”, SW_SHOWNORMAL);

if I change the text to:

**OpenFileAdv(filename, “” , “open”, SW_SHOWNORMAL); **

I get the same problem with the UAC prompt. I have to choose “Run As Administrator” when I run the executable to run the program because htmlexe is blocking the UAC prompt.

I’m not sure that runas will even fix the issue: Even as an administrator on the machine I am testing this on, the UAC prompt will show
when a program needs to be elevated to run. My understanding of “Run As Administrator” on windows is that it is a Windows Elevation (like the Windows Power tools), not like using “runas” as a different user.

Even though I am an administrator on the machine, the htmlexe executable malfunctions unless I choose “Run As Administrator”

Something in the changeover from 3.6.5 to 4.0 is causing this error. If I compile with the 3.6.5 version, it works, 4.0 and above it does not. I’d be happy to stay with 3.6.5, but the compiled executables crash in windows 2008.

It would be best if the 4.0 version would just prompt for UAC like the previous versions.

runas lets you run EXE files that require to be elevated. If you don’t use “runas”, the EXE will not launch at all. Runas lets you display the UAC prompt.
BTW filename should contain a full path, or you are passing only “setup.exe”. Modify the code to include the full path to your EXE.

 EbookPath := GetGlobalVar("HEPublicationPath", "");
 MyFile := IncludeTrailingPathDelimiter(EbookPath) + FilePath;

Here is the syntax that seems to work:


procedure openFileAsAdmin(filename: String);
EbookPath: String;
MyFile: String;

EbookPath := GetGlobalVar(“HEPublicationPath”, “”);
MyFile := IncludeTrailingPathDelimiter(EbookPath) + filename;
// Messagebox to show correct path
MessageBox(MyFile,MyFile, MB_OK);

OpenFileAdv(MyFile, “” , “runas”, SW_SHOWNORMAL);

gives me to get a UAC prompt now, and then the executable seems to run.

OpenFileAdv was probably not finding your EXE file, that’s why it wasn’t working.
Great that it works for you now.