I'm looking for an way to prevent installing new versions into an different directory than an eventually existing one.
BTW NSIS has the same problem. If you run an setup with same version than the one installed, NSIS will allow you to change the installation destination. Which will leave the old installation without uninstalling.
I think hiding the the pages MUI_PAGE_DIRECTORY and MUI_PAGE_STARTMENU would be an reliable solution. But is this possible at all?
I found an script in this forum that should hide an startmenu page. Maybe this aproach could be used to hide/skip other pages as well. Unfortunately I don't understand what this script is doing although I'm a expericed C++ developer. Could someone explain it to me?
Thanks
//David
!define GetSectionSelection "!insertmacro GET_SECTION_SELECTION"
!macro GET_SECTION_SELECTION SECTION
Push $1
SectionGetFlags ${SECTION} $1
IntOp $1 $1 & 1
Exch $1
!macroend
[...]
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_PAGE_CUSTOMFUNCTION_PRE PreStartmenu
!insertmacro MUI_PAGE_STARTMENU "smid" $SMDIR
[...]
Section "$(lsSec_Startmenu)" siStartmenu
SectionEnd
[...]
Function PreStartmenu
${GetSectionSelection} ${siStartmenu}
Pop $0
StrCmp $0 0 0 +2
Abort
FunctionEnd