0

I create a setup project in visual studio and want to add custom action to validate serial number. How can I do it?

EDIT 1: I add Customer Information dialog in user interface of my setup project, and set ShowSerialNumber property to True. and want to validate entered user serial number , when user click next button on this dialog.

2 Answers 2

1

In VS solution explorer

Right click yoursetup >> View >> USerInterface

Right Click Start >> Add Dialog >> Select TextBox

enter image description here

Now made a Custom Class And add Install class file

In Install.cs

public override void Install(IDictionary stateSaver)
    {
                base.Install(stateSaver);
    }
Sign up to request clarification or add additional context in comments.

1 Comment

I want to use Customer Information Dialog box and use SerialNumberTemplate. no Text Box Dialog.
1

Not sure exactly what you want, or what you have tried, still ...

Make a boolean function:

private static bool isValidSerialNumber( string number ) {

}

The way you validate it depends on the type of serial number scheme used,

This might involve performing an RSA decryption on the serial number, or it might be as simple as querying a database or list to see if the serial number is there.

take a look at this question: How are serial numbers generated?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.