Archive: Dynamically Page Loading


Dynamically Page Loading
Hello,

I only want to insert a MUI_PAGE if a registry entry is set.

My idea was to proof the registry entry in the .onInit:

Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "installer.ini"
!insertmacro MUI_LANGDLL_DISPLAY
ReadRegDWORD $R0 HKLM "ddd\example" "Version"
StrCmp $R0 "" nothing goon
nothing:
!define SHOW_PAGE_XYZ "bla"
goon:
FunctionEnd

At the beginninng of the script i'm checking the variable SHOW_PAGE_XYZ like this

!ifdef SHOW_PAGE_XYZ
!insertmacro MUI_PAGE_XYZ
!endif

But it's not working.

Can someone help me please?

Thanks,
shavo


You are confusing compile time and run time. You can skip the page by calling Abort in its PRE function.

Stu


And how does it work by using !insertmacro MUI_PAGE_DIRECTORY ?


If you looked in the Modern UI docs you'd find out.


!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPagePre
!insertmacro MUI_PAGE_DIRECTORY

Function DirectoryPagePre

ReadRegDWORD $R0 HKLM "ddd\example" "Version"
${If} $R0 == ``
Abort
${EndIf}

FunctionEnd


Stu