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

2019-05-23 14:24发布

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?

2条回答
劳资没心,怎么记你
2楼-- · 2019-05-23 14:52
太酷不给撩
3楼-- · 2019-05-23 14:54

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.

查看更多
登录 后发表回答