Archive: Reading radio buffons


Reading radio buffons
Ok I have got it to where when I read the radio button I use.

$3 is the radio button

ReadINIStr $3 "$PLUGINSDIR\ServerIP.ini" "Field 4" "State"
${if} $3 == 1 then the rest of my code

but the code after it dose not run if it is checked... any advise?


Make sure you're using that code in the pages' Leave function.

-Stu


it is in a function but I am not sure what you mean by leave function... I'll put my code up so you can see how I have it now.


Function IconPage

!insertmacro MUI_HEADER_TEXT "Choose an Icon" "From the selection below"


!insertmacro MUI_INSTALLOPTIONS_EXTRACT "iconPage.ini"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "iconPage.ini"

ReadINIStr $3 "$PLUGINSDIR\ServerIP.ini" "Field 4" "State"
ReadINIStr $4 "$PLUGINSDIR\ServerIP.ini" "Field 3" "State"
ReadINIStr $5 "$PLUGINSDIR\ServerIP.ini" "Field 1" "State"

${If} $3 == 1
Push iw.gif #text to be replaced
Push iw.gif #replace with
Push all #replace all occurrences
Push all #replace all occurrences
Push "$DESKTOP\dashboard.properties" #file to replace in
Call AdvReplaceInFile
${EndIf}

${If} $4 == 1
Push iw.gif #text to be replaced
Push pw.gif #replace with
Push all #replace all occurrences
Push all #replace all occurrences
Push "$DESKTOP\dashboard.properties" #file to replace in
Call AdvReplaceInFile
${EndIf}

${If} $5 == 1
Push iw.gif #text to be replaced
Push fpis.gif #replace with
Push all #replace all occurrences
Push all #replace all occurrences
Push "$DESKTOP\dashboard.properties" #file to replace in
Call AdvReplaceInFile
${EndIf}


FunctionEnd


Page Custom ShowFunction LeaveFunction

-Stu


Ok I changed my code with show and leave functions and it is the same as before... I can see it but if any of the radio buttons are clicked it dosen't run the code in the if statements.

here is my code that I have changed


;Icon Chooser Page-----------------------------------
Function ShowIconPage

!insertmacro MUI_HEADER_TEXT "Choose an Icon" "From the selection below"


!insertmacro MUI_INSTALLOPTIONS_EXTRACT "iconPage.ini"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "iconPage.ini"

FunctionEnd
;----------------------------------------------------
;----------------------------------------------------
Function LeaveIconPage

ReadINIStr $3 "$PLUGINSDIR\ServerIP.ini" "Field 4" "State"
ReadINIStr $4 "$PLUGINSDIR\ServerIP.ini" "Field 3" "State"
ReadINIStr $5 "$PLUGINSDIR\ServerIP.ini" "Field 1" "State"

${If} $3 == 1
Push iw.gif #text to be replaced
Push iw.gif #replace with
Push all #replace all occurrences
Push all #replace all occurrences
Push "$DESKTOP\dashboard.properties" #file to replace in
Call AdvReplaceInFile
${EndIf}

${If} $4 == 1
Push iw.gif #text to be replaced
Push pw.gif #replace with
Push all #replace all occurrences
Push all #replace all occurrences
Push "$DESKTOP\dashboard.properties" #file to replace in
Call AdvReplaceInFile
${EndIf}

${If} $5 == 1
Push iw.gif #text to be replaced
Push fpis.gif #replace with
Push all #replace all occurrences
Push all #replace all occurrences
Push "$DESKTOP\dashboard.properties" #file to replace in
Call AdvReplaceInFile
${EndIf}


FunctionEnd
;-----------------------------------------------------


You're displaying iconPage.ini yet reading results from ServerIP.ini?

-Stu


Oh crap... Well I guess that is my problems. I was really wondering what the heck I was doing wrong, I must have copied and pasted then forgot about changing the code. Thanks for pointing that out. I am going to make sure I check all my code for stupid mistakes before I post next time lol.