2016-04-06 73 views
0

我正在使用install4j 6.0.4,我需要更新一个WAR文件的内容。关于到this answer,我配置了以下措施为“安装”屏幕的一部分:install4j 6.0.4 - 无法创建ZIP文件

  1. ExtractZipFileAction - 正常工作,正确地解压缩
  2. ModifyTextFileAction - 正常工作,文件内容被改变
  3. 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文件没有被更新。

回答

1

我建议更新到install4j 6.1,它有一个“修改ZIP文件”操作,这使得这更容易。

+0

是的,我同意你“修改ZIP文件”将简化它。但我更喜欢6.0.4版的一些解决方案/解决方法。特别是当我们只有这个版本的许可证。 –

+1

6.0的许可证密钥也适用于6.1。 –

+0

基于[版本6.1包含很多更改](https://www.ej-technologies.com/download/install4j/changelog.html#6.1)以及当前版本6.0.4对我们来说似乎很稳定的事实,我们做了一个解决方法一个实现的静态Java功能压缩适当的文件到ZIP存档。无论如何,谢谢Ingo的帮助! –