Skip to content
⌘ NSIS Forum Archive

Full color icon, XP style without recompiling and smaller header size

136 posts

rainwater#
Originally posted by kichik
Thanks man 😁

But I have to disagree... There are two things left!
I need to make nsis support multiple languages too 🙂

To merge it with NSIS 2.0a1 I first have to talk to Rainwater but he doesn't answer =/
I guess he is away or something...
hehe. I have been out for a few days. I would love to see how you are progressing on the merge. You can IM me at ICQ #105482052.
SmartyMan#
Originally posted by Joost Verburg

I had the same problems using GetTempFileName, so I guess this will work.
You are right, my script was using "SetOverwerite IfNewer"; removing this line mde the code work.
Thanks again.
SmartyMan#
Originally posted by Joost Verburg
So you are planning the use compiled Win32 resource files (.res) which can be edited with ResHack?
Do you have an URL for downloading this software?
mlbl#
Originally posted by SmartyMan

Do you have an URL for downloading this software?
Resource Hacker Homepage
kichik#edited
The custom UI code is almost ready so I want to ask you to start creating your custom UIs so I can add them to my next version (NSIS 2.0a2).

Attched is the default UI. All you need to do is change its dialgo resource (105) to whatever you want, as long as you keep the basic controls. The basic controls are back, cancel, and next buttons, the version string and the big "black" rect in the middle which is used to determine the position and size of the NSIS dialogs (dir selection, license agreement, etc.). It is recommended that you don't resize the middle rect.

Please attach or E-Mail me your UIs so I can include them in the contrib folder.

TIA
KiCHiK

[edit]New attachment with just one EXE, sorry about that[/edit]

Attachments

rainwater#
Originally posted by kichik

Attched is the default UI. All you need to do is change its dialgo resource (105) to whatever you want, as long as you keep the basic controls. The basic controls are back, cancel, and next buttons, the version string and the big "black" rect in the middle which is used to determine the position and size of the NSIS dialogs (dir selection, license agreement, etc.). It is recommended that you don't resize the middle rect.
Does this mean all of the text will be inside of the black rectangle? I would like to be able to add the header text inside of another area. Probaly not possible though, right?
kichik#
Not at the moment... Sorry.
But I will see what I can do for the next version 😁

BTW, does anyone think it would be useful to add a /RESIZETOFIT option to SetBrandingImage?
Sunjammer#
Originally posted by rainwater
Does this mean all of the text will be inside of the black rectangle? I would like to be able to add the header text inside of another area. Probaly not possible though, right?
What's to stop you adding static text strings into the dialog template? I can't see how that would break anything, you wouldn't be able to change them at runtime but if you are building it for just you and it is just intended as a fixed header (maybe a title) that would be okay.

