Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Second Link on MUI Finish Page (http://forums.winamp.com/showthread.php?t=205926)

Jnuw 25th January 2005 18:41

Second Link on MUI Finish Page
 
I need to add a second link on the MUI Finish Page. I found some threads that say the only way other than a custom page is to add another field to the ioSpecial.ini file in the plugins dir.

I can easily add the link in a pre function before the finish page with a !insertmacro MUI_INSTALLOPTIONS_WRITE command, but i need the structure to be there first, like this:

[Field 5]
Type=Link
Left=10
Right=180
Top=126
Bottom=136
State=
Text=

Question #1: should i do it with the File command, like this?

FileOpen $5 $PLUGINSDIR\ioSpecial.ini a
FileSeek $5 0 END
FileWrite $5 "[Field 3]"
FileSeek $5 0 END
FileWrite $5 "Type=Link"
FileSeek $5 0 END
FileWrite $5 "Left=10"
FileSeek $5 0 END
yada yada yada...
FileClose $5


Question #2: I noticed that i do not need the flushini command on windows 98 when using the !insertmacro MUI_INSTALLOPTIONS_WRITE command, is the flush built into the macro, or am i just getting lucky?

Thanks.

superwan 25th January 2005 19:14

code:
!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


Jnuw 25th January 2005 21:24

superwan, thanks. Your saying that !insertmacro MUI_INSTALLOPTIONS_WRITE will create the entry if not currently present, right?

Anyone know about Question #2? Thanks all.

superwan 25th January 2005 23:14

I answer "yes" ;) for my question, just thank pengyou...

take care to the third field "bottom" value ;)

don't know the answer for your second question :p


see ya

Afrow UK 26th January 2005 10:02

You only need to use FlushINI before deleting the INI file. This removes the INI file data from Windows 9X memory.

-Stu

Jnuw 26th January 2005 14:58

Good to know, thanks.


All times are GMT. The time now is 04:43.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.