Netbeans JavaFX Application Administrator Deployment

How can I deploy a JavaFX Windows application to an exe containing my jar launcher with administrative privileges? I had this with my old deployment method, but the Netbeans method looks a lot easier and more efficient, so I would really like to use it. This helps eliminate many of the extra steps that I usually have to follow ...

I'm sure this solution is right under my nose, but I just can't figure it out!

Yours faithfully,

Alain

+7
java javafx netbeans
source share
3 answers

The solution I found works very well for me, here is how I do it:

1) Define a custom JDK location in the jfx-impl.xml file of the JavaFX Netbeans project. Tip. Find "plat.setBasedir" and change the parameters to: plat.setBasedir ("path \ to \ jdk \ and \ not \ jre"). This ensures that the JDK is built into your installer.

2) Set up your own deployment for your JavaFX project (as you see fit for your project).

3) Deploy the application as a native exe.

4) Install the local application.

5) Install the Windows SDK 7.1. You need a manifest tool (mt.exe), you will find it somewhere in the / windows sdk / program files ...

6) Create a manifest for administrator rights (examples can be found in stackoverflow or google). Tip. The file name should look something like this when you do it → "Program Name.exe.manifest".

7) Use mt.exe to enter the manifest in the .exe of your application. Tip. Run CMD with administrator privileges and run mt.exe, for example: → mt.exe -manifest "path \ to \ manifest \ Program Name.exe.manifest" -outputresource: "\ path \ to \ exe \ that \ needs \ height" .

8) After entering the manifest in step 7, create your own custom setup using INNO Setup, which repackages the exact structure created using Netbeans native deployment function (it will now include your new enhanced .exe in the new setup).

Main idea:

Netbeans Deployment -> Install Locally -> Elevation Injection Manifest -> Repackage with INNO Creator

0
source share

After submitting the award, I can answer for you: If you know how to use a custom INNO script with the JavaFX package, you can use a custom INNO script and add a registry entry that will make the application run elevated:

[Registry] Root: HKCU; Subkey: "Software\Microsoft\Windows NT\CurrentVersion\Appcompatflags\layers"; ValueType: string; ValueName: "{app}\File Name.exe"; ValueData: "RUNASADMIN"; 

This is NOT perfect (for me, anyway), but the most important thing is that it WORKS.

If you need more clarification, please let me know and I will guide you through it.

+1
source share

Add an application manifest to indicate that the executable should be promoted. See this MSDN blog post . Add a static application manifest (not built-in) to your project as a resource.

0
source share

All Articles