Archive: Show MUI_FINISHPAGE_RUN with condition


Show MUI_FINISHPAGE_RUN with condition
Hello,

I want to display this page with condition like this :

IfFileExists $INSTDIR\keep gotolaunch dontlaunch
gotolaunch:
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
dontlaunch:

But IfFileExist must be in a function ! I try this too


!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"

(...)

Function LaunchLink
IfFileExists $INSTDIR\keep gotolaunch dontlaunch
gotolaunch:
ExecShell "" "$DESKTOP\${PRODUCT_NAME}.lnk"
dontlaunch:
FunctionEnd


But the FINISHPAGE_RUN is display:(
Is there another solution ?
Thanks

You are confusing compiletime commands (!define etc) and runtime commands (IfFileExists etc). MUI page contents are determined at compiletime (hence the use of !defines), so you'll need to edit the page again at runtime. To do this, you can simply disable and hide the run elements (checkbox and label, I guess) in the finish page's SHOW function.

Note: The HWND of those elements are stored in variables like $mui_somethingorother. These variables are not documented, but you can find the proper ones if you look through MUI's finish page nsh file somewhere in the NSIS\Contrib folder (if I recall correctly).