DavidPayne
Posts: 19
Joined: Fri Aug 31, 2007 1:26 pm

Vista UAC - Execution Levels with Java Application

Hi,

I'm a little confused about an effect I'm seeing with the Vista User Account Control, and am hoping that you can help me. I'm creating an installer for a Java application.

When running the installed application on a Vista machine, with the UAC switched on, I get the following, for running straight from the .exe, or calling the main class direct from the jar file (java -cp XYZ MainClass).

Execution Level: As Invoker
Run from .exe: Will not work - no error message is displayed, the splash screen appears for approximately 10 seconds, then disappears.
Run from command line: Works as normal.

Execution Level: Highest Available
Run from .exe: Works, but only after showing me the 'are you sure you want to run this application' message, which is not ideal.
Run from command line: Works correctly.

So - basically, there's something happening in the .exe file, that is causing Vista to complain about permissions. I've been thinking it was in my code, but that's clearly not the case, since the application starts and runs correctly, if I bypass the .exe file.

I did wonder if it was creating the output and error log files, since they go into the APPDIR, but with those switched off, the effect is the same.

Any thoughts gratefully received.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

You are encountering this behavior because your application is not ready for Vista (this is why it cannot manage the "As Invoker" option).

There are similar discussions on the forum, please take a look:
http://www.advancedinstaller.com/forums ... a+manifest
http://www.advancedinstaller.com/forums ... a+manifest

Also, you can read more about this here:
http://www.advancedinstaller.com/user-g ... a-uac.html

Although it is not recommended, you can use a legacy solution that will not use the "trustInfo" field in your application's manifest file, therefore it will run VIRTUALIZED on Windows VISTA: you go to the "Java Products" page and in the "Execution Level" combo you select No Execution Level Information.

Even if this works for now, note that this is a temporary solution. If your application doesn't require administrative privileges then you need to modify your application to support the "As Invoker" option.

However, if your application always requires administrative privileges then you can use the "Require Administrator" option. Note that in this case the user will always be prompted by the UAC when launching the application.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
DavidPayne
Posts: 19
Joined: Fri Aug 31, 2007 1:26 pm

Hi,

Thanks for this Cosmin, and sorry to go over old ground - I did try a search, but couldn't find anything relevant.

I did read the 'Windows Vista User Account Control (UAC)' page, but the impression I got (and still get) from that is that AI inserts the manifest file for me, so I can't see what it is that I'm supposed to be doing.

It's not so urgent, now that I have the workaround of 'No Execution Level Information', although I appreciate that it's temporary, so I am continuing to read around the subject.

Thanks again!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
I did read the 'Windows Vista User Account Control (UAC)' page, but the impression I got (and still get) from that is that AI inserts the manifest file for me, so I can't see what it is that I'm supposed to be doing.
Please note that Advanced Installer adds an application manifest only for the EXE bootstrapper and the Java Launcher created for/by your installation package, not for your application (the manifest is added for the exe setup file to allow it to install prerequisites and the MSI file and for the Java launcher to allow it to run your application).

The problem in your case is that your application doesn't support the "As Invoker" execution level, therefore the manifest embedded in the Java launcher is useless because your application cannot be run. The solution is to modify your application to support the "As Invoker" execution level.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”