How to add RAR files into installation executable created with Inno Setup without compression?

StackOverflow https://stackoverflow.com/questions/22711607

  •  23-06-2023
  •  | 
  •  

Вопрос

Is it possible to tell the compiler that I don't wan't to compress any compressed file?

I have a folder with subfolders, with a total of +8.000 files which should be expanded to the {app} directory, so to avoid writing +8000 lines in the installer script I'm using a wildcard like this:

Source: {app}\*; DestDir: {app}; Flags: recursesubdirs createallsubdirs ignoreversion

The problem is that inside the folder are also around +1.000 .RAR compressed files, so to speed up installer loading time I would like to store the compressed files instead of compressing them again.

I know the flag nocompression but in my case is obvious that I can't use it properly.

Is there another alternative like a compiler property to tell file extensions that should be stored instead of compressed?

Это было полезно?

Решение

You can have two [Files] section entries. One for all *.rar files and one for all files except *.rar, where one of them will have nocompression flag and the second one won't:

; entry for all *.rar files
Source: "*.rar"; DestDir: "{app}"; Flags: nocompression recursesubdirs createallsubdirs ignoreversion
; entry for all files but *.rar
Source: "*"; Excludes: "*.rar"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs ignoreversion
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top