cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBScript Custom Action : Compare Serial number With User Input

VBScript Custom Action : Compare Serial number With User Input

Summary:
InstallShield BMSI: Compare the Serial number with user input using VBScript custom action

Steps to configure the custom action:

1. Create Basic MSI Project.

v1.JPG


2. Create Feature and Component then add files to the installer.

 

v2.JPG


3. Goto Behavior and Logic click Custom action and sequence.
4. Right click on the custom action and New Vbscript stored in custom action.

 

v3.JPG
5. Click on the script tab and add the following script,


Dim srSerialNum
Dim srMsg
Dim srValidSerialNumber
Dim nSize
Dim nLength
Dim nValid
' retrieve serial number from property
nSize = 32
srValidSerialNumber="456-CHECK-78910"
srSerialNum = Session.Property("ISX_SERIALNUM")

if srSerialNum = srValidSerialNumber then
Session.Property("VALID_SERIAL_NUMBER")="1"
nValid = Session.Property("VALID_SERIAL_NUMBER")
MsgBox " The Serial Number is correct.",48
else
Session.Property("VALID_SERIAL_NUMBER")="0"
nValid = Session.Property("VALID_SERIAL_NUMBER")
MsgBox "The Serial Number is incorrect. Please try again.", 48
End If

6. Click on Customer Information in Dialogs view, Click on next button and add Vbscript action.

v4.JPG


7. Build and run the project.

 

v5.JPG

 

Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Apr 17, 2023 03:13 AM
Updated by:
Contributors