View Full Version : Validate serial number during silent install

Painin the S.
01-16-2003, 05:25 PM
Custom actions are not executed during a silent install and this includes calling a serial number validation DLL (which is also a custom action).

My installation program should perform a serial number validation regardless of the installation mode (full GUI support or silent install). Up till now, I haven't found a way to do this for silent installations. :(

Does anybody know a way to[list=1] pass in a serial number to the setup program via the command line; and
either continue or abort the installation in silent mode, depending on the serial number validity?[/list=1]

01-16-2003, 06:29 PM
I have a suggestion but it requires a little ORCA tweaking. This is because you currently you can't sequence a VBScript or DLL Custom Action in the InstallExecuteSequence (which is what runs during a silent install).

First create a VBScript as a Custom Action:

Function CheckSN
Dim SerNum
SerNum = Session.Property("ISX_SERIALNUM")
If (SerNum="") Then
MsgBox "Serial number not specified. Stopping Setup."
End if
End Function

1. Sequence this Custom Action "after initialization (before first dialog).
2. Enter Function name as CheckSN
3. Build uncompressed
4. Open the msi in ORCA
5. Go to InstallUISequence Table
6. Delete the row for "CheckSN"
7. Go to InstallExecuteSequence table
8. Create a new row with following values:

Action: CheckSN
Condition: Not Installed
Sequence: 660

9. Save and close the msi

Trying to install silently should give the message and stop the install. Trying to install with the following Command Line should let it continue:

Setup.exe /v"ISX_SERIALNUM=123"

Also verify that this action doesn't affect a non-silent install in any way. Will have to look a little more in to actually getting the serial number validation to work during a silent install.

Painin the S.
01-16-2003, 06:34 PM
Wow Chandima, that's a quick response! I'll look into I and let you know the results.