You have to change some functions related to the finish page. Put the code below before inserting the macro MUI_PAGE_FINISH:
!define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT InitFinishPage
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ShowFinishPage
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveFinishPage
The first define is the secret behind the checkbox insertion. "InitFinishPage" is the function to be called when the InstallOptions INI file for the page is written.
Just one more piece of information: The INI file for the page is called "iospecial.ini" and it's located in the $PLUGINSDIR. Also, this page contains 5 controls (with all the options you specified), so all you need to do in this function is:
Function InitFinishPage
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "NumFields" "6"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Type" "CheckBox"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Left" "120"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Right" "315"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Top" "160"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "Right" "170"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 6" "State" "0"
;line above: Initial state of the control: 0=Unchecked, 1=Checked
FunctionEnd
There are still things missing. There is still no repainting of the background of the control to the color white. This you'll do in the "ShowFinishPage" of the page:
Function ShowFinishPage
GetDlgItem $MUI_TEMP1 $MUI_HWND 1205 ;ID for the 6th InstallOptions control
SetCtlColors $MUI_TEMP1 "" "${MUI_BGCOLOR}"
FunctionEnd
The "${MUI_BGCOLOR}" define is the background color of the page, which will be set to white by default. The $MUI_TEMP1 variable is a Modern UI temporary variable, which can be changed if you want to. Also, the $MUI_HWND variable holds the dialog handle for the InstallOptions page, needed for the
GetDlgItem to detect the item and paint the background.
One last thing: You need to verify the state of the CheckBox before going out of the page. To do that, use the "LeaveFinishPage" function:
Function LeaveFinishPage
!insertmacro MUI_INSTALLOPTIONS_READ $MUI_TEMP1 "ioSpecial.ini" "Field 6" "State"
StrCmp $MUI_TEMP1 1 Checked Unchecked
Checked:
;Put your code for when the checkbox is checked here
Goto end
Unchecked:
;Put your code for when the checkbox is unchecked here
end:
FunctionEnd
Put the codes to execute when the checkbox is unchecked or checked and all done!
You may have noted the use of !insertmacro MUI_INSTALLOPTIONS_WRITE and !insertmacro MUI_INSTALLOPTIONS_READ. Those are replacements for WriteINIFile and ReadINIFile respectively. The difference is that the file "iospecial.ini" is in $PLUGINSDIR, and these macros write/read only to/from files inside $PLUGINSDIR, so they are made for this occasion.
I didn't test those codes. If they don't work, at least I showed my point...
(EDIT: Just for curiosity, what did you create for Age of Empires? Or are you trying to put back old utilities for it? Hmmm...)