Archive: installation folder name length


installation folder name length
while installing if a user specifies installation folder by manually typing in the address bar and makes it more than 220 characters then installation is having problems.

the software is not getting installed properly.

any idea on how do i check the installtion folder length or the installation path length.

any help is highly appreciated.


In either the directory's leave function or in the .onVerifyInstDir function (whichever way you chose to implement it), add a check for the length of $INSTDIR

Example (using LogicLib):

StrLen $0 "$INSTDIR"
${If} $0 > 220
MessageBox MB_OK "Installation path must be under 220 characters"
abort
${EndIf}

thanks bro.

it solved my problem.

also i used the following macro

!define MUI_PAGE_CUSTOMFUNCTION_LEAVE "DirectoryLeave"

and then

Function DirectoryLeave
StrLen $0 "$INSTDIR"
${If} $0 > 200
MessageBox MB_OK "Invalid Directory."
abort
${EndIf}
FunctionEnd