Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Utilizing return values from VBScript CA


3 replies to this topic

MNJon

MNJon
  • Members
  • 11 posts

Posted 20 December 2004 - 21:54

Hello,

I have a Vbscript custom action (Type 6) in a Basic MSI install. This CA is executed when the Next button in a dialog is clicked (using a DoAction).

I am trying to get the install to proceed to the next dialog if the CA returns a certain value, but keep the same dialog displayed if a different value is returned.

(I am checking for the existance of a record in an Access database in a customer-supplied location).

I attempted to return a property to the install, but seem to be unable to write a property back during the UI sequence. (I can successfully write a property back during the execute sequence)

I then tried sending a different return value back from the CA. Works dandy, but I don't seem to be able to utilize the return value.

Lastly, I do not want to abort the install with a return value, which I do understand how to do - only to keep the user from advancing.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 21 December 2004 - 09:51

How did you verify that the property doen't get set by your custom action? Did you generate a log file?
How do you set the property in your custom action (VBScript code)?

MNJon

MNJon
  • Members
  • 11 posts

Posted 21 December 2004 - 15:33

I verified that the property was not returned to the install by generating an MSI log file. Note that I did stop the install at the end of the UI sequence.

I am returning the property to the install using the following in VBScript:

set DBO=Session.Database
set InstallerObj=Session.Installer
Session.Property("JRETURN") = "1"

This code correctly sets the property when run during the execute sequence

I also tried setting the return value of the CA. I see in the MSI log file that my return value is correctly returned to the install, but I do not know of a way to set an action to execute based on that return value.

Thanks in advance for your time!
John

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 21 December 2004 - 18:23

Do you perform any error checking in your VBScript code? Does it work if you remove:
set DBO=Session.Database
set InstallerObj=Session.Installer
I suspect that your script dies (errors out) somewhere before the
Session.Property("JRETURN") = "1"
call. Maybe insert MsgBoxes before and after that line to see if Windows Installer gets there at all.

The return values of a custom action are strictly defined and can only be used to return success or abort the installation. If you want to continue with the installation but perform some action depending on the result of your script, you need to return that result in a property.