tkashkin / GameHub

All your games in one place
https://tkashkin.github.io/projects/gamehub
GNU General Public License v3.0
2.25k stars 128 forks source link

Support Nullsoft Installer self-extracting archive #96

Open neuromancer opened 6 years ago

neuromancer commented 6 years ago

Some Humble Bundle games installers are Nullsoft self-extracting archives. For instance, Darklands:

$ file Darklands_v1.0.exe 
Darklands_v1.0.exe: PE32 executable (GUI) Intel 80386, for MS Windows, Nullsoft Installer self-extracting archive
$ file -i Darklands_v1.0.exe 
Darklands_v1.0.exe: application/x-dosexec; charset=binary

Using innoextract will silently fail to extract it. It will be nice to support its installation, since file-roller can extract them out-of-the-box (I think it is using 7z)

tkashkin commented 6 years ago

Any reliable way to detect it except file <file>.exe | grep Nullsoft?

neuromancer commented 6 years ago

Not really. file should verify the NSIS signature:

https://github.com/kornelski/7z/blob/20e38032e62bd6bb3a176d51bce0558b16dd51e2/CPP/7zip/Archive/Nsis/NsisIn.h#L28

Do you want to avoid to use file?

tkashkin commented 6 years ago

I have added NSIS installer support, but file-roller doesn't seem to be able to correctly extract one NSIS installer I have found in my humble collection.

neuromancer commented 6 years ago

Works great!. I tested it with Command H.Q.. If it is not working for you, maybe your 7z binary was compiled without nsis support?

Anyway, my final suggestion for this feature is to change the name of the compatibility layer to avoid confuse the users: Innoextract is too specific now, since we can extract more types of installers.

tkashkin commented 6 years ago

No, it ignores compat tool at all if NSIS installer is detected. Innoextract is still correct because it uses innoextract.

neuromancer commented 6 years ago

Fair enough. Great work!

tkashkin commented 6 years ago

Btw I have added a wiki page about compat tools. You can edit wiki if you want and if you think something may be confusing for users. :slightly_smiling_face:

tkashkin commented 6 years ago

I was implementing #106 and testing with Uplay. It's also NSIS installer and it doesn't unpack correctly for me. Even if such unpacking works, installer still may do something itself (especially in cases like Uplay), and while it probably should work for most games, for some it won't.

For now I'll use file-roller for NSIS installers only if innoextract is selected and I will think how can it be solved properly. Maybe file-roller should be added as a separate compat tool.