Archive: Another modifed Modern UI with image control


Another modifed Modern UI with image control
Hello all !

Yet another modified ModernUI based on the dimensions of some software (you'll get it from the name :), *PROBABLY* made using WISE classic.

Thats is not so important, anyway... :)

How to use the modified UI.

1. Just download the attached zip.
2. Extract the EXE in any directory (preferably "$NSISDIR\Contrib\UIs")
3. In your script use the following command:

---
.
.
.
ChangeUI all "${NSISDIR}\Contrib\UIs\modern_eraser.exe"
.
.
.
---

4. If you extract it somewhere else, modify the path to the EXE accordingly.
5. That's it ! Enjoy :up:

=-=-= Question =-=-=
I have added an image control (SS_BITMAP) in which the user can keep showing image/images as per his her wish !

The control ID of the image control is 6666.

I will be searching the forum...still...could anyone point me to the relevant topic of how to set the image immmediately after the WELCOME page.


I searched the forums, still... :(
I searched the forums, and kept coming up with "custom .onGUIInit function". Would this solve my problem ?

Please help !

Thanks.


Hi :)

Actually this function won't solve your problem as the function .onGUIInit is called *before* the Welcome page's display, and not *after*...

Unfortunately I don't have the answer to your question :(

Hope you'll find a way... :D

evilO/Olive


You should do it in the show function of the next installer page. If you need any help with the right instructions to display the image check out my MUI mod, see the link below.

Vytautas


where do i have to write that line "changeIU..." ?

i wrote it in my script and i can't see any diference.


It shold be used at the start of the script, before page commands. Also if using MUI you should define MUI_UI rather than use the Change UI setting.

Vytautas


is there a better method
after fiddling with many small snippets of codes from many different users I got a working script...

Please note :D could be a colon followed by a capital 'd'
----
.
.
.
!include "${NSISDIR}\Include\WinMessages.nsh"
.
.
.
!define LR_LOADFROMFILE 0x0010
!define LR_LOADREALSIZE 0xF7FF
!define LR_CREATEDIBSECTION 0x2000
!define STM_SETIMAGE 370
!define IMAGE_BITMAP 0
!define sysLoadImage "user32::LoadImageA(i, t, i, i, i, i) i"
!define sysDeleteObject "gdi32:DeleteObject(i) i"
.
.
.

!define MUI_CUSTOMFUNCTION_GUIINIT MyCustomFunction
!define MUI_CUSTOMFUNCTION_UNGUIINIT un.MyCustomFunction


Function MyCustomFunction
Push $0
Push $1
Push $6

GetTempFileName $0
File /oname=$0 "Setup.bmp"

GetDlgItem $1 $HWNDPARENT 6666

System::Call '${sysLoadImage} (0, "$0", ${IMAGE_BITMAP}, 135, 200, ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE} ) .r6'
SendMessage $1 ${STM_SETIMAGE} ${IMAGE_BITMAP} $6

Pop $6
Pop $1
Pop $0
FunctionEnd


Function un.MyCustomFunction
Push $0
Push $1
Push $6

GetTempFileName $0
File /oname=$0 "Uninstall.bmp"

GetDlgItem $1 $HWNDPARENT 6666

System::Call '${sysLoadImage} (0, "$0", ${IMAGE_BITMAP}, 128, 200, ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE} ) .r6'
SendMessage $1 ${STM_SETIMAGE} ${IMAGE_BITMAP} $6

Pop $6
Pop $1
Pop $0
FunctionEnd

---

The approximate size of the bmp should be somewhere around 135x200.

In the API call we HAVE to specify the dimensions in which we want to display the bmp.

P.S. aaaarrrgh, Idon't like this :) I actually waded through the macros and made myself understand the custom .onGUIInit macro. Ack !!! :)


Originally posted by Vytautas
It shold be used at the start of the script, before page commands. Also if using MUI you should define MUI_UI rather than use the Change UI setting.

Vytautas
sorry, but it seems that i'm doing something wrong. if i write "ChangeUI ..." - no diference. if i write "!define MUI_UI all 'file.exe'" - i get an error - too many parameters. if i write "!define MUI_UI 'file.exe'" - the size of the installer is the same, only some controls are smaller.

i wrote the line before page commands. i am using NSIS v2.0 and modern UI.

thanks.

I use this command and it works for me, in my MUI mod.

!define MUI_UI "${NSISDIR}\Contrib\UIs\modern_instpic.exe"
Are you sure that the installer is supposed to look very different?

Vytautas

PS. BTW Which page are you trying to display the image in?

full (sample) working script
The attached script is a sample full working script. :)

Please change the BMP and ICON paths for your system. :)

Most of the script is half-cooked, anyway...tell me if you run into any problems.
- Enjoy