How to create dynamically changing serial numbers

2019-09-01 07:25发布

问题:

I have a page that prompts for serial number for my application when it is installed. I created the setup file using Inno Setup. What I would like to do is this : to prevent more than one installation using one setup file, I need to dynamically change the serial number that i would have provided in the inno setup scripting file. (i.e) Say i have supplied 123 as the serial number to my software and sell it. The buyer, once he enters that serial number and installs it, I need to change the value of the previous serial number to some random value so that when another person tries to install the software using the same serial number 123, it should not get installed. Kindly help out.

I have the code:

procedure OnSerialEditChange(Sender: TObject);
var 
    CanContinue: Boolean;
begin
    CanContinue := GetSerialNumber('-') = SerialNumber;
    WizardForm.NextButton.Enabled := CanContinue;
end;

And I initialise the value of the 'SerialNumber' in the 'InitializeWizard' procedure. Kindly tell me if what I want to do is possible or not.