Archive: trouble disabling some buttons


trouble disabling some buttons
I am creating an auto-installer which is designed to operate without user interaction. I want to make it so the user can cancel on any page, but cannot hit the next or back buttons. I've been successful at disabling the Back button for all of the pages, and the next button for 4/7 of the pages. I can't seem to disable the "I agree" button for the License page, the "Install" button on the Start Menu Folder page, or the "Next" button on the directory page. Some of the relevent code is copied below. I have also tried many other control ID's, but havent had any success. I tried Resource Hacker and AutoIt as well... any ideas?

from code:
; License page
!define MUI_PAGE_CUSTOMFUNCTION_Pre License_PrePage
!define MUI_PAGE_CUSTOMFUNCTION_SHOW SkipPage
!insertmacro MUI_PAGE_LICENSE "..."

...
; Directory page
!define MUI_PAGE_CUSTOMFUNCTION_Pre Directory_PrePage
!define MUI_PAGE_CUSTOMFUNCTION_SHOW SkipPage
!insertmacro MUI_PAGE_DIRECTORY

...
; Start Menu page
!define MUI_PAGE_CUSTOMFUNCTION_Pre StartMenu_PrePage
!define MUI_PAGE_CUSTOMFUNCTION_SHOW SkipPage
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP

...


Function License_PrePage
StrCmp $AutoInstall "true" 0 end
StrCpy $R5 "250"

GetDlgItem $4 $HWNDPARENT 1
EnableWindow $4 0
GetDlgItem $4 $HWNDPARENT 3
EnableWindow $4 0

end:
FunctionEnd

...

Function Directory_PrePage
StrCmp $AutoInstall "true" 0 end
StrCpy $R5 "250"

GetDlgItem $4 $HWNDPARENT 1
EnableWindow $4 0
GetDlgItem $4 $HWNDPARENT 3
EnableWindow $4 0
end:
FunctionEnd

...

Function StartMenu_PrePage
StrCmp $AutoInstall "true" 0 end
StrCpy $R5 "250"

GetDlgItem $4 $HWNDPARENT 1
EnableWindow $4 0
GetDlgItem $4 $HWNDPARENT 3
EnableWindow $4 0

end:
FunctionEnd

Any help would be greatly appreciated!


...Shouldn't button disabling be in the SHOW function, and skipping in the PRE function?

And why on earth would you want to disable the I Agree button on the license page? You don't want people to agree to your license? o_O


Originally posted by MSG
...Shouldn't button disabling be in the SHOW function, and skipping in the PRE function?

And why on earth would you want to disable the I Agree button on the license page? You don't want people to agree to your license? o_O
It's not that we dont want them to agree to the license, we just dont want them to have a choice :) The installer is going to be included inside another installer, so they will be agreeing to the license implicitly.

And as for the PRE vs. SHOW function, conventionally you are right, but it shouldnt matter in terms of how the program works in this case. I went ahead and made the switch anyway though :D

the controls on a page are not yet created in the pre callback.

use the .onVerifyInstDir callback for the directory page


Thanks guys! Using skip page in PRE and disabling in SHOW did the trick for the license and start menu pages, and aborting in .onVerifyInstDir worked for the directory page