Announcement

Collapse
No announcement yet.

Get var from vbs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Get var from vbs

    Hi,
    Just bought the MSI Factory.
    1. Create custom Action run vbscript.
    2. Call the VB script from dialog.

    Step 1+ 2: work [The script check user name against the AD]

    In the script, the error code inserted to var named "CA_check_Credentials_return_code"
    The script pop up this var and I see it's 0. Great.

    Now I want to enable the "Next" button only if the result [error code] is 0.
    How should I do that ?

    Thanks

  • #2
    You could set a Property in the VBScript, and use that Property to control the state of the button. You can check the license screen for an example.

    Ulrich

    Comment


    • #3
      Hi,
      This is my script.
      How do I set property ?
      Thanks

      ################

      On Error Resume Next

      dc = Session.Property("DC")
      userName = Session.Property("MY_DOMAIN_ADMIN")
      userPass = Session.Property("MY_DOMAIN_ADMIN_PASS")

      ldapServer = dc
      msgbox dc

      sRoot = "LDAP://" & ldapServer

      Set dso = GetObject("LDAP:")

      If Session.Property("CustomErrorStatus") <> "0" Then

      CA_check_Credentials_return_code = 0

      End If

      Set xResult = dso.OpenDSObject(sRoot, userName, userPass, ADS_SECURE_AUTHENTICATION)

      msgbox xResult.name
      msgbox "Result: " & Err.number

      Comment


      • #4
        More:
        In the msi log file, I notice the value of CUSTOMACTION_VBS_CHECK_USER is 0.
        ############

        MSI (c) (38:AC) [09:41:47:060]: Doing action: CUSTOMACTION_VBS_CHECK_USER
        Action 09:41:47: CUSTOMACTION_VBS_CHECK_USER.
        Action start 09:41:47: CUSTOMACTION_VBS_CHECK_USER.
        MSI (c) (38:B8) [09:41:47:061]: Cloaking enabled.
        MSI (c) (38:B8) [09:41:47:061]: Attempting to enable all disabled privileges before calling Install on Server
        MSI (c) (38:B8) [09:41:47:061]: Connected to service for CA interface.
        Action ended 09:41:48: CUSTOMACTION_VBS_CHECK_USER. Return value 0.
        Action 09:41:49: LicenseAgreementDlg. Dialog created

        Comment

        Working...
        X