我们使用的是install4j v8.0.11.正常安装可以正常运行,正常卸载也可以正常运行,方法是按照预期删除C:\Program Files (x86)\App\lib中的所有文件.

但是,当应用程序已经安装并且我们运行较新版本的安装并 Select 更新现有安装时,一些Java依赖项(组成CLASSPATHlib文件夹中的文件)在卸载阶段不会被删除.这会导致CLASSPATH上有多个具有相同依赖关系的文件,这可能会导致Java使用错误(较旧)的类版本.

是什么原因导致lib中的某些文件未被删除?(大多数文件已被删除)

我们都试了些什么?

作为安装阶段和卸载阶段的一部分,我们已经准备好停止正在运行的应用程序和正在运行的服务的操作.

enter image description here

Execute previous uninstallerUninstall files操作的failure strategy被配置为Ask user whether to retry or quit on failure,但我们没有得到任何提示.

安装日志(log)

[INFO] com.install4j.runtime.beans.actions.InstallFilesAction [ID 9]: Execute action
       Property directoryResolverScript: null
       Property fileFilterScript: null
       Property sizeCalculatorScript: null
       Property acceptAllCertificates: false
       Property checkFreeSpace: true
       Property delay: false
       Property installRuntime: true
       Property rollbackSupported: true
       Property saveDownloadedFiles: false
       Property showFileNames: true
       Property triggerReboot: true
       Property updateBundledJre: true
       Property validateApplicationId: false
...
       Install file: C:\Program Files (x86)\App\lib\delight-nashorn-sandbox-0.1.14.jar; size: 75435 bytes; exists: false
       Install file: C:\Program Files (x86)\App\lib\application-1.0.0.25194.jar; size: 1264714 bytes; exists: false
       Install file: C:\Program Files (x86)\App\lib\commons-1.0.0.25194.jar; size: 995 bytes; exists: false
       Install file: C:\Program Files (x86)\App\lib\error_prone_annotations-2.0.18.jar; size: 3632 bytes; exists: false
       Install file: C:\Program Files (x86)\App\lib\flyway-core-6.5.7.jar; size: 293620 bytes; exists: false
...
       Execute action successful after 41010 ms

更新安装日志(log)

[INFO] com.install4j.runtime.beans.screens.WelcomeScreen [ID 2]: Show screen
[INFO] checking writable with maximum
[INFO] Variable changed: sys.confirmedUpdateInstallation=true[class java.lang.Boolean]
...
[INFO] com.install4j.runtime.beans.actions.InstallFilesAction [ID 9]: Execute action
       Property directoryResolverScript: null
       Property fileFilterScript: null
       Property sizeCalculatorScript: null
       Property acceptAllCertificates: false
       Property checkFreeSpace: true
       Property delay: false
       Property installRuntime: true
       Property rollbackSupported: true
       Property saveDownloadedFiles: false
       Property showFileNames: true
       Property triggerReboot: true
       Property updateBundledJre: true
       Property validateApplicationId: false
...
       Install file: C:\Program Files (x86)\App\lib\delight-nashorn-sandbox-0.1.14.jar; size: 75435 bytes; exists: true
       File times: 1669725278000, 1669618416000
       Install file: C:\Program Files (x86)\App\lib\application-1.0.0.25203.jar; size: 1266730 bytes; exists: false
       Install file: C:\Program Files (x86)\App\lib\commons-1.0.0.25203.jar; size: 995 bytes; exists: false
       Install file: C:\Program Files (x86)\App\lib\error_prone_annotations-2.0.18.jar; size: 3632 bytes; exists: true
       File times: 1669725278000, 1669618416000
       Install file: C:\Program Files (x86)\App\lib\flyway-core-6.5.7.jar; size: 293620 bytes; exists: true
       File times: 1669725278000, 1669618416000
...
       Execute action successful after 48259 ms

更新安装会复制applicationcommons JAR的新版本,但不会删除以前的/旧版本.此外,查看更新安装的日志(log)文件,我没有看到运行以前的卸载程序或卸载任何文件的任何操作.

我们还能期待什么?

我们希望从lib文件夹when updating an existing installation中删除所有文件,就像它们在正常卸载时被删除一样.

推荐答案

我们希望在更新现有文件时从lib文件夹删除所有文件 安装

只有在"安装"屏幕中添加了"执行以前的卸载程序"操作时,才会出现这种情况.

由该操作执行的卸载程序将其日志(log)文件保存到该文件

<installation directory>/.install4j/uninstallPrevious.log

Java相关问答推荐

SQlite for Android无法使用json_group_array/json_object

为什么不应用类型推断?

如何从Keyloak映射Hibernate实体中的用户

使用多个RemoteDatabase对象的一个线程

Java连接池无法正常工作

使用用户引入的参数生成人员数组

Cordova Android Gradle内部版本组件不兼容

如何创建模块信息类文件并将其添加到JAR中?

如何在EL处理器中定义带有命名空间的变量?

通过Java列表中的某些字段搜索值

STREAMS减少部分结果的问题

如何使用Hibernate v6.2构建NamingStrategy,以表名作为所有列的前缀?

为什么Instant没有从UTC转换为PostgreSQL的时区?

Android上的SQLite:Android.database.SQLite.SQLiteReadOnlyDatabaseException:try 写入只读数据库(代码1032 SQLite_readonly_DBMOVED)

Spring Boot Security-每个端点都被403禁止,Spring记录一个BasicErrorController#错误(HttpServlet请求)

Cucumber中第二个网页的类对象未初始化

Maven创建带有特定类的Spring Boot jar和普通jar

java 11上出现DateTimeParseException,但java 8上没有

带有提取器的JavaFXObservableList会根据侦听器的存在而改变行为

Hibernate 6 + 类的属性持久化为字符串