Cancelling installation from inside vbscript - 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!

srini
Posts: 81
Joined: Mon Sep 14, 2009 4:22 pm

Cancelling installation from inside vbscript

Hello,

How can I cancel the installation process from inside one of my custom actions (a vbscript)?

Thanks
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Cancelling installation from inside vbscript

Hi,

Here is an example of VBScript code that does just what you need:

Code: Select all

 Function MsiMsgBox()
	  
		 Const msg = "Your installation will now finish ..."
	   
	      Const msiMessageTypeUser = &H01000000
	      Set record = Session.Installer.CreateRecord(1)
	      record.StringData(0) = "[1]"
	      record.StringData(1) = CStr(msg)
	      ans=Session.Message(msiMessageTypeUser , record)
      
		  MsiMsgBox = 2

      End Function

All you have to do is to place it into a .vbs file and then add it as a custom action in your installation package.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”