Archive: Disable MUI_PAGE_DIRECTORY on runtime?


Disable MUI_PAGE_DIRECTORY on runtime?
Hello

I made an installer that checks in the function .onInit if its the first installation or not (update). If its an update, i want to change the title of the MUI_PAGE_WELCOME and the MUI_PAGE_DIRECTORY should not appear. Here's some code:

Function .onInit
ReadRegStr $0 HKLM "Software\${APPNAME}" ""
StrCmp $0 "" firstinstall 0
;change title of MUI_PAGE_WELCOME
;disable MUI_PAGE_DIRECTORY?
firstinstall:
FunctionEnd

Is there any easy way to realize this?

Thanks!


You may want to take a look here,

http://nsis.sourceforge.net/Demonstr...Pre_Show_Leave


Thx a lot. This helped me. Here is my solution:


...
!define MUI_PAGE_CUSTOMFUNCTION_PRE wel_pre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW wel_show
!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_PRE dir_pre
!insertmacro MUI_PAGE_DIRECTORY
...

Function wel_pre
StrCmp $isUpdate "0" noUpdInfo
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Settings" "NumFields" "4"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 4" "Type" "Label"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 4" "Top" "140"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 4" "Bottom" "180"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 4" "Left" "120"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 4" "Right" "315"
WriteINIStr "$PLUGINSDIR\iospecial.ini" "Field 4" "Text" "Information: This is a Update!"

noUpdInfo:
FunctionEnd

Function wel_show
StrCmp $isUpdate "0" noUpdInfo
ReadIniStr $0 "$PLUGINSDIR\iospecial.ini" "Field 4" "HWND"
SetCtlColors $0 "0x000000" "0xFFFFFF"
noUpdInfo:
FunctionEnd

Function dir_pre
StrCmp $isUpdate "0" noabort
Abort
noabort:
FunctionEnd