innoextract icon indicating copy to clipboard operation
innoextract copied to clipboard

--language option does not work as expected

Open chilikk opened this issue 3 years ago • 1 comments

Consider the following installer: HotA_1.6.1_setup.exe (can be downloaded from here https://www.vault.acidcave.net/download.php?id=614 or any other mirror listed here https://h3hota.com/en/download)

SHA-256 sum of the installer: 79f3330e4d47ef0f065fdbe5ccd07b34eceaafb6f7ebe0bc8b2b4a4d83484c23

The installer contains language-dependent files, as correctly detected by innoextract:

$ innoextract --list-languages --silent HotA_1.6.1_setup.exe
English English
Russian Русский

Trying to use one of these languages with the --language option does not seem to make any difference though

Neither when trying to list language-dependent files

$ innoextract --language=English --language-only --list HotA_1.6.1_setup.exe
Listing "HotA 1.6.1 + HD 5.0 RC76" - setup data version 5.6.0 (unicode)
Done.
$ innoextract --language=Russian --language-only --list HotA_1.6.1_setup.exe
Listing "HotA 1.6.1 + HD 5.0 RC76" - setup data version 5.6.0 (unicode)
Done.

Nor when actually trying to extract

$ mkdir english russian
$ innoextract --language=English --output-dir english --extract HotA_1.6.1_setup.exe
$ innoextract --language=Russian --output-dir russian --extract HotA_1.6.1_setup.exe
$ diff -r english russian
  ## no diff

The installer does however contain language-specific files, which is correctly handled by --collisions=rename-all option

$ mkdir all_lang
$ innoextract --collisions=rename-all --output-dir all_lang --extract HotA_1.6.1_setup.exe
$ diff -r all_lang english
Only in english/app/Data: HotA_l_ext.lod
Only in all_lang/app/Data: HotA_l_ext.lod#Lang\Eng
Only in all_lang/app/Data: HotA_l_ext.lod#Lang\Rus
... more differences with Lang-suffix

I have tried both the latest version available in Arch linux repository

$ innoextract --version
innoextract 1.9
Extracts installers created by Inno Setup 1.2.10 to 6.0.5

As well as compiled from the latest 660546ad796bb7619ff0e99a6cd61c4e01e4e241 commit on github

./innoextract --version
innoextract 1.10-dev + 660546a
Extracts installers created by Inno Setup 1.2.10 to 6.1.2

Unfortunately I do not know how the installer in question has been created or whether it is a general or a specific problem, but it feels that the innoextract is already able to differentiate between the files when using the --collisions=rename-all options, so there should be a possible solution for the --language option. I might also be doing something wrong, in which case I would be happy to get some pointers!

chilikk avatar Jan 08 '21 00:01 chilikk

In your installer the files are not conditional based on the setup language but rather on setup components lang\eng and lang\rus. Excluding files based on component is not supported yet (see issue #12).

Another problem is that the component IDs use backslashes - we need to replace those with a safe character or extracting on Windows will not work as expected.

dscharrer avatar Jan 14 '21 03:01 dscharrer

The second issue is tracked in #123, closing this as duplicate of that and #12.

dscharrer avatar Aug 26 '23 15:08 dscharrer