NetBeans和Inno安装程序不会生成正确的Native .exe [英] NetBeans and Inno Setup don't produce a proper Native .exe

查看:227
本文介绍了NetBeans和Inno安装程序不会生成正确的Native .exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Netbeans中创建了一个JavaSE应用程序,并使用Inno Setup 5来生成我认为是完整的Windows安装,包括JRE。按照说明,我已检查Native的NetBeans属性框,并在Path中有Inno Setup 5。 EXE生成并安装得很好PROVIDED目标机器安装了Java。如果没有,则没有与.jre和javac.exe没有文件关联,因此.jar文件将无法运行。

I've created a JavaSE app in Netbeans and am using Inno Setup 5 to generate what I thought was a complete Windows installation, including JRE. As instructed, I have checked the NetBeans property boxbox for Native, and have Inno Setup 5 in the Path. The EXE is generated and installs nicely PROVIDED the target machine has Java installed. If it doesn't, there's no file association with .jre and no javac.exe so the .jar file won't run.

3/4/2017:之后今天大量探索和尝试的东西我现在更全面地了解NetBeans Native包装的实际功能。它创建一个Installer exe,当转移到具有或不具有JRE的目标机器上并在其上执行时,创建实际的myApp.exe并将其放在开始菜单上。我的问题一直认为myApp.jar文件中有JRE,所以我只是想双击myApp.jar。如果我使用myApp.exe它可以工作。

3/4/2017: After lots of poking around and trying things today I now understand more fully what NetBeans Native packaging is really doing. It creates an Installer exe that, when transferred to and executed on a target machine with or without JRE, creates the actual myApp.exe and puts it on the Start menu. My problem has been thinking the myApp.jar file had the JRE in it, so I was just trying to double-click the myApp.jar. If I use the myApp.exe it works.

但是,我现在看到我仍然有问题。 myApp需要许多支持数据文件并从.ini文件中读取。因此,我将不得不创建一个Inno设置来单独完成这些工作,我的用户必须下载并运行两个安装程序,可以这么说。如果做了NetBeans Native安装程序的人使得Inno安装文件可以进行编辑,那就很好了。

However, I now see I still have a problem. myApp requires a number of supporting data files and reading from an .ini file. Consequently, I'm going to have to create an Inno setup to do that stuff separately, and my users will have to download and run TWO installers, so to speak. Had the person who did the NetBeans Native installer thing made the Inno setup file accessible for editing, that would be neat.

Ed

推荐答案

使用Inno Setup的NetBeans打包机制存在的问题是 - AFAIK - 你不能给自己的 .iss 文件到构建机制。 NetBeans创建了一个自己的安装脚本文件,几乎没有外部影响。

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.

我遇到的最大问题是在<$中安装了软件包(至少对于Windows) C $ C> C:\Users\<使用者> \AppData\Local 。首先,谁会在那里寻找一个申请?不知道为什么他们已经做出了这个决定。

The biggest problem I too 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.

每当你点击NetBeans生成的可执行文件时,你就无法对位置,快捷方式进行任何控制。 ..那太糟糕了......

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

为了解决这个问题,我做了以下几点:

To overcome this, I did the following:


  • 允许NetBeans完成其工作并创建可执行安装程序

  • 创建安装程序后,运行安装程序并让它在最奇怪的所有位置安装应用程序Windows安装

  • 使用原始NetBeans生成的安装可执行文件创建的所有文件和子目录,打开Inno Setup Compiler并创建自己的安装脚本。 li>
  • 使用上面的方法生成我自己的安装可执行文件

  • 运行自创建的安装程序:您现在拥有了自己创建安装可执行文件后所需的所有选项(更改安装目录的选项,默认安装d irectory,默认安装目录名称,是否使用桌面快捷方式,仅允许所有用户或当前用户,...)

  • 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知道这是一个变通方法和一个双向过程,但当时我需要的是我能找到的唯一(?)/最佳(?)方式。

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.

与此同时,我找到了另一种在此页面您可以在其中创建自己的 .iss 文件,因此可以更好地控制将要发生的事情。

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.

这篇关于NetBeans和Inno安装程序不会生成正确的Native .exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