How to create CustomPage in Inno Setup with Edit Boxes for Serial Number? E.g. 6x5chars or 7x5chars?
Script should check if all boxes are filled before Next button become available.
It would be also good if there could be Copy/Paste function implemented that would allow to fill up all Edit Boxes if the clipboard content matches the serial number pattern.
The simplest way to add a Serial key box, beneath the Name and Organisation text fields, is to add something like the following to your iss file.
This can be usefully combined with
which will fill in the serial if previously entered for the install.
You can make Inno prompt the user for a serial key by adding an
CheckSerial()
event function.If you want more control over the page, you can use one of the stock pages (
CreateInput...Page
) or a custom page in the setup wizard usingCreateCustomPage()
and adding controls as you require.See the codedlg.iss example included with Inno setup.
Here is one approach that uses the custom page where the separate edit boxes are created. You only need to specify the value for the
SC_EDITCOUNT
constant where the number of edit boxes is defined and theSC_CHARCOUNT
what is the number of characters that can be entered into these edit boxes. If you are in the first edit box you may paste the whole serial number if it's in the format by the pattern delimited by the-
char (theTryPasteSerialNumber
function here). To get the serial number from the edit boxes it's enough to callGetSerialNumber
where you can specify also a delimiter for the output format (if needed).And here is how it looks like: