How to use a custom .iss file with Inno Setup for NetBeans

会有一股神秘感。 提交于 2019-12-08 00:31:18

问题


I am using Inno Setup 5 with NetBeans 8 and I have been able to create an installer which installs the app in C:\users\username\local\appname.

I however want this installed in C:\Programfiles

How can I achieve this in NetBeans?


回答1:


The problem with the NetBeans packaging mechanism using Inno Setup is that - AFAIK - you can't give your own .iss file to the build mechanism. NetBeans creates an own installation script file with little to no external influence.

The biggest problem that also I have is that the package is installed (at least for Windows) in C:\Users\<user>\AppData\Local. Who on earth is going to look over there in the first place to find back an application??? Don't know why they've taken that decision.

Whenever you click the executable generated by NetBeans, you don't have any control whatsoever over location, shortcuts,... And that's too bad...

You have some limited changes you can do by playing around with the <fx:preferences> tag in the build.xml. There's only a couple of items that can be modified like creating a shortcut, adding to the application menu and using a user-level installer or not.

Since I really wanted to use the Inno Setup approach and I wanted to use my own .iss script, I did the following to overcome this:

  • Allow NetBeans to do its job and create an executable installer
  • Once the installer is created, run the installer and let it install the app in the weirdest of all places on a Windows installation
  • Open Inno Setup Compiler and create your own installation script, using all the files and subdirectories that were created by the original NetBeans generated installation executable.
  • Generate my own installation executable using the above
  • Run the self-created installer: you now have all the options you want since you yourself created the installation executable (option to change installation directory, default installation directory, default installation directory name, use desktop shortcut or not, allow for all users or current user only, ...)

I know this is a workaround and a 2-way process but that was at the time I needed it the only(?) / best(?) way I could find.

In the mean time, I found an alternative way to create an installer executable on this page where you can create your own .iss file and as such, have much more control over what is going to happen.

I didn't try it out myself yet, but I think it has quite some opportunities.




回答2:


The fx:preferences tag lets you do, what you want at least in Java 8:

https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html#BCGIBBCI



来源:https://stackoverflow.com/questions/24954621/how-to-use-a-custom-iss-file-with-inno-setup-for-netbeans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!