Terminate Installation On Confirmation - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

yogesh12
Posts: 23
Joined: Mon Sep 01, 2008 6:52 am

Terminate Installation On Confirmation

Hi,

We are using Advanced Installer Version: 6.5.2, Enterprise Project.
Limit to basic user interface - Checked (NO FULL UI).

We have written a CA (ON Standard Action - Before Initialization - Begin) VBScript to prompt a confirmation message ("This package would setup win Image. Do you want to continue?" YES+NO) and if user selects NO then we want to terminate the installation.

How termination of the installation can be achieved using VBScript (Restriction: Limit to basic user interface CHECKED)?
OR
Is it possible to write a "Script Inline" that can be as below:.....
If (MsgBox("This package would setup Linux Tabernus Image. Do you want to continue?", vbYesNo) = vbNo) Then EndDialog('Exit')
or something similar?

How can we execute the event "EndDialog ('Exit')" using VBScript?

Thanks in advance.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Terminate Installation On Confirmation

Hi,

You can try using this VBScript code:

Code: Select all

Function Ask()
  msg = "This package would setup win Image. Do you want to continue?"
  
  Const msiMessageTypeUser = &H03000000
  Const msiMessageStatusNo = 7
  Set record = Session.Installer.CreateRecord(1)
  record.StringData(0) = "[1]"
  record.StringData(1) = CStr(msg)
  ans=Session.Message(msiMessageTypeUser + vbYesNo, record)
  If ans = msiMessageStatusNo Then
    Ask = 2
  End If  
End Function
It will prompt the user and based on his answer the installation will continue or it will stop. The code can be pasted into a .VBS file which can be added as an Attached custom action. In the "Function Name" field from the "Custom Action Properties" pane you can use:

Code: Select all

Ask
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”