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

Set properties using VB scripts


3 replies to this topic

babric

babric
  • Members
  • 34 posts

Posted 27 July 2005 - 16:02

Hello !

I would like to set properties in VB scripts.

Here you can see my VB code :

CODE

If Msgbox("Do you want to uninstall this product ?, vbYesNo + vbDefaultButton2 + vbExclamation,"Title")=VbYes Then

'Here I would like to set the property UNINSTALL to "0"
' I tried <<<Session.Property("UNINSTALL") =  0>>> but it doesn't seem to work                                                                                                                                                                          

Else

'Here I would like to set the property UNINSTALL to "1"
' I tried <<<Session.Property("UNINSTALL") =  1>>> but it doesn't seem to work                                                                                                                                                                          


End If



Do you have a solution ?

Thanks !

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 28 July 2005 - 14:01

That should work, assuming that you care calling this script as a custom action from inside your setup. What makes you think it doesn#t work (what are the symptoms)?

babric

babric
  • Members
  • 34 posts

Posted 28 July 2005 - 14:22

Custom Action Table :

Action :
UneCustom

Type :
38

Source :


Target :
If Msgbox("Do you want to uninstall this product ?", vbYesNo + vbDefaultButton2 + vbExclamation,"Title")=VbYes Then
Session.Property("UNINSTALL") = 0
Else
Session.Property("UNINSTALL") = 1
End If

Sequence :
After Costinitialize (InstallUISequence Table)


When I run it "alone", I see the dialog box, and when I push a button, Ihave a <Required Object> "Session" error (that's normal)

When I run it in the msi package, I have a 1720 error (Script required can't be run)

I will try to add the vbs in the binary table...


EDIT :

Adding it in the binary table, I can see the dialog box, and when I push a button, I have the 1720 error... rolleyes.gif

Edited by babric, 28 July 2005 - 14:29.


lavocat

lavocat
  • Full Members
  • 158 posts

Posted 07 September 2005 - 13:16

You should try: Property("UNINSTALL") = "0" ....

The value assigned to a property in a custom action must be a string value.