- NSIS Discussion
- Restoring window focus after Banner::destroy
Archive: Restoring window focus after Banner::destroy
hanky
1st August 2013 15:44 UTC
Restoring window focus after Banner::destroy
Hi!
I want to use Banner::show function to replace the standard "Please wait while Setup..." string.
But how do I properly close that banner?
After I call Banner::destroy my installer window loses it's focus. How can I fix that?
aerDNA
1st August 2013 17:38 UTC
BringToFront. Note however that Banner utilizes that dialog but it's not a replacement. Using Banner will not change the string displayed on installer start. If that's what you're trying to do, you'll have to reshack dialog 111.
hanky
1st August 2013 20:52 UTC
Originally posted by aerDNA
BringToFront. Note however that Banner utilizes that dialog but it's not a replacement. Using Banner will not change the string displayed on installer start. If that's what you're trying to do, you'll have to reshack dialog 111.
I've managed to replace standard text on the banner, but my goal is to keep the installer on top after it.
BringToFront doesn't help. When I call it, the installer just begin to blink in the task bar. It doesn't move to front.
aerDNA
1st August 2013 22:02 UTC
It's the "prevent applications from stealing focus" Windows feature; I tend to forget about it since I always have it disabled. You should be able to beat it with this:
System::Call "User32::SetWindowPos(i $HWNDPARENT, i -1, i 0, i 0, i 0, i 0, i 3) i."
hanky
2nd August 2013 08:44 UTC
Originally posted by aerDNA
BringToFront. Note however that Banner utilizes that dialog but it's not a replacement. Using Banner will not change the string displayed on installer start. If that's what you're trying to do, you'll have to reshack dialog 111.
And what about using reshack?
I've found and replaced the "Please wait while Setup..." string in the Contrib\UIs\modern.exe.
But where can I found the "verifying installer" string? Is recompiling NSIS the only way to change it?
aerDNA
2nd August 2013 09:52 UTC
That one is in Stubs\zlib (or whichever you're using); you can hex edit it.
hanky
2nd August 2013 09:59 UTC
Originally posted by aerDNA
That one is in Stubs\zlib (or whichever you're using); you can hex edit it.
Thank you, I've found the string I need. But is it possible to insert cyrillic symbols into that file? When I patch it, I see symbols in wrong encoding during installation.
aerDNA
2nd August 2013 22:15 UTC
I would guess that proper locale isn't set for non-unicode programs on your test system, but in that case the whole installer would fail to display cyrillic symbols. You could replace the string with spaces, or turn crc checking off; not very beautiful solutions, I know.
aerDNA
2nd August 2013 23:54 UTC
I tried and succeeded in getting a Russian Cyrillic string to display properly (проверка установки = verifying installer if google translate is correct). I attached the edited zlib - if it doesn't work for you, then it's the system locale; if it does, then you didn't edit right.
hanky
5th August 2013 12:30 UTC
It seems that we use different NSIS version.
I've tried your file, it displays proper string, but after it the installer crashes.
Also I've tried to copy your string into my file but it didn't help. In my file one letter takes two bytes and in yours it takes one byte.
Attachment 50735
aerDNA
5th August 2013 17:12 UTC
I just assumed it was 2.46. Which version is it? It's obviously unicode but I can't match it with any build. Anyway, I edited your zlib, see if it makes a difference.
aerDNA
5th August 2013 23:00 UTC
The above will not work, but this one will.
hanky
6th August 2013 09:29 UTC
Originally posted by aerDNA
The above will not work, but this one will.
Thank you very much. This file works.
But could you explain which encoding did you use?
aerDNA
6th August 2013 15:25 UTC
Unicode (UTF-16LE). The latin subset of unicode has the same codes as ansi, except they're 2 bytes, so when seen in hex editor, it looks like a 'regular' string interlaced with zeros. This gave you and me the wrong idea that you can just replace the latin ascii with cyrillic, but it doesn't work that way. The easiest way I guess to get the properly encoded string is to write it in notepad, save as unicode and open in hex editor; discard the first 2 bytes and the rest is your string.
hanky
9th August 2013 09:52 UTC
Thank you!
Now I can edit those files myself :)
Anders
9th August 2013 15:36 UTC
Originally posted by aerDNA
The latin subset of unicode has the same codes as ansi, except they're 2 bytes, so when seen in hex editor, it looks like a 'regular' string interlaced with zeros.
Only the first 127 codepage entries (old school ASCII) are the same...