2016-01-21 63 views

回答

1

使用具有創新安裝外部抽取實用程序的通用方法:

  • 創建存檔
  • 嵌入歸檔到安裝
  • 嵌入工具,可以提取歸檔到安裝
  • 使安裝程序將存檔和工具提取到目標機器上的臨時位置 - {tmp}
  • 使安裝程序運行該工具以提取歸檔

[Files] 
Source: "UnRAR.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall 
Source: "Data.rar"; DestDir: "{tmp}"; Flags: deleteafterinstall nocompression 

[Run] 
Filename: "{tmp}\UnRAR.exe"; Parameters: "x ""{tmp}\Data.rar"" ""{app}""" 

如果你想呈現減壓的進步,你將不得不解析的UnRAR輸出。對於一個例子(ARC)見How to add .arc decompression to Inno Setup?

或者使用UnRAR.dll,類似於unarc.dll用於在Inno Setup - How to add cancel button to decompressing page?


注意,UnRAR.exe工具是免費的,可以用於這些目的。從其license.txt的提取物:

  • 所述的UnRAR工具也可被自由地分發。允許 在其他軟件包內分發UnRAR。
  • +0

    請注意,如果提取工具未獲準進行此類使用,此操作可能會將您置於沸水中。我知道這與問題沒有直接關係,但肯定值得一提。 – user2366842

    +1

    @ user2366842我在回答中解決了這個問題。 –

    +0

    我不想將檔案嵌入到安裝程序中。我想單獨保留它,例如{src} –

    相關問題