Talk:Java Launcher with automatic JRE installation

From NSIS Wiki
Jump to navigationJump to search

I think that this solution has a security hole in it - the Java app will get launched with elevated permissions if the JRE had to be downloaded.

I believe that you want to use:

 UAC::Exec  '$0'  

to launch the application with regular user permissions, if the JRE had to be installed. I don't know what will happen if you attempt to use UAC:Exec if you haven't elevated already (you might have to have a check to determine whether you launch UAC::Exec or just regular Exec)

Finally, you should be calling UAC:Unload in your .OnInstFailed and .OnInstSuccess functions, as follows:

 Function .OnInstFailed
   UAC::Unload ;Must call unload!
 FunctionEnd
 Function .OnInstSuccess
   UAC::Unload ;Must call unload!
 FunctionEnd

Trumpetinc 22:59, 21 August 2009 (UTC)

I don't understand

Is this an installer for a Java program or an exe launcher for a Java program?

Answer: It's an installer program, it can be used with any language.

UAC Problem

This does not work with most current UAC.


FunctionEnd Function: "ElevateToAdmin" Invalid command: UAC::RunElevated Error in script "C:\Users\Michael\Desktop\DSUIAmHereApp.nsi" on line 146 -- aborting creation process