简体   繁体   English

Install4j静默升级而不关闭运行的应用程序

[英]Install4j silent upgrade without closing running application

With Install4j I am trying to do a silent upgrade without shutting down the app it is upgrading. 使用Install4j,我试图在不关闭正在升级的应用程序的情况下进行静默升级。 I am receiving the following error "The application is running. Please close all instances and run this installer again. " Is there any way around this. 我收到以下错误“应用程序正在运行。请关闭所有实例并再次运行此安装程序。 ”有什么方法可以解决这个问题。 I am calling the installer from my code with the following code 我使用以下代码从我的代码调用安装程序

String [] args = new String[1];
args[0] = "-q";
ApplicationLauncher.launchApplicationInProcess("6661", args, new ApplicationLauncher.Callback() {
                    @Override
                    public void exited(int i) {
                        logger.info("The installer exited");
                    }

                    @Override
                    public void prepareShutdown() {
                        logger.info("Calling the prepareShutowon fuction");
                    }
                }, ApplicationLauncher.WindowMode.DIALOG, null);

This does not seem to work. 这似乎不起作用。 The upgrade only works if I close the application which I do not want do. 升级仅在我关闭我不想要的应用程序时才有效。

With Install4j I am trying to do a silent upgrade without shutting down the app it is upgrading. 使用Install4j,我试图在不关闭正在升级的应用程序的情况下进行静默升级。

That is not possible, on Windows JAR files and executables cannot be overwritten if they are in use by a running executable. 这是不可能的,在Windows JAR文件和可执行文件中,如果正在运行的可执行文件正在使用它们,则无法覆盖它们。

In the updater, you need a "Shut down calling launcher" action just before the new installer is started. 在更新程序中,您需要在新安装程序启动之前执行“关闭调用启动程序”操作。 You have probably removed that action from the default configuration. 您可能已从默认配置中删除了该操作。 The new installer can then restart the application automatically with an "Execute launcher" action on the "Finish" screen. 然后,新安装程序可以在“完成”屏幕上使用“执行启动程序”操作自动重新启动应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM