It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Hello all. I'd like to package The Settlers 2 for Gentoo Linux using the open source "Return to the Roots" engine and (optionally) allow the user to install the data from their GOG download. I'd also like to do something similar for FreeSpace 2 but I haven't downloaded that yet. Gentoo's package manager doesn't allow you to do anything graphical so it needs to be able extract the data without firing up the usual installer through Wine. This would also allow users on other platforms (ARM, PPC, MIPS, etc) to install the game. I've tried to rip the file apart and from what I can tell, it seems to contain at least one LZMA file but unfortunately LZMA is a headerless format so I can't locate the start of it. I tried to extract starting from each byte of the file, one at a time, but even my fast machine is going to take days to do this. I'm not sure how the installers are prepared exactly. Maybe someone could tell me the first few bytes of the main LZMA file so that I can find it?
Post edited April 11, 2011 by Chewi
No posts in this topic were marked as the solution yet. If you can help, add your reply
Okay, after a LOT of digging, I now know that the games are packed with Inno Setup. There is an open source command-line unpacker, innounp. That would be great if not for the fact that it's written in Delphi. It can be run by a script using Wine but that's not ideal. I don't know Delphi but I'll have a dig around.
Post edited April 11, 2011 by Chewi
You might try just unzipping it and see what happens. Unzip does support self extracting .exe files, so it might work.

http://linux.about.com/od/commands/l/blcmdl1_unzip.htm
Heh, if only it were that simple. That's what I tried first because it often does work but only if the underlying file is a zip file, which this defnitely isn't.
One of the projects in my list is to rewrite innounp in Perl.

If you're willing to work with me (...) I can move it to the top of the list (currently, my installers [Arch Linux] use the Wine/innounp setup).
I noticed your Arch package and had to download it to see what it was all about. Forgive me if I was a little disappointed. ;)

I'm afraid what little Perl knowledge I had fell out of my brain a long time ago. Ruby, on the other hand, I can do in my sleep. In either case though, having seen the innounp code, it just looks like a nightmare. It would probably be easier to replace the Windows-specific stuff and get it building with Free Pascal but I've got better things to waste my time on! While LZMA is common enough, I didn't realise I was dealing with such an obscure archive format when I started this thread.
avatar
Chewi: I noticed your Arch package and had to download it to see what it was all about. Forgive me if I was a little disappointed. ;)
The only thing I can think of you could be disappointed about is the fact that you can't find any. I've never submitted my Arch packages anywhere, because they are just hacks to get them to work on my setup.

May I ask what you are referring to?
Post edited April 11, 2011 by xyem
Oh, I assumed it was yours! I found this. It's just some kind of shell wrapper.
avatar
Chewi: Oh, I assumed it was yours! I found this. It's just some kind of shell wrapper.
Indeed it is (a shell wrapper, not mine) and it's what my current installers use to extract the setup files. As I said, I am going to replace it with a Perl script.. which means cross-platform goodness :)

However, because that works for now, it's on the bottom of my priority list :P

EDIT: By the way, when I said "work with me", I didn't necessarily mean coding. We could work together to "decipher" innounp and then rewrite it in our respective languages. I know you're not meant to reinvent the wheel but it would be a good learning exercise :)
Post edited April 11, 2011 by xyem
avatar
Chewi: Oh, I assumed it was yours! I found this. It's just some kind of shell wrapper.
avatar
xyem: Indeed it is (a shell wrapper, not mine) and it's what my current installers use to extract the setup files. As I said, I am going to replace it with a Perl script.. which means cross-platform goodness :)

However, because that works for now, it's on the bottom of my priority list :P
There's a post on the 7-zip forum about adding inno support but nothing came of it. :(
Looks like I need this more than I thought. Gentoo's Portage enforces a sandbox until the files are finally installed to the system in order to prevent accidental damage. Wine isn't playing nicely with the sandbox at all. It isn't really the sort of thing you want to be running during an installation.

Adding support to 7-Zip would be ideal. Shame nothing came of it. My C is strong and my C++ isn't bad but I just don't where to start. It seems like a mammoth task.
A little good news. I managed to tame the sandbox enough to allow Wine to run. Still sucks for the other archs though.
avatar
xyem: One of the projects in my list is to rewrite innounp in Perl.

If you're willing to work with me (...) I can move it to the top of the list (currently, my installers [Arch Linux] use the Wine/innounp setup).
I'd be interested.
But I had a look at the Pascal source of innounp and it sure looks like a massvie undertaking.
I'd also favor C over Perl, but I'm fine with both.
avatar
onitake: I'd be interested.
But I had a look at the Pascal source of innounp and it sure looks like a massvie undertaking.
I'd also favor C over Perl, but I'm fine with both.
I am several orders of magnitude more familiar with Perl than C. The help doesn't even have to be major.. just someone who can look at the innounp source and help me when I get stuck would be great.
avatar
xyem: I am several orders of magnitude more familiar with Perl than C. The help doesn't even have to be major.. just someone who can look at the innounp source and help me when I get stuck would be great.
Sure thing.
Did you already start working on it?
If not, here's a few things I'd take into consideration:
- The InnoSetup source has a data structure unit for every version
- I'd write an abstraction for each of the versions that can pack/unpack into a common data set
- Implement individual functions (list files, extract files, get install script, etc.) in a version independent way, using the abstractions
- Or use full-featured classes instead of just data abstractions
But that's just how I would go on, please do it however you like it. :)