InnoSetup module for Observer

Here you can discuss about your favorite plug-in.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

InnoSetup module for Observer

Post by pepak »

Latest post of the previous page:

I tried version 5.6.1, in both Unicode and ANSI, and both in x86 and x64, and both seem perfectly fine. What exactly do you get that is not correct?
Ariman
Posts: 1351
Joined: Fri 30 Nov, 2007 15:32
Location: Крым
Has thanked: 15 times
Been thanked: 50 times
Contact:

InnoSetup module for Observer

Post by Ariman »

Files are fine. Problem is with BOM prefix. Compare first 3 bytes of script file extracted by innounp and by your module in hex view. Version from innounp contains UTF BOM sequence in first 3 bytes. They help editors to correctly identify file encoding. If you open script file in Far's File Viewer it will automatically switch to 65001 codepage (utf-8). Script file extracted by module contains some other 3 bytes at the beginning and Viewer can not understand what codepage should be used.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

InnoSetup module for Observer

Post by pepak »

I believe my module works correctly - it extracts the file with the BOM, then FAR automatically detects this BOM, switches to the 65001 codepage and hides the BOM. Manually switch to an 8-bit codepage such as 1252, then you will see the BOM.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

InnoSetup module for Observer

Post by pepak »

Made an additional check, comparing files from my module to the files from the official InnoUnp (not my InnoUnp). The reconstructed script and most of the files are the same, but there is a difference in some of the .isl files. I will research those. Also, license.txt got converted to UTF16, but I think that's an acceptable change. Other than that, the files seem to be the same.
Ariman
Posts: 1351
Joined: Fri 30 Nov, 2007 15:32
Location: Крым
Has thanked: 15 times
Been thanked: 50 times
Contact:

InnoSetup module for Observer

Post by Ariman »

Ok. To simplify the explanation here is the screenshot.
script-bom.png
File with _exe suffix is one from official innounp and file with _mod suffix is from the module. First 3 bytes are different.
Correct UTF BOM is 0xEF,0xBB,0xBF (https://en.wikipedia.org/wiki/Byte_order_mark). File from module does not have correct bytes.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

InnoSetup module for Observer

Post by pepak »

The problem is, that correct BOM is exactly what I am getting from the module!

I will need to check the work with non-ASCII characters, due to that difference in .isl files. Perhaps it is somehow related to your incorrect BOM, too. Or not. It will be difficult for me to verify because I am getting the correct values.
Ariman
Posts: 1351
Joined: Fri 30 Nov, 2007 15:32
Location: Крым
Has thanked: 15 times
Been thanked: 50 times
Contact:

InnoSetup module for Observer

Post by Ariman »

Strange. Out of curiosity I tried both x86 and x64 versions of Far3 and got invalid BOM in both cases. Not sure why we could have different results for the same file.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

InnoSetup module for Observer

Post by pepak »

Given the differences in .isl files, my guess is some uninitialized variable in UTF8 encode. Strange that there is no warning in Delphi, though, and more strange that there were no such reports in older Delphi versions - it could also be a bug in Delphi 10.3 Rio. We shall see.
Ariman
Posts: 1351
Joined: Fri 30 Nov, 2007 15:32
Location: Крым
Has thanked: 15 times
Been thanked: 50 times
Contact:

InnoSetup module for Observer

Post by Ariman »

Ah, I get it now. I've checked your sources and I think that in your version script text goes through unicode->ansi conversion.
I use Delphi7 where String == AnsiString, you use 10.3 where String == UnicodeString. TBigString class uses String type. In your version it is Unicode string and script text does double conversion: ansi->unicode in TBigString and uncode->ansi inside RebuildScript. In my version there is no such thing because both string types are AnsiString. And on different locales (I guess we have different ones) unicode-ansi convertion produces different results. That is why we see different output.
I suggest to fix TBigString to use AnsiString type explicitly. Since .isl files created with TBigString too I guess they have same issue.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

InnoSetup module for Observer

Post by pepak »

Hmm. I may end up doing just that, but only as a last resort. I would much prefer to convert the strings during read so that the "native" version reflects the Delphi used for the compilation. Then I could convert the native version back to whatever the user requires.
skipik
Posts: 318
Joined: Wed 03 Jun, 2015 15:24
Has thanked: 67 times
Been thanked: 29 times

InnoSetup module for Observer

Post by skipik »

pepak, hello, Ariman is working on a new version atm, it's Observer 1.12 and your innounp.so doesn't work there. Could you fix it please? You can get the latest binaries here: viewtopic.php?p=152643#p152643 and source code is here: https://github.com/lazyhamster/Observer
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

InnoSetup module for Observer

Post by pepak »

At a glance, the modification seems simple enough. However, I am reluctant to do that until the new version of Observer is released, for fear of confusing the users.
Yegor
Posts: 1326
Joined: Mon 04 Apr, 2005 13:41
Location: San Ramon, CA / Kharkov, UA
Has thanked: 32 times
Been thanked: 61 times

InnoSetup module for Observer

Post by Yegor »

pepak wrote: Sat 16 Feb, 2019 07:00 I am reluctant to do that until the new version of Observer is released, for fear of confusing the users.
I, personally, agree.
Мы не можем ждать милостей от Фара, взять их у него — наша задача! (C) Мичурин
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

InnoSetup module for Observer

Post by pepak »

InnoUnp 0.48.0 mod released

Changes:
  • Synchronized with InnoUnp v0.48.
  • Fixed incorrect Unicode<->ANSI conversions in various versions of Delphi. Now the generated files should be the same regardless of the Delphi version and should always contain proper data. To achieve this, the file format for .iss and .isl files was changed to always use UTF8, unlike the original InnoUnp.
Download (source + binaries)
skipik
Posts: 318
Joined: Wed 03 Jun, 2015 15:24
Has thanked: 67 times
Been thanked: 29 times

InnoSetup module for Observer

Post by skipik »

pepak, looks like you have built both x64 modules (.exe and .so) for I386. They don't work with Far x64.

pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

InnoSetup module for Observer

Post by pepak »

Damn. I was wondering why the filesize is so small. Fixed, redownload the file please.
Post Reply

Return to “General Plug-In Discussions”