0

I'm currently working on a project where I have to build a desktop application using JavaFX. I'm using the javafx-gradle-plugin (https://github.com/FibreFoX/javafx-gradle-plugin) for building and bundling the application.

Everything works fine, but after the installation the application doesn't request administrator privileges to run. If I start it with admin user everything works, but if you start it as a "normal" user the application doesn't work.

Is there a way for requesting admin privileges when starting the .exe?

thank you in advance for your help

babadaba
  • 814
  • 5
  • 20
  • 1
    Just one side-note: its not the [javafx-gradle](https://bitbucket.org/shemnon/javafx-gradle/) plugin ;) that one was from Danno Ferrin ... and it's outdated/dead – FibreFoX Dec 07 '16 at 15:17

1 Answers1

0

I found the solution to my problem.

I added an entry in my .iss file for generating the InnoSetup installer like this:

[Registry]
Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\"; ValueType: String; ValueName: "{app}\xxx.exe"; ValueData: "RUNASADMIN"; Flags: uninsdeletekeyifempty uninsdeletevalue; MinVersion: 0,6.1

Be aware that when you add this entry you have to add runascurrentuser to your Run configuration like this:

[Run]
Filename: "{app}\xxx.exe"; Parameters: "-Xappcds:generatecache"; Check: returnFalse()
Filename: "{app}\xxx.exe"; Description: "{cm:LaunchProgram,xxx}"; Flags: runascurrentuser nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\xxx.exe"; Parameters: "-install -svcName ""xxx"" -svcDesc ""xxx"" -mainExe ""xxx.exe""  "; Check: returnFalse()
babadaba
  • 814
  • 5
  • 20