Old 18th September 2018, 19:04   #1
jholovacs
Junior Member
 
Join Date: Sep 2018
Posts: 4
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:

code:

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



I have tried:

code:

!define MUI_FINISHPAGE_SHOWREADME http://localhost:5000/
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Launch Agent Configuration Page"



I have tried putting
code:

!define MUI_FINISHPAGE_RUN_FUNCTION FinishedInstall

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



before my
code:

!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?
jholovacs is offline   Reply With Quote
Old 18th September 2018, 20:07   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,915
Does
PHP Code:
ExecShell "" "http://localhost:5000/" 
work?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 18th September 2018, 21:35   #3
jholovacs
Junior Member
 
Join Date: Sep 2018
Posts: 4
I will try it when I get back in the office and let you know.
jholovacs is offline   Reply With Quote
Old 18th September 2018, 23:42   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,915
ExecShell just calls ShellExecuteEx and this is the documented way to launch the default browser on Windows.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 19th September 2018, 11:55   #5
jholovacs
Junior Member
 
Join Date: Sep 2018
Posts: 4
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!
jholovacs is offline   Reply With Quote
Old 20th September 2018, 03:07   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,915
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 23rd September 2018, 22:03   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,915
You could try
PHP Code:
!define MUI_FINISHPAGE_RUN_FUNCTION FinishedInstall

Function FinishedInstall
  ClearErrors
  ExecShell 
"" "http://localhost:5000/"
  
Sleep 3333
  
${If} ${Errors}
  
MessageBox mb_iconstop Error
  
${EndIf}
FunctionEnd 

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump