Skip to content
⌘ NSIS Forum Archive

Cannot get a web page to launch

7 posts

jholovacs#

Cannot get a web page to launch

I have an installer that creates a self-hosted configuration page at http://localhost:5000.

I want the configuration page to launch after installing and starting the services, but for the life of me I cannot get this working.

I tried:


!define MUI_FINISHPAGE_SHOWREADME http://localhost:5000/
!define MUI_FINISHPAGE_LINK "Show the agent configuration screen"
I have tried:


!define MUI_FINISHPAGE_SHOWREADME http://localhost:5000/
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Launch Agent Configuration Page"
I have tried putting

!define MUI_FINISHPAGE_RUN_FUNCTION FinishedInstall

Function FinishedInstall
ExecShell "open" "http://localhost:5000/"
FunctionEnd
before my

!insertmacro MUI_PAGE_INSTFILES
...and none of these work. I don't get any errors; it's just like I didn't put anything at all. The text components show up, but the link never launches a browser with the link.

What am I doing wrong?
Anders#
ExecShell just calls ShellExecuteEx and this is the documented way to launch the default browser on Windows.
jholovacs#
Well, I can't get that to work with any of the MUI hooks, but if I put it at the end of my install section, at least it loads the page, which is good enough for me. Thanks!
Anders#
Maybe try to add a Sleep after ExecShell in the finish function.

I'll try to come up with some debugging code for you tomorrow.
Anders#
You could try
!define MUI_FINISHPAGE_RUN_FUNCTION FinishedInstall
Function FinishedInstall
  ClearErrors
  ExecShell "" "http://localhost:5000/"
  Sleep 3333
  ${If} ${Errors}
  MessageBox mb_iconstop Error
  ${EndIf}
FunctionEnd