Archive: Access to the installation directory error


Access to the installation directory error

!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShow
!insertmacro MUI_PAGE_DIRECTORY
Quote:
What error?

Function DirectoryShow
ReadRegStr $0 HKLM "SOFTWARE\ACD Systems\ACDSee\70" "InstallDir"
${If} $0 != ""
${FindLast} $1 $0 `ACDSee\7.0`
${If} $1 != ``
StrCpy $0 $0 $1 ;Access to the installation directory
FindWindow $1 "#32770" `` $HWNDPARENT
GetDlgItem $1 $1 1019
SendMessage $1 ${WM_SETTEXT} 0 "STR:$0" ;Sent to the directory selection dialog ${EndIf}
${EndIf}
FunctionEnd

You should simply modify $INSTDIR in .onInit instead of messing with the GUI in the show function.