Question: I need to create a INNO Setup script that will allow me to have a dialog, where the user can type in a serial number, then I need to save the serial number they entered into the Windows registry.

Also, if they don't enter a serial number, the next button needs to be disabled, so that they cannot proceed with the installation, if they do not enter a serial number.

Any help would be greatly appriceated.

Thanks!

Answer: 
Here's a stripped down sample of what I use in my scripts. Also, take a look at the InnoSetup docs for CheckSerial (http://www.jrsoftware.org/ishelp/topic\_setup\_userinfopage.htm). 

```
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{6EAB4CDD-5D03-4EA1-BE97-7102D27CE955}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Registry]
Root: HKCU; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty
Root: HKCU; Subkey: "Software\My Company\My Program"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "Software\My Company\My Program"; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "User"; ValueData: "{userinfoname}"
Root: HKLM; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "SN"; ValueData: "{userinfoserial}"

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: nowait postinstall skipifsilent

[Code]
function CheckSerial(Serial: String): Boolean;
var
sTrial : string;
sSerial : string;

begin
sTrial := 'trial';
sSerial := lowercase(Serial);
  if (length(Serial) <> 25)  AND (sTrial <> sSerial) then
    Result := false
  else
    Result := true;
end;

```
Inno can prompt the user for this information when you set the UserInfoPage=yes directivve.
If you add a CheckSerial event function, it will also ask for the registration details.

See the [UserInfoPage](http://www.jrsoftware.org/ishelp/topic_setup_userinfopage.htm) page in the help file for more details.