我们使用的是install4j v8.0.11.正常安装可以正常运行,正常卸载也可以正常运行,方法是按照预期删除C:\Program Files (x86)\App\lib
中的所有文件.
但是,当应用程序已经安装并且我们运行较新版本的安装并 Select 更新现有安装时,一些Java依赖项(组成CLASSPATH
的lib
文件夹中的文件)在卸载阶段不会被删除.这会导致CLASSPATH
上有多个具有相同依赖关系的文件,这可能会导致Java使用错误(较旧)的类版本.
是什么原因导致lib
中的某些文件未被删除?(大多数文件已被删除)
我们都试了些什么?
作为安装阶段和卸载阶段的一部分,我们已经准备好停止正在运行的应用程序和正在运行的服务的操作.
Execute previous uninstaller和Uninstall 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
更新安装会复制application
和commons
JAR的新版本,但不会删除以前的/旧版本.此外,查看更新安装的日志(log)文件,我没有看到运行以前的卸载程序或卸载任何文件的任何操作.
我们还能期待什么?
我们希望从lib
文件夹when updating an existing installation中删除所有文件,就像它们在正常卸载时被删除一样.