Java – how to make izpack installer Jar file Exe file
I use izpack to install an installer It's here Jar file I think so Exe file for distribution What should I do? A simple way?
Solution
Andrew always likes to promote Java Web Start Technology from the beginning:) this is a good technology However, you also need to learn the technical parts before you can start patching the technical parts
Otherwise, you will use the old version of the EXE distribution model, as follows:
I'm not familiar with izpack However, there are similar stand - alone tools that can achieve results combined with what izpack can do My favorite exe creation and installation tool is the launch4j innosetup ant task running from the eclipse ide
Launch4j is a Java application launcher Innosetup is an installation creator ant task that helps developers build and integrate steps
How to build an eclipse ide using launch4j innosetup ant: http://www.eteks.com/tips/tipCreationExe.html (French – use Google translation)
When you are considering distributing desktop based windows exe files for Java applications, you also need to consider the target environment This is good when you are targeting Windows XP or earlier However, it will start to be a major setback when you want it to work properly under Windows Vista and windows 7
It is best not to store application configurations, temporary files, etc. that need to be saved to% programfiles% under Windows Vista / Windows 7, because it has now become a read-only folder Use the user's profile folder for this purpose
Of course, you can bypass it by running the application using run as administrator, but with the following settings:
Windows Vista and Windows 7 have introduced a strict user access policy through the User Access Control (UAC) prompt feature. The software installation must be done using a user account under Administrators group. All folders under the default Windows’ system Program Files are set to read-only and it may cause a problem to non-administrator user accounts when trying to save something in it. To run Java app using a non-administrator user account,the application properties must be set to enable Run as administrator. A shortcut shall be created in the Desktop and be set to enable Run as administrator as well.
How to solve the following problems:
(1) Problems with appusermodelid Java support in Windows Vista / Windows 7 requires the following solutions: launch4j, NSIS, and duplicate pinned Windows 7 Taskbar icons
(2) The problem of running as an administrator of a Java application requires the following solution: request admin privileges for Java app on Windows Vista
In addition, you need to check% program files% when running on a 64 bit Windows version The path between 32 - bit windows and 64 - bit windows is different Under 64 bit windows, all 32-bit applications will enter% program files (x86)%
Therefore, be careful when using hard coded file path values in the folders of Java programs and subfolders installed in% program files% It is best to set a Windows environment variable that can be generated by innosetup in the following ISS file fragments Using java system Getenv ("myapp_home") to retrieve variables:
[Registry] Root: HKLM; Subkey: "SYstem\CurrentControlSet\Control\Session Manager\Environment"; Flags: uninsdeletevalue; ValueType: string; ValueName: "MYAPP_HOME"; ValueData: "{app}\" [Tasks] Name: modifypath; Description:"Add application directory to your environmental path"; Flags: unchecked [Run] Filename: "{app}\MyApp.EXE"; Parameters: """{app}""\"; WorkingDir: "{app}\"; Description: "Run MyApp"; Flags: postinstall Nowait skipifsilent [Code] const ModPathName = 'modifypath'; ModPathType = 'system'; function ModPathDir(): TArrayOfString; begin setArrayLength(Result,1) Result[0] := ExpandConstant('{app}'); end; #include "modpath.iss"
Enjoy the experiment!