Archive: No Window Icon Decoration on Install Pages


No Window Icon Decoration on Install Pages
Is there any way to not display the icon/decoration on the upper left of the installer window pages *without* effecting the icon used for the actual installer and uninstaller?

From what I've gathered these are one in the same.


If you are not using the Modern UI, WindowIcon is what you're looking for. If you are using the Modern UI, you can use an empty picture instead. Have a look at MUI_HEADERIMAGE and MUI_HEADERIMAGE_BITMAP.


I'm using the headerimage to decorate the actual window masthead area. That's not my issue.

The issue is the icon decoration in the upper left of the window (not the headerimage-- the icon, see "II" in crude ascii art below) always appears to be a scaled down version of the installer/uninstaller icon.

+------- - - - -
| II - Title bar description...
+------- - - - -
|
| HEADERIMAGE
|

I want to NOT display the icon during the install, but obviously still want an icon assigned to the installer/uninstaller.

Make sense?


In that case, you have two options. Either cause Windows to display a different icon in Explorer by adding another icon resource, or cause NSIS to display another icon by setting a different one to the window.

To add another icon resource, execute Resource Hacker using !packhdr as demonstrated in the Wiki. Make sure you give the new icon an identifier lower than 100 so it'd come first and Explorer will use it instead of the usual icon.

To make NSIS use another icon, use LoadImage to load another image and then call SetClassLong to set the new icon.

StrCpy $0 "new image handle here"
!define GCL_HICON -14
System::Call user32::SetClassLong(i$HWNDPARENT,i${GCL_HICON},i$0)
The loaded image can be another resource added in the same method described above, or an icon extracted and loaded using different parameters passed to LoadImage. In either case, a code that should get you started is in the example linked above.

Thank you for the awesome advice.

I did review the Wiki page before posting this, however.

What I am trying to do is *remove* the icon from the installer window without effecting the installer/uninstaller program icon.

I can certainly use the above outlined technique and use a "blank" icon, but our creative team is really looking to not have that empty space, and I'm trying to be as accommodating as possible.

So any advice on actually removing the installer window icon decoration?


I'm not sure I understand what you are asking for, you say you want to remove the icon, but don't want an empty space?

I can certainly use the above outlined technique and use a "blank" icon, but our creative team is really looking to not have that empty space
The icon can be removed by removing the WS_SYSMENU style from the dialog window. If you do that, the icon goes away, along with the three controls on the right side of the title bar: minimize, maximize, and close. The program title will shift left when you do this. Is that the empty space you didn't want?
!define MUI_CUSTOMFUNCTION_GUIINIT ClrSysMenu
Function ClrSysMenu
!define WS_SYSMENU 0x80000
StrCpy $0 $HWNDPARENT
System::Call 'user32::GetWindowLong(i r0,i -16)i.r1'
IntOp $2 ${WS_SYSMENU} ~
IntOp $1 $1 & $2
System::Call 'user32::SetWindowLong(i r0,i -16,i r1)'
FunctionEnd
Don

This should do it! Thanks-- I'll try soon.

The "whitespace" I was referring to would be the space that shows up if I use a blank icon.

Removing all the decorations should be a good solution.

Once it works I'll try to put up a wiki page!