InnoSetup module for Observer

Here you can discuss about your favorite plug-in.
Post Reply
pepak
Posts: 330
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 3 times
Been thanked: 9 times

InnoSetup module for Observer

Post by pepak » Fri 07 Aug, 2015 18:29

Here you can download an InnoSetup module for the Observer plugin. The module is based on InnoUnp 0.45, which I had to modify quite a lot to make it usable in FAR. Both the updated InnoUnp and the InnoUnp Module should be considered an extreme alpha, as I only performed minimal testing. But it seems to work reasonably well.

Download
InnoUnp v0.46 + Observer 1.11.0 - Source + Binaries

Installation
  1. From the archive, copy bin\innounp.so to %FARHOME%\Plugins\Observer\Modules.
  2. In %FARHOME%\Plugins\Observer\observer.ini:
    1. In the Modules section, add the following line:

      Code: Select all

      Inno=modules\innounp.so
    2. In the Filters section, add the following line:

      Code: Select all

      Inno=*.exe
  3. Restart FAR.
  4. Press CTRL+PgDown on an InnoSetup file to open it.
Compatibility
The module is compatible with all 32bit versions of Observer. At least, it should be - I only tested it for FAR3, but there isn't really anything that could cause trouble with previous versions of FAR. 64bit versions are not supported and likely won't ever be supported - InnoUnp uses some nasty difficult-to-find type conversions incompatible with 64bit code and, anyway, I don't have 64bit unpacking modules for it.

License
Same as InnoUnp, which is, I believe, GPL (oh well). If Ariman wants to incorporate my changes into InnoUnp, I would welcome it.

Changes made to InnoUnp
  • Compatibility with Unicode Delphi (tested with Delphi XE2). Non-unicode Delphi still works, too (tested with Delphi 7).
  • No more global variables for non-shared stuff. Some global variables remain, but they are not activelly accessed by the current code.
  • Proper dealocation of allocated structures. The original InnoUnp leaked horribly - strings didn't get deallocated, even though they are reference-counted (the nasty use of structures accounted for that).
  • I provided a standalone class for InnoSetup file handling. That way you can easily use InnoUnp in your own software (e.g. Observer modules).
  • All this was made while keeping the original code as much as possible. For this reason the code tends to be difficult to read and unnecessarily complex (see the TInnoSetupFile.Extract function, or the runtime variables which are split among TMainInfo and TInnoSetupFile).
Known issues
  • The code should be considered alpha at best. I did only a very limited testing with limited InnoSetup files. I particularly did not test any password-protected setups, and the Unicodification could easily lead to problems in this area. If your life or well-being depends on properly extracting InnoSetup archives, do perform some major testing before using my module!
  • A few memory leaks remain. I know where FastMM4 tells me they originate, but I couldn't find the cause. It should not present a problem unless you plan to extract thousands of setups without restarting FAR, though.
  • The progress display of the module is very quirky. When I tested it on a 100+ MB archive with 1000+ files, it displayed correctly for some parts of the extraction process, then suddenly switched to values such as "completed 15000% / 2400%", then switched back to correct display, then once again showed huge percentages. I don't know why, I would think my handling is correct, but apparently it isn't.
  • Once the modification gets properly tested, I would strongly recommend rewriting it from its current records-and-pointers-based structure to standard class structure. I can understand why InnoSetup wants to use records (it keeps the size small, which is quite useful in a setup-building program), but that is irrelevant to InnoUnp - and with my modifications, InnoUnp is quite far away from InnoSetup, anyway, so why stick to its philosophy?
  • It would be, IMHO, quite useful if Observer introduced a new API which would allow to e.g. return textual description of errors, so that the user could get a more detailed reason for failure than, basically, "error reading archive".
I hope you like this module. I would welcome any suggestions you might have, provided they are not requests for 64bit support :-)

Old downloads
InnoUnp v0.45 + Observer 1.11.0 (mod 2) - Source + Binaries
InnoUnp v0.45 + Observer 1.11.0 - Source + Binaries
InnoUnp v0.43 + Observer 1.10.1 - Source + Binaries
Last edited by pepak on Sun 17 Jul, 2016 11:06, edited 4 times in total.

pepak
Posts: 330
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 3 times
Been thanked: 9 times

InnoSetup module for Observer

Post by pepak » Thu 21 Jan, 2016 17:06

Released the updated plugin:

1) Updated to InnoUnp v0.45 sources.
2) Updated to Observer v1.11.0.

Ariman
Posts: 1155
Joined: Fri 30 Nov, 2007 15:32
Location: Крым
Has thanked: 10 times
Been thanked: 23 times
Contact:

InnoSetup module for Observer

Post by Ariman » Fri 22 Jan, 2016 09:55

Tested the module and noticed one strange thing - folder 'embedded' contains only one file 'uninstall.exe' which has size = 0, all other files that should be there are missing.

pepak
Posts: 330
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 3 times
Been thanked: 9 times

InnoSetup module for Observer

Post by pepak » Fri 22 Jan, 2016 11:02

The same thing happens with the official InnoUnp.exe. Presumably, that's because "extract embedded" is off by default. Will change that for the InnoUnp module. Not sure if it will help with the missing files, but as I was able to simulate the situation, I hope I will be able to find and fix the cause.

Ariman
Posts: 1155
Joined: Fri 30 Nov, 2007 15:32
Location: Крым
Has thanked: 10 times
Been thanked: 23 times
Contact:

InnoSetup module for Observer

Post by Ariman » Fri 22 Jan, 2016 11:08

Yes. Embedded files are off by default. You have to specify -m switch to see them. Module have no command line so I guess it is better to add them by default. Or you can use Observer's config file if you want to give users more control for this option.

pepak
Posts: 330
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 3 times
Been thanked: 9 times

InnoSetup module for Observer

Post by pepak » Fri 22 Jan, 2016 19:14

Activated both extraction of embedded files (-m) and extraction of all copies (-a).

pepak
Posts: 330
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 3 times
Been thanked: 9 times

InnoSetup module for Observer

Post by pepak » Sun 17 Jul, 2016 11:07

Updated the plugin to InnoUnp v0.46
Source + Binaries

Post Reply

Return to “General Plug-In Discussions”