Skip to content
⌘ NSIS Forum Archive

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

136 posts

mlbl#
I've made a small UI. This is simply a modified version by moving around some of the buttons and text around so that it looks different.
RIV@NVX#
I just can't add branding image to installer. Can someone write that part of code for me for NSIS 2.0a2 and post it in the forum? Tried macros, every suggestion, but image just doesn't show up.
rainwater#
I noticed using reshacker that nsis does not respect the size you give the 1018 control. You should document the minimum height/width so people understand they can't make that control too small.
SmartyMan#
Originally posted by kichik
I have finished merging 1.99 with 2.0a1
Great, Ive downloaded and tested it a bit, here are some notes:

I really love the new license page using a RichEditCtrl and clickable URLs, great work 🙂

-------------

You said that I will get "my style" of branding images with the next update using ChangeUI and ResHacker, so here is what I have tried:

1. ChangeUI "...ui.exe", No AddBrandingImage, SetBrandingImage in .onNextPage
--> Height is adjusted correct, Width is adjusted incorrect, other controls are not moved out of the way (see branding1.png)

2. ChangeUI "...ui.exe", AddBrandingImage top 65, SetBrandingImage in .onNextPage
--> Selfmade control will not be used (you can see it on bottom of the branding image in branding2.png)

So how will I get the desired result (no margins, sunken border)?
Do I really have to create an own hand-sized ui.exe for every installer?

-------------

The strings "Extract", "Output directory" etc in the details-view cant be changed (e.g. for a german translation); I really would like to see some commands for that in one of your next updates.
BTW: if you need assistance for a build in german text collection, just ask me 🙂

-------------

At my first atempt to use the new SetCompressor command I got this:

Error: can't change compressor after data already got compressed or header already changed!
Error in script "G:\Programme\NSIS\NSISplus\NSISplus.nsi" on line 1 -- aborting creation process

The reason was the file nsisconf.nsi (included automatically by makeNSIS) because I had some definitions there that are the same for all my installers (checkbox icons etc).
I like the idea of having only one compiler exe, but maybe you should add a command line option for choosing the compressor, because otherwise the nsisconf.nsi is nearly useless.

-------------

When you published the V1.99, makensis.htm contained documentation of all the new features you builded in; the one that came with V2.0a2 doesnt, but you will update the docs soon, wont you?
kichik#
RIV@NVX, please send in your code so I can look at it and see what's wrong.

rainwater, like I have said in one of my earlier posts: "It is recommended that you don't resize the middle rect."

SmartyMan, if you use your own UI you should move the controls your self using Resource Hacker. ChangeUI doesn't move them for you. To set the branding image for other than the default image control you need to specify the /IMGID= switch for SetBrandingImage.

I am working on the multilingual option for NSIS, and every string (log included? please give your opinion here) will be changable.

A command line switch to compile using bzip2 is /X"SetCompressor bzip2".

The documents are updated, I don't understand what you are talking about.
RIV@NVX#
XPStyle On
SetFont "Tahoma" 8
AddBrandingImage "Top" 167
!packhdr "DMX.dat" "C:\UPX\upx.exe --best --force --crp-ms=100000 DMX.dat"
!include "C:\Program Files\NSIS\Examples\branding.nsh"

;BGGradient Format ColorUp ColorDown InstallTitle (RRGGBB) Hex
;InstallColors Format Foreground Background (RRGGBB) Hex
BGGradient 00FF00 0000FF 505050
InstallColors 00FF00 000000
InstProgressFlags smooth colored

Function .onInit
SetOutPath "$TEMP"
File /oname=spltmp.bmp "splash.bmp"
File /oname=spltmp.exe "C:\Program Files\NSIS\Bin\splash.exe"
ExecWait '$TEMP\spltmp.exe 5000 $HWNDPARENT $TEMP\spltmp'
Delete "$TEMP\spltmp.exe"
Delete "$TEMP\spltmp.bmp"
!insertmacro BI_INIT $2
FunctionEnd

!insertmacro BI_LIST
!insertmacro BI_LIST_ADD "splash.bmp"
!insertmacro BI_LIST_END

Function .onNextPage
!insertmacro BI_NEXT
FunctionEnd

Function .onPrevPage
!insertmacro BI_PREV
FunctionEnd


Function BrandImage
GetTempFileName $1
SetOverwrite On
File /oname=$1 "splash.bmp"
SetOverwrite Off
SetBrandingImage "/IMGID=0" "/RESIZETOFIT" $1
SectionEnd

I tried everything, i do not want to switch images, but I thought that it could work...
kichik#
If you want just one image you don't need any macro, all you need is:

Function .onNextPage
   StrCmp $R0 1 image_already_set; Don't use $R0 anywhere else!
      GetTempFileName $1
      SetOverwrite on
      File /oname=$1
      SetOverwrite off ; or what ever it was before
      SetBrandingImage /RESIZETOFIT $1
      Delete $1
   image_already_set:
FunctionEnd 
Also /IMGID=0 doesn't mean use default, it means use control ID 0, and it doesn't exist if you created the image control with AddBrandingImage.
RIV@NVX#
I just noticed a bug, not sure if anyone mentioned it exactly. If I use ChangeUI command with BZIP2 compression, makensis.exe crashes.
I use WinXP, no service packs.
mlbl#
Agreed. It does crash, but only if you use the command line to set the compressor as opposed to adding "SetCompressor bzip2" into your .nsi file.
kichik#
Thanks RIV@NVX, it was indeed a bug (forgot an equality sign in DialogTemplate.cpp). The crash occours if you change to a UI without a branding image. I have uploaded a fixed version to the CVS.
RIV@NVX#
Can I add image to uninstaller? Can I use the same code like before and what switches should I change?
kichik#
Because the installer and the uninstaller use the same UI, if you add an image to the installer the uninstaller will have one too. To set the image just add un before .onNextPage in the code I gave you above.