- NSIS Discussion
- BgGradient and CRC patch
Archive: BgGradient and CRC patch
JasonFriday13
1st May 2006 01:40 UTC
BgGradient and CRC patch
I have just got back from my two week holiday from college, and I have been busy. I have added a patch to add a border, a title bar, and a system menu to bggradient, with defines in scons to turn it on and off. I also added to the crc check the ability to move a progress bar. You have to add the progress bar to the verify dialog using resource hacker, and give it and id of 3003 (I think). InstallSpiderUI already has the progress bar on it. Requires nsis 2.07 and above.
Here is the binary stubs...
JasonFriday13
1st May 2006 01:48 UTC
...and here is the source code. Will now work on a stub that has no compression code in it for the installers that have 'SetCompress off' in the script (for a smaller stub and to say there is 'Using no compression' instead of 'Using zlib compression' after you compile a script).
kichik
3rd May 2006 11:27 UTC
Thanks for the patches. Please submit patches to the patch tracker for easier tracking.
- What's the byte count on those features?
- Did you test the gradient window changes with minimizing, maximizing, window switching, etc.?
- 2.07 required because of SCons?
JasonFriday13
3rd May 2006 23:10 UTC
I am not a member of sourceforge.net yet, so I can't submit patches.
1. 1KB extra on stubs (half a KB on some)
2. Yes I have tested the patch, and the latest InstallSpiderUI release uses this patch. I made the bggradient window a child of a dummy window so that the taskbar button for the bggradient window does not show. I also disabled the minimize and maximize buttons, as well as disabling the window, so that the user cannot interact with the bggradient window on runtime (it still minimizes and maximizes with the main installer window).
3. I just relised it could actually be used with any nsis version (not just the scons built nsis) because I included a file (config_old_scons_nsis.h) with the defines for older scons nsis versions, which could be used for pre scons nsis versions as well. My mistake.
Note: files for source code taken from nsis 2.15 source.
kichik
4th May 2006 14:41 UTC
I am not a member of sourceforge.net yet, so I can't submit patches.
Signing up is free and requires no more than 5 minutes.
- Did you check the exact numbers in the map file?
- Tried all the winkey shortcuts? Winkey+M, Winkey+D? Other applications minimizing the window? I only ask because it took me a while to get it right for the current implementation.
JasonFriday13
5th May 2006 02:31 UTC
1. Didn't know there was a map file :confused:.
2. As far as I can see, winkey+D and winkey+M do work correctly. The only thing I added for the patch is a dummy window, and changed the window style to make it have a title bar and system menu (although they can't actually be used). I have commented where the extra code is in the source.
Just registered at sourceforge.net.
JasonFriday13
15th May 2006 02:13 UTC
Another update (hopefully for good). Fixed the bottom of the window not covering the taskbar. As before, binary stubs for NSIS 2.07 and above...
JasonFriday13
15th May 2006 02:17 UTC
...and the source for (almost) any nsis version.
[edit]This one will be submitted to the patch tracker in the near future (don't know how near).[/edit]
JasonFriday13
16th May 2006 01:31 UTC
Well, that day in the near future has come and gone. I have just submitted it to the patch tracker here.
[edit]fixed typo[/edit]
JasonFriday13
22nd May 2006 05:30 UTC
I stated that the progress bar id for the verify dialog was 3003, when it is actually 3300. I didn't check until now :rolleyes:.
JasonFriday13
16th August 2006 00:37 UTC
I have revived work on this little project again. This time, I am adding the patch as switches to the BGGradient command.
[edit]Forgot to say that the crc progress bar will not be in this patch.[/edit]
I added it in the last hour or so to the source of NSIS 2.19. I will be compiling and testing over the next five days to make sure it works the way I intended. Example usage:
BGGradient /TITLEBAR /DROPSHADOW 0000FF 000000 FFFFFF
The /TITLEBAR option adds a border and title bar to the top of the window (along with the caption from the main window).
The /DROPSHADOW option adds a black dropshadow to the text in the background.
If I'm lucky, this might be added to an NSIS release, doubtful though :(.
JasonFriday13
16th August 2006 23:52 UTC
I didn't want to create a new thread, and since it is related to showing windows, I will ask it here.
When the background window is displayed, it is shown behind the main installer window. I am trying to do the same on one of my new plugins, but the window is in front of the installer (in other words, the window is shown, and any message boxes that pop up are mostly hidden by the window I have created). Is there a simple fix for this (like SetWindowPos)?
I have attached an example.
kichik
19th August 2006 12:36 UTC
You can use SetWindowPos to set your window to show below the installer window. Call SetWindowPos on the your window's handle and pass the installer's window handle in hWndInsertAfter.
JasonFriday13
20th August 2006 23:10 UTC
Yeah, I figured that out on the weekend, but it does not work :(. I thought it would.
My next step is to use the code from the BgImage plugin to create the window (because the window for that is behind the main installer window).
Update on the BgGradient patch: I have put in the script parsing code for it, but found out it is not so easy to add a command to NSIS (2.15). I am having trouble writing and reading the correct value to and from the exehead. If someone could give me a crash course on adding info to the exehead and reading it from the exehead at runtime, that would be awesome.
kichik
25th August 2006 12:42 UTC
Simplest way is changing the header structure (Source\exehead\fileform.h and Source\fileform.cpp). Then, you'll have your information in g_header in the exehead code.
JasonFriday13
27th August 2006 23:16 UTC
Thanks for that. I will look at it.
JasonFriday13
20th September 2006 23:59 UTC
It's probably because I have no idea whats wrong with my code. Source\fileform.cpp has the right fields in it to add to the bg part (bg_color1-2), but source\exehead\fileform.h dosen't have the same structure and I don't know how to set it. I have managed to get it so that it makes an error everytime the bggradient command is used, which means that the data is not being read/written (correctly).
I will be away for the next two and a half weeks so you probably won't get me until the 9th of October.
kichik
22nd September 2006 10:45 UTC
fileform.h is not automatically generated. You must add those fields on your own in the same place you've put them in fileform.cpp.