Skip to content
⌘ NSIS Forum Archive

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

136 posts

kichik#edited
Does anyone use .onVerifyInstDir? If so, don't use it with SpaceTexts none or it will not work.

Sorry about this...

This bug will be fixed in my next version (merged with 2.0a1 finally 😁)

[edit]Another one 🙁
Switching from non custom to custom installation will not show the component selection sub-window if SpaceTexts none was specified...

This too will be fixed in the next version[/edit]
SmartyMan#
Originally posted by kichik
Currently I am just using LoadImage(0, filename, IMAGE_BITMAP, width, height, LR_LOADFROMFILE). If you know another way that resiezs better, besides resizing it myself, please tell me.
Maybe you will get better results when centering the image in the foreseen range of the window instead of resizing it?


In my next version I intend to make the license agreement use RTF instead of text. Correct me if I am wrong but this will give you the option to change the font. If not the font, at least its size.
Of course the RichEditCtrl can use different Fonts, but I hope that you dont attempt to ignore/overwrite the font settings given in the .rtf by the author?
mlbl#
If it's possible maybe try to detect the DPI, if it's 96 DPI then use branding image, if it doesn't match 96 DPI - disable it (or have an option for it).
kichik#
Just cenetering the image won't give a good result because not all of the image will be shown. I will use StreachBlt in my next version, it should resize better.

Don't worry, I won't overrun any settings in the RTF...

The branding image control is added at script compile time, so it can not be disabled at runtime.
SmartyMan#
Originally posted by kichik
Just cenetering the image won't give a good result because not all of the image will be shown. I will use StreachBlt in my next version, it should resize better.
Maybe we talk about different things, so I have made a small demo showing "my" way of displaying the image and also a possible solution for the details-window problems.
Resize the window to see the effect, and if you arent sure how this works, take a look in the included source.

Don't worry, I won't overrun any settings in the RTF...
OK 🙂
BTW: did you ever thought about concepts allowing more than one "licence" page?
Example: you might want to display a short description of the software, then the licence.
SmartyMan#
Originally posted by kichik
If RTF supports it...
Search the VisualStudio help (aka MSDN) for "EM_AUTOURLDETECT" and see if you like what you read.
Joost Verburg#
Originally posted by SmartyMan

OK 🙂
BTW: did you ever thought about concepts allowing more than one "licence" page?
Example: you might want to display a short description of the software, then the licence.
An introduction screen would be very nice! 😁

What I would also like to see is a modern style user interface for NSIS, just like all other instllers (Microsoft, Inno Setup, InstallShield). Look at the attechment.
mlbl#
Originally posted by Joost Verburg

An introduction screen would be very nice! 😁

What I would also like to see is a modern style user interface for NSIS, just like all other instllers (Microsoft, Inno Setup, InstallShield). Look at the attechment.
NSIS was made to be small and simple (in terms of size and interface). Having an interface like Installshield/Inno setup would be really nice but if you prefer your installer to have that kind of interface, use it then.

Inno setup is FREE and not only that, you can actually do quite a lot of stuff with it provided that you know how to with the use of the "beefed" up version of Inno Setup called My Inno Setup Extensions that allows you to use Pascal/Delphi like coding for your installer. It's not as easy to code though, compared to NSIS 🙂
Joost Verburg#
Originally posted by mlbl


NSIS was made to be small and simple (in terms of size and interface). Having an interface like Installshield/Inno setup would be really nice but if you prefer your installer to have that kind of interface, use it then.

Inno setup is FREE and not only that, you can actually do quite a lot of stuff with it provided that you know how to with the use of the "beefed" up version of Inno Setup called My Inno Setup Extensions that allows you to use Pascal/Delphi like coding for your installer. It's not as easy to code though, compared to NSIS 🙂
I'm not going to use Inno Setup. NSIS scripting rocks 😁 Inno Setup is also quite large.

This interface could just be an option. I think it's nicer and more user friendly. It's possible now to remove unused resources, so using another dialog for this interface is no problem.

Unfortunately, I cannot code C++, otherwise I would have made such an interface immediately.

