- Revenera Community
- :
- InstallShield
- :
- InstallShield Knowledge Base
- :
- VBScript Custom Action : Compare Serial number With User Input
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
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.
2. Create Feature and Component then add files to the installer.
3. Goto Behavior and Logic click Custom action and sequence.
4. Right click on the custom action and New Vbscript stored in custom action.
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.
7. Build and run the project.