BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the community, you simply need to register an account or log into an existing one.

Be sure to check out disposable e-mail services, in case you prefer using one for this site instead of your legit address: http://10minutemail.com/10MinuteMail/

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can see and download all content provided for regular members even without an account!

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup

Join the forum, it's quick and easy

BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the community, you simply need to register an account or log into an existing one.

Be sure to check out disposable e-mail services, in case you prefer using one for this site instead of your legit address: http://10minutemail.com/10MinuteMail/

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can see and download all content provided for regular members even without an account!

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks
Would you like to react to this message? Create an account in a few clicks or log in to continue.
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Search
 
 

Display results as :
 


Rechercher Advanced Search

July 2021
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031 

Calendar Calendar

Country Statistics
Free counters!

You are not connected. Please login or register

Converting Jar Files To Windows Executables

Go down  Message [Page 1 of 1]

Bully@WiiPlaza

Bully@WiiPlaza
 
 
In this tutorial I'll explain how to wrap Java .jar files into .exe files using Launch4j. This allows us to specify a .manifest file which will request administrator privileges for our application to do things like writing to the programs folder and such.

First we need a .jar file program.

Converting Jar Files To Windows Executables Jar_fi10

Next we create a new file with the extension .manifest whose name is identical to the program's name. Right-click the .manifest and open it using an editor like Notepad++. Paste the following code into it:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="highestAvailable"   uiAccess="False" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

The importance here is the 6th line where it requests the highest level of rights for the application.

Converting Jar Files To Windows Executables Manife10

Save the file and close the editor. Your directory should now look like this:

Converting Jar Files To Windows Executables Jar_an10

All preparations have been completed so we can launch Launch4j.

On the basic tab we select the .jar file by clicking on the browse (folder button). For the output file we copy and paste the file path to the jar file but change the .jar extension to .exe instead. Then we also choose our created .manifest file as Wrapper Manifest.

Before we can build the program we have to specify the minimum JRE version. Switch to the JRE tab and type 1.0.0 into the "Min JRE version" field. All the other options are optional.

Tip:
An icon image can be converted to .ico using this site.

Now you can click on the gear in the menu bar to bring up a save dialog for the configuration file. Save it in the same directory as your program. If you wish to edit your options later, the .xml file can be loaded again in Launch4j.

Once you confirmed to save the configuration file, the .exe file gets created in the same directory.

The following texts should appear in the Log field:

Code:
Compiling resources
Linking
Wrapping
Successfully created ...\My program.exe

In our project folder there are now 4 files including the .exe which will always run as administrator. You can tell by the little shield in the bottom right corner.

Converting Jar Files To Windows Executables Execut10

The remaining 3 files are no longer needed and can be deleted. The .exe is a fully standalone program which does the same as the .jar but with full rights.

Enjoy Smile


_________________
Converting Jar Files To Windows Executables YBjg74I

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum