Creating an installer for Java desktop application

后端 未结 6 555
栀梦
栀梦 2020-12-12 16:31

I know this question has been asked many a times and all the time there is an answer which says about using an executable jar or making an .exe using launch4j or similar app

6条回答
  •  眼角桃花
    2020-12-12 17:17

    Edit: I'll leave this here for reference, but note: The Java plug-in needed to launch JWS and applets was removed by browser manufacturers, and both were deprecated in Java 9 and removed from the API.

    Use Java Web Start.

    Like, pressing Next for 2 - 3 times (which shows all the terms and conditions etc)

    The ExtensionInstallerService of the JNLP API provides this. Here is a demo. of the installer service.

    ..then a user specify a location(like C:\Program Files\New Folder\My App), ..

    The ExtensionInstallerService provides a method getInstallPath() which..

    Returns the directory where the installer is recommended to install the extension in. It is not required that the installer install in this directory, this is merely a suggested path.

    That is not quite the same as what you are asking, but then I think it is generally a bad idea to allow the user that level of control.

    then my .exe, lib folder, img folder, other important folders get pasted in the destination folder along with the .exe file ..

    JWS installs the resources mentioned in the JNLP automatically, as and when they are needed. Further, it updates the resources if the archives on the server change.

    and then a shortcut is created on a desktop.

    JWS can supply desktop shortcuts and menu items on supported systems.

    E.G.

    • From How to run Java programs by clicking on their icon on Windows?
    • This answer, which shows a JWS app. installed in 'Programs and Features', with the desktop icon to the left of it.

提交回复
热议问题