I have also heard from other developpers that they don't use NSIS because of it's interface.
CodeSquid#
Originally posted by Joost Verburg
I have also heard from other developpers that they don't use NSIS because of it's interface.
I can't believe it. I'm using NSIS (among other things) because of its good interface: Small, simple and without too much fancy stuff.
Joost Verburg#
Originally posted by CodeSquid

I can't believe it. I'm using NSIS (among other things) because of its good interface: Small, simple and without too much fancy stuff.
Sure, NSIS has a good interface. 😉 It's just a bit classic. I would prefer a more modern interface, like the other installers. 🙂 Another good reason is that the user is familiar with such an interface.

There is no need for a change in the standard interface, but it would be great as an option.
SmartyMan#
Possible Problem?

The code
GetTempFileName $1
MessageBox MB_OK $1
displays
G:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\nst74.tmp
on my system (german W2000/SP2).

With this value of $1, the code
File /oname=$1 logo.bmp
creates a tmp file with 0 bytes length, so code like
SetBrandingImage $1
doesnt work.

Replacing the "GetTempFileName" line by
StrCpy $1 "G:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\nst74.bmp"
or
StrCpy $1 "G:\Dokumente und Einstellungen\Administrator\Lokale Einstellungen\Temp\nst74.bmp"
makes the code work, but using
StrCpy $1 "G:\Dokumente und Einstellungen\Administrator\Lokale Einstellungen\Temp\nst74.tmp"
fails again.

Another way to make the code work is
GetTempFileName $1
StrCpy $1 "$1.bmp"
(resulting in "G:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\nst74.tmp.bmp")

So it seems that the extension causes the problem...
...BUT: compiling the unmodified gfx.nsi shows the images although the extension of $1 is ".tmp"

I can live with this, but maybe other users will experience this problem too, so I thought I should drop a line.
SmartyMan#
Is it possible to add an option for setting the margins and border used by the branding image?
I would prefer brandings like shown in nsis-demo.zip (no margins at left/right/top when using "top" and no margins at top/bottom/left when using "left" instead of the 10-12 pixels used currently, and "sunken" style for the border)

And: what is the reason for blurring the image? In the attached screenshot you may see what I mean (original at the top, nsis version below)
Joost Verburg#
Re: Possible Problem?

Originally posted by SmartyMan
The code
GetTempFileName $1
MessageBox MB_OK $1
displays
G:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\nst74.tmp
on my system (german W2000/SP2).

With this value of $1, the code
File /oname=$1 logo.bmp
creates a tmp file with 0 bytes length
Of course, because File does not overwrite the temp file by default. You should use something like this:
GetTempFileName $1
SetOverwrite On
File /oname=$1 logo.bmp
SetOverwrite Off
Hard coding a temp file name is not good, because the file has to be unique.
SetBrandingImage $1
The branding image has to be included when the installer is compiled, so you cannot use variables in the file name.
Joost Verburg#
Originally posted by SmartyMan
Is it possible to add an option for setting the margins and border used by the branding image?
I would prefer brandings like shown in nsis-demo.zip (no margins at left/right/top when using "top" and no margins at top/bottom/left when using "left" instead of the 10-12 pixels used currently, and "sunken" style for the border)

And: what is the reason for blurring the image? In the attached screenshot you may see what I mean (original at the top, nsis version below)
Yeah, an option for setting margins would be great, but I think that the size of the current dialog is limited, this should be changed.

When I zoom in at your image, I can see that it gets resized a litle bit (1 pixel), I think that's the problem (a bug).
kichik#
OK, here is what I will do. I will add an option to load anohter dialog resource instead of the default dialog, an option to send a message to a dialog control, and replace SetBrandingImage with ChangeImage control_id image.

This will allow to customize NSIS interface in every way you wish to and to set your own place/margin/styles (including centering) to the branding image.

About the blurring, did you take note of the size reported by AddBrandingImage and used it?

Another license page could be achived by using InstallOptions.

Did I miss any question? I hope not 😁
Zaraza#
Will all of this development going on (which is great), I think it's time to get yourself a proper project page on Sourceforge.net!

BTW, I'm working on adding NSIS syntax highlighting support to the wonderful JEdit 4.0 text editor, so even 1 more tool with support NSIS. Hope to make it available soon.
kichik#
Hmm... That could be a good idea, this way I won't bug Sunjammer so much anymore 😁 I am sure he will be glad not to upload 3 versions everyday 😉

