icke_qps
Posts: 15
Joined: Thu Apr 25, 2019 10:26 am

Show HTML text when a Launch Condition fails

Hey,

I just recently started using Advanced Installer,. Before this our company used Visual Studio Deployment Projects to make installers.

In the VSDP Launch Conditions properties, I could set an 'InstallUrl' alongside a message as: 'The other needed package is not found. The installer can be found in the download section of our website. Press Yes to proceed to the site.'

Is this also possible in Advanced Installer?
Or can I show a neat HTML formatted message when a Launch condition fails?
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Show HTML text when a Launch Condition fails

Hi and welcome to Advanced Installer forums.

Thank you for your interest in Advanced Installer.

In order to display a message that can bring you to a website, you can use the "Display message box" and "Open URL" predefined custom actions from the "Custom Actions" page. A similar scenario is described in the "Custom Launch Condition Help" thread.

I'm afraid that displaying an HTML formatted message is not supported.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
icke_qps
Posts: 15
Joined: Thu Apr 25, 2019 10:26 am

Re: Show HTML text when a Launch Condition fails

Hi Eusebiu,
thanks or your reply! I got pretty far following the scenario that you linked: Custom Launch Condition Help.

When following the instructions from the linked post, I got to opening the dialog showing that something is missing. Then when 'Yes' is clicked, the browser will open, but the installer will continue. When No is clicked, the installer will continue as well.

My desired scenario is that:
  • there are 2 launch conditions that can fail; both should have their own help message and URL to follow.
  • when a launch condition fails, the user will be informed that another installation is missing, with 2 options:
    • Yes - Open the URL and abort the installer
    • No - Abort the installer
Would this be possible in any way?
Best Regards,
Peter
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Show HTML text when a Launch Condition fails

Hi Peter,

In order to abort the installer you can implement the solution described in the "how to Abort the Install on message box response" thread.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
icke_qps
Posts: 15
Joined: Thu Apr 25, 2019 10:26 am

Re: Show HTML text when a Launch Condition fails

Hi Eusebiu,

I managed to get everything up and running. I modified the VBS file to suit my needs:

Code: Select all

Function AskThenOpenURL(strPrompt)
  Const msiMessageTypeUser = &H01000000
  Dim ans
  
  Set record = Session.Installer.CreateRecord(0)
  record.StringData(0) = strPrompt
  ans = Session.Message(msiMessageTypeUser + vbYesNo + vbQuestion, record)
  
  If ans = vbYes Then
    OpenURL("https://<sitename here>") 
  End If
End Function

Function OpenURL(strURL)
   Set WshShell = CreateObject("WScript.Shell")
   ret = WshShell.Run(strURL, 1, False)
End Function

Function LaunchCondition1Failed()

	AskThenOpenURL("Some stuff is missing and needs to be installed first. Press Yes to proceed to the download site.")
 
    ' abort the installation
    LaunchCondition1Failed = 3

End Function

Function LaunchCondition2Failed()
	
	AskThenOpenURL("Some other stuff is missing and needs to be installed first. Press Yes to proceed to the download site.")
 
    ' abort the installation
    LaunchCondition2Failed = 3

End Function
Then for both launch conditions I have I added a 'Launch attached file' Custom action, with Function: LaunchCondition1Failed.
This works like a charm!
I suspect I could probably add the text to message box text to a Property too, but for now this is fine!

Thanks for helping out,
Peter
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Show HTML text when a Launch Condition fails

You're welcome Peter. I'm glad you got this working.

Thank you for sharing the script with us as it might help other users in the future.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”