0
我正在使用install4j 6.0.4,我需要更新一個WAR文件的內容。關於到this answer,我配置了以下措施爲「安裝」屏幕的一部分:install4j 6.0.4 - 無法創建ZIP文件
- ExtractZipFileAction - 正常工作,正確地解壓縮
- ModifyTextFileAction - 正常工作,文件內容被改變
- CreateZipFileAction - 無創建新的WAR文件和下一個動作失敗
但所有三個動作都標在日誌文件中成功:
[INFO] com.install4j.runtime.beans.actions.files.ExtractZipFileAction [ID 13956]: Execute action
Property mode: 666
Property dirMode: 777
Property zipFile: myApplication.war
Property showProgress: false
Property fileFilter: null
Property destinationDirectory: temp_war
Property rollbackSupported: true
Execute action successful after 30363 ms
[INFO] com.install4j.runtime.beans.actions.text.ModifyTextFileAction [ID 12713]: Execute action
Property searchValue: mySomething1
Property logReplacement: true
Property replaceValue: mySomething2
Property encoding: null
Property escapeForPropertyFile: false
Property failIfNoReplacement: true
Property files: [temp_war\myFile.txt]
Property rollbackSupported: true
Backing up C:\Program Files\MyApplication\temp_war\myFile.txt
Execute action successful after 16 ms
[INFO] com.install4j.runtime.beans.actions.files.CreateZipFileAction [ID 13957]: Execute action
Property zipFile: myApplication-new.war
Property recursive: true
Property addTopLevelDirectoriesToRelativePath: true
Property showFileNames: true
Property showProgress: true
Property files: [temp_war, myAnotherFile.txt]
Property fileFilter: null
Property directoryFilter: null
Property rollbackSupported: true
Execute action successful after 16721 ms
[INFO] com.install4j.runtime.beans.screens.InstallationScreen [ID 8]: Rollback barrier reached
command: move 1 screens, executing actions, checking condition
[INFO] com.install4j.runtime.beans.actions.files.MoveFileAction [ID 5318]: Execute action
Property shared: false
Property destinationFile: myDestinationFolder
Property mode: 644
Property uninstallMode: Always
Property overwriteMode: Always
Property directoryMode: 755
Property triggerReboot: false
Property recursive: true
Property delay: false
Property showProgress: true
Property showFileNames: false
Property directoryFilter: null
Property files: [myApplication-new.war]
Property fileFilter: null
Property rollbackSupported: true
The file "C:\Program Files\MyApplication\myApplication-new.war" does not exist
[ERROR] com.install4j.runtime.beans.actions.files.MoveFileAction [ID 5318]: Execute action not successful after 0 ms
此外,我無法更新現有的WAR文件。我在CreateZipFileAction屬性'zipFile'中指定了它,這個動作又被標記爲成功,但是WAR文件沒有被更新。
是的,我同意你「修改ZIP文件」將簡化它。但我更喜歡6.0.4版的一些解決方案/解決方法。特別是當我們只有這個版本的許可證。 –
6.0的許可證密鑰也適用於6.1。 –
基於[版本6.1包含很多更改](https://www.ej-technologies.com/download/install4j/changelog.html#6.1)以及當前版本6.0.4對我們來說似乎很穩定的事實,我們做了一個解決方法一個實現的靜態Java功能壓縮適當的文件到ZIP存檔。無論如何,謝謝Ingo的幫助! –