Signing up now...
Joost Verburg#
Originally posted by kichik
OK, here is what I will do. I will add an option to load anohter dialog resource instead of the default dialog.
Without size limitations or margins? Great! 😁
SmartyMan#
Re: Re: Possible Problem?

Of course, because File does not overwrite the temp file by default. You should use something like this
Of cource i have proofed that there was no file with this name in my temp dir before i started the installer

Hard coding a temp file name is not good, because the file has to be unique.
This is correct, but which other options i have to spot the reason for the effect (0 bytes files) and to make the code work?
The posting was ment as a report with maximum possible accuracy, to make it easier for the readers to find out whats going on.

The branding image has to be included when the installer is compiled, so you cannot use variables in the file name.
Please read the docs and/or take a look into gfx.nsi and then correct yourself 😉
SmartyMan#
I will add an option to load another dialog resource instead of the default dialog
So I can design the dialogs using the VisualStudio Resource-Editor and then copy the .rc file into my installation?
Whow, that would be very impressing - but you can make me also happy with changing the syntax of AddBrandingImage by adding options
/center (-> SS_CENTERIMAGE|SS_REALSIZEIMAGE)
/nomargins (-> MoveWindow(0,0,..) instead of MoveWindow(12,10,...))
/border (-> SS_SUNKEN) 🙂

About the blurring, did you take note of the size reported by AddBrandingImage and used it?
I use /V3 when starting makeNSIS, so I didnt saw this info (OK, I had not seen it even w/o the /V option because of the text masses produced by the compiler 😉
Your suggestion was correct, the width prompted by AddBrandingImage differed by 1 pixel from the width of the image; I have fixed that and the result is OK now - thanks 🙂

Another license page could be achived by using InstallOptions.
Have I missed something?
With InstallOptions, I can create a RichEditCtrl object and will be able to make it load a .rtf?
I dont think so 😉
Joost Verburg#
Of cource i have proofed that there was no file with this name in my temp dir before i started the installer
GetTempFileName creates a 0-byte temp file, so you should SetOverwrite On before using the File command, because this 0-byte file needs to be overwritten.
kichik#
So I can design the dialogs using the VisualStudio Resource-Editor and then copy the .rc file into my installation?
I was thinking more at the direction of making it editable with Resource Hacker so everyone can edit it, not only people who have VC...
Joost Verburg#
Re: Re: Re: Possible Problem?

Originally posted by SmartyMan

Please read the docs and/or take a look into gfx.nsi and then correct yourself 😉
I have not tried this feature yet 😁 I'll wait for the merge of 1.99 and 2.0a1 and the other changes.

So you should extract the files first and use than use SetBrandingImage? That's good, because different branding images on different pages will work better using this method.
SmartyMan#
Originally posted by Joost Verburg

GetTempFileName creates a 0-byte temp file, so you should SetOverwrite On before using the File command, because this 0-byte file needs to be overwritten.
If the overwrite flag is the reason, why does the gfx.nsi work?
But OK, I will try this, thanks anyway.
SmartyMan#
Originally posted by kichik


I was thinking more at the direction of making it editable with Resource Hacker so everyone can edit it, not only people who have VC...
Hm, so we have to do this work again and again, anytime we compile a new installer?
In this case, I would prefer the mentioned options for AddBrandingImage 😉
Joost Verburg#
Originally posted by SmartyMan

If the overwrite flag is the reason, why does the gfx.nsi work?
But OK, I will try this, thanks anyway.
I had the same problems using GetTempFileName, so I guess this will work.
kichik#
The problem doesn't occour in gfx.nsi because I left SetOverwrite to the default value which is on. If you changed the overwrite setting to anything else anywhere in your script to no or ifnewer it just won't work.

Hm, so we have to do this work again and again, anytime we compile a new installer?
In this case, I would prefer the mentioned options for AddBrandingImage
Nope, you will just have to add a line such as 'ChangeUI "${NSISDIR}\Contrib\UIs\LeftBI.exe"' to your script.
Joost Verburg#
So you are planning the use compiled Win32 resource files (.res) which can be edited with ResHack?