(shoot me down in flames if I'm completely wrong)
rainwater#
Originally posted by Sunjammer


What's to stop you adding static text strings into the dialog template? I can't see how that would break anything, you wouldn't be able to change them at runtime but if you are building it for just you and it is just intended as a fixed header (maybe a title) that would be okay.

(shoot me down in flames if I'm completely wrong)
I agree. I'm wanting to change the text to include the section title (so that is looks similar to the windows installer) and the subtext (like DirText). Kickik is going to work on a solution. If all else fails, SendMessage support will let me add my own labels and change them at runtime using onnextpage, etc.
SmartyMan#
BTW, does anyone think it would be useful to add a /RESIZETOFIT option to SetBrandingImage?
I did not change my opinion yet, so: yes.
I havent had the time to take a look into the ResHack tool(s) yet, but regardless how good this tools are, using options in the script has some advantages.
kichik#
I am having trouble using StretchBlt, the stretched bitmaps comes out black & white 🙁
In the mean while I am just using the plain old LoadImage with a specified width and height, but I would like to use StretchBlt because its results are much better. Does anyone what's the problem with it? Does anyone know how to resize a HBITMAP?

TIA
KiCHiK
rainwater#
Originally posted by kichik
I am having trouble using StretchBlt, the stretched bitmaps comes out black & white 🙁
In the mean while I am just using the plain old LoadImage with a specified width and height, but I would like to use StretchBlt because its results are much better. Does anyone what's the problem with it? Does anyone know how to resize a HBITMAP?

TIA
KiCHiK
Take a look at http://www.codeguru.com/bitmap/Smoot...pResizing.html
kichik#
This article doesn't use StretchBlt... It uses a custom algorithm that will add some KBs to the header.
rainwater#
Originally posted by kichik
This article doesn't use StretchBlt... It uses a custom algorithm that will add some KBs to the header.
Yep, but it also says StretchBlt will not work.
kichik#
The only sentence about StretchBlt is:
When we want to resize a bitmap and also the resulting bitmap to be of the highest possible quality, the Win32 AIP function StretchBlt() is not of much help. There are already articles about this task in the CodeGuru sections, but the proposed algorithms take considerable amount of memory when used on large bitmaps - with dimensions of several thousand pixels on each axis.
And I don't see where it says it won't work. It just says it won't produce the best quality.

I guess I will just leave my code with the LoadImage solution =/
thomas.lentzsch#
StretchBlt

The StretchBlt function works fine with colors bitmaps.

But have have do do some stuff before you call the StretchBlt function. So one thing is to select the color palette within the device context before you call StrechBlt and deselect the palette later.
kichik#
Thanks Thomas, I will test it later with the palette selection. I guess that was the problem...
SmartyMan#
OK, I had a look with ResHack at the default.exe now.
There is no control for the branding image, so I have to add one myself if I want to change the styles.
In this case I have to move the other controls down (or right);
AddBrandingImage does this for me, if I use an ui.exe I have to do it myself and therefore I have to create a new ui.exe at least for every different-in-size image I want to use for my various installers.
Changing the image during page-switch will cause problems, too...

To handle these problems, we would need the possibility to define a selfmade control as the control used to show the branding image (e.g. SetBrandingCtrl <id>)

As you can see, the options mentioned in one of my latest postings would make the things easier to handle - but that doesnt mean that an editable resource isnt a good idea.

In my opinion the editable resource is a brilliant way to handle very personal optical adjustments, present in *every* installer that the user creates (e.g. increase the buttons width for longer texts), while options dealing with styles are the better way to handle adjustments to controls the installer manipulates itself (in this case: resize the branding-control as given by AddBrandingImage, move the other controls out of the way).
kichik#
You can use NSIS 1.99 with AddBrandingImage and then load its dialog resource into ui.exe.

Should I keep AddBrandingImage along with ChangeUI? It is possible...

You will have an option to set the image to a given control id (SetBrandingCtrl <id>). Plus, ChangeUI will find the first image control and set it as the default for SetBrandingImage (if no id was specified).

BTW, to add an "image control" in Resource Hacker just right-click your dialog (after you chose it in the left pane), choose Insert Item, press on the tree picture (tooltip is BITMAP), OK, resize, move, and don't forget to press the Compile Script button or else your changes won't be saved.
SmartyMan#
Should I keep AddBrandingImage along with ChangeUI? It is possible...
If you remove this command, there will be no way for defining size and orientation for the branding 🙂
OK, you could also move the parameters to SetBrandingCtrl.

You will have an option to set the image to a given control id (SetBrandingCtrl <id> ). Plus, ChangeUI will find the first image control and set it as the default for SetBrandingImage (if no id was specified).
OK, lets see how it feels to use the new concept then 🙂

BTW: wouldnt this ui.exe concept a good way of replacing the install-options-dll?
I mean, if you plan to integrate commands for communication with the self added controls, why not use them with self made dialogs using page.exe's editable with ResHack, too?
Advantages would be:
- graphical dialog editor
- much more flexibility (more controls, more control about styles etc)
- no need for another .dll and code dealing with installing it, handling those .ini files etc

Just an idea...
spanky#
Found a bug. I downloaded the latest version and recompiled my new script - but I forgot to remove the command "EnabledBitmap" first.
Trying to do a compile crashes MakeNSISW with this command included.

btw, is there any way to add the functionality of EnabledBitmap back in? I don't have many installation options so the checkboxes are no use for me. Besides, they're ugly.
rainwater#
Originally posted by spanky
Found a bug. I downloaded the latest version and recompiled my new script - but I forgot to remove the command "EnabledBitmap" first.
Trying to do a compile crashes MakeNSISW with this command included.
I can't reproduce. I get the following in the log window:

Invalid command: EnabledBitmap
spanky#
Looks like "SectionDivider" was also removed. This too causes MakeNSISW to crash.
Am I safe to say that all compile errors cause it to crash?

Can we re-add the functionality of SectionDivider too?
rainwater#
Originally posted by spanky
Looks like "SectionDivider" was also removed. This too causes MakeNSISW to crash.
Am I safe to say that all compile errors cause it to crash?

Can we re-add the functionality of SectionDivider too?
What OS are you using? Compile errors shouldn't be causing a crash (they don't on my XP system).
mlbl#
Would it be possible to have an option to span the NSIS output file into multiple disks/discs? Would be great it that could be done.
Sunjammer#
I notice that people are not posting these bugs on the Source Forge system where they will be recorded, likewise with the feature requests. It will make KiCHiK's (and anyone else who joins him) life easier I'm sure if you use those facilities.

Submit a bug in NSIS 2.0a2 here

Submit a feature request in NSIS 2.0a2 here
kichik#
Makensisw doesn't crash here too...
mlbl, I don't think I will do it, maybe in some future version.