Archive: install options : page custom like a welcome page


install options : page custom like a welcome page
hello everybody...

I'm looking for anyone who would have tried to make himself a page custom which looks like exactly the same as a welcome or a finish page...

I couldn't do it, and I promise, I'm searching, and searching...



[Settings]
NumFields=3
Rect=1044
[Field 1]
Type=bitmap
Text=c:\install.bmp
Left=0
Right=109
Top=0
Bottom=193
[Field 2]
Type=label
Left=120
Right=315
Top=10
[Field 3]
Type=label
Left=120
Right=315




does not work
1) the bitmap does not appear...
2) the branding text is there, I don't know how to make him disappear
3) the backside color isn't white


any ideas ?

up :(


Use Modern UI?

-Stu :p


?

i'm already using modern UI

if you're telling me to use the MUI_UNPAGE_WELCOME

i've already tried...
And I couldn't add a field to the ioSpecial.ini...


I want to add to my welcome page some radiobuttons if a version of my software is already installed...
(I don't want to add a custom page after my welcome page, one click too much)

Well, I tried using the command MUI_WELCOMEFINISHPAGE_INI welcome.ini

I copied ioSpecial.ini to my welcome.ini
Changing the 3 fields of the welcome.ini works...
But I couldn't add fields...
And I want to :D
If somebody knows the solution to add a field to this ini file, this will solve my problem ;)


The MUI uses ioSpecial.ini to define the WELCOME and FINISH pages.

If you want to change these pages, you can either modify ioSpecial.ini at run time (before the page gets displayed) or you can use the MUI_WELCOMEFINISHPAGE_INI setting to make MUI use a different INI file at compile time.


yes pengyou

I have written that i've tried to do it, and i couldn't add a field to this ini file...


I don't understand what happens with the inifile and the command MUI_WELCOMEFINISHPAGE_INI

it is as if the fields had a predefined size... and you can't change it...

for example :

this ini :


[Settings]
NumFields=5
rect=1044
[Field 1]
Type=bitmap
Left=0
Right=109
Top=0
Bottom=193
Text=install.bmp
Flags=RESIZETOFIT
[Field 2]
Type=radiobutton
Left=120
Right=315
Top=50
Bottom=60
Text=blabla4
[Field 3]
Type=radiobutton
Left=120
Right=315
Top=90
Bottom=100
Text=blabla0
[Field 4]
Type=radiobutton
Text=blabla
Left=120
Right=315
Top=100
Bottom=110
[Field 5]
Type=radiobutton
Text=blabla2
Left=120
Right=315
Top=120
Bottom=130

this ini gives me the 4 radiobuttons if I use a custompage




but the same ini in the welcome.ini defined with :
!define MUI_WELCOMEFINISHPAGE_INI

gives me only one radiobutton

this is a bug :L

this is a bug
No, it is not a bug. When you use the MUI package you can choose various options for the WELCOME and FINISH pages, such as the MUI_WELCOMEPAGE_TITLE_3LINES, MUI_WELCOMEFINISHPAGE_BITMAP and MUI_FINISHPAGE_RUN settings. Some of these MUI settings make the MUI package alter the ioSpecial.ini file.

So if you want to make some changes to the WELCOME and FINISH pages, you need to make sure that your changes do not conflict with the changes made by the MUI package.

If you compile your script (without your extra changes) and run it then you can look at the ioSpecial.ini file in the TEMP folder to see what the MUI package has done (e.g. how many fields are present, what are their sizes, etc). Then you can work out how to add your extra fields and update your script.

Another way to find out what the MUI package will do to ioSpecial.ini is to look at the MUI source code, but looking at the actual ioSpecial.ini used when running your installer is probably easier to do.

yes I know this is not a bug... just a sort of

"you can't do anything that you want ;) "

I'll have a look at it...


x


x


I'm sorry, but I think this acts like a bug...

i do :
!define MUI_WELCOMEFINISHPAGE_INI welcome.ini
this is what happens in my temp folder :

"welcome code"

[Settings]
Rect=1044
NumFields=5
RTL=0
NextButtonText=
CancelEnabled=
[Field 1]
Type=bitmap
Left=0
Right=109
Top=0
Bottom=193
Flags=RESIZETOFIT
Text=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nseBF.tmp\modern-wizard.bmp
[Field 2]
Type=label
Left=120
Right=315
Top=10
Text=Bienvenue dans le programme d'installation de K!TV
Bottom=38
[Field 3]
Type=label
Left=120
Right=315
Top=45
Bottom=150
Text=bla
[Field 4]
Type=radiobutton
Text=blabla
Left=120
Right=315
Top=150
Bottom=160
[Field 5]
Type=radiobutton
Text=blabla2
Left=120
Right=315
Top=160
Bottom=170



and the page appears wrong...
I have a look at "iospecial.ini" in the temps folder :

[Settings]
Rect=1044
NumFields=3
RTL=0
NextButtonText=
CancelEnabled=
[Field 1]
Type=bitmap
Left=0
Right=109
Top=0
Bottom=193
Flags=RESIZETOFIT
Text=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nssC3.tmp\modern-wizard.bmp
[Field 2]
Type=label
Left=120
Right=315
Top=10
Text=test
Bottom=38
[Field 3]
Type=label
Left=120
Right=315
Top=45
Bottom=185
Text=test2
[Field 4]
Type=radiobutton
Text=blabla
Left=120
Right=315
Top=150
Bottom=160
[Field 5]
Type=radiobutton
Text=blabla2
Left=120
Right=315
Top=160
Bottom=170


why is the [Field 3] "bottom" value modified ???

'm sorry, but I think this acts like a bug...
As I explained earlier, the MUI package will change the ioSpecial.ini file at run time. So your script needs to take these changes into account. The MUI package only uses 3 fields for the WELCOME page so it adjusts ioSpecial.ini to use only 3 fields, as you found out.

There is more than one way to do what you want. Here is one way:

(a) let MUI use the default ioSpecial.ini file (do not use MUI_WELCOMEFINISHPAGE_INI in your script)

(b) use the WELCOME page PRE function to add the two radio buttons to ioSpecial.ini

(c) use the WELCOME page SHOW function to make the two radio buttons use the same background as the rest of the page

and here is some code to do this:
!define MUI_PAGE_CUSTOMFUNCTION_PRE   "add_radio_buttons"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW "fix_background_color"

!insertmacro MUI_PAGE_WELCOME

...
...

Function add_radio_buttons

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "NumFields" "5"

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "150"

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Type" "radiobutton"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Text" "blabla"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Left" "120"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Right" "315"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "150"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "160"

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Type" "radiobutton"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Text" "blabla"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Left" "120"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Right" "315"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Top" "160"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Bottom" "170"

FunctionEnd

Function fix_background_color
Push $0

GetDlgItem $0 $MUI_HWND 1203
SetCtlColors $0 "" "FFFFFF"
GetDlgItem $0 $MUI_HWND 1204
SetCtlColors $0 "" "FFFFFF"

Pop $0
FunctionEnd

I really have to thank you

I try it this evening and come back to thank you...

want a kiss ? :D


it works fine


really, really, thank you pengyou

:love:


hello, I'm back...

I have done what you said, pengyou, and it works... that means it is well displayed...
but I can't read the checkbox value, and I don't know where I'm wrong...


this is my code :




;page finish
!define MUI_PAGE_CUSTOMFUNCTION_PRE "un.add_shortcuts_finishpage"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW "un.fix_background_color"
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE "un.finishpage"
!define MUI_FINISHPAGE_TITLE "$MUI_FINISHPAGE_TITLE"
!define MUI_FINISHPAGE_TEXT "$MUI_FINISHPAGE_TEXT"


;page de fin de désinstallation
!insertmacro MUI_UNPAGE_FINISH



and then I want to read the checkbox value of the 6th field...
the function that does not work :

Function un.finishpage

ReadINIStr $R0 "$TEMP\ioSpecial.ini" "Field 6" "State"
StrCpy $R0 $R0
StrCmp $R0 "1" shortcut end
shortcut:
CreateShortcut "$DESKTOP\K!TV.lnk" "$INSTDIR\K!TV.exe" "" "$INSTDIR\K!TV.exe" "" "" "" "$(desktv)"
goto end
end:


FunctionEnd


the command createshortcut works fine outside the readinistr, etc...

but this command is not called in this function, i can't read a "1" value to the state of my 6th field...


why ?

is it because of my function called by MUI_CUSTOMFUNCTION_LEAVE ?

and what else can I do ?

ioSpecial.ini will be in $PLUGINSDIR not $TEMP.

-Stu


arf

thanks it works now lol


I found it on my hard drive on a "temp" directory...
I couldn't know this directory called temp was the pluginsdir directory :D




thank you...


$PLUGINSDIR is a randomly generated folder inside the $TEMP folder called "nsxxxx.tmp".

-Stu


hello I encountered some problem with the page created like pengyou said...

(with this sort of code :

!define MUI_PAGE_CUSTOMFUNCTION_PRE "un.add_radio_buttons"

and

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "NumFields" "5"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" "150"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Type" "radiobutton"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Text" "$(reinstktv)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Left" "120"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Right" "315"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "120"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "130"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "State" "1"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Type" "radiobutton"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Text" "$(uninstktv)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Left" "120"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Right" "315"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Top" "140"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Bottom" "150"


I have some clipping :L
Seems to be a display bug :L
when I'm hiding the window, and make it come back, the radiobuttons have disappeared and I must put my mouse on it in order to they reappear...


why why why... don't know...

any ideas ?

problem solved... my bottom value for the third field wasn't correct...


dumb am I :D