0

I am working on a project (Java project) and using Inno Setup 5 to create an installer. How can I secure the use of the install.exe and ask a serial number during the installation?

Thanks for the help.

2
  • What is "key"? A password? Or a serial number? Or what? Commented Feb 8, 2017 at 14:14
  • I want a way to secure the software : offline with use of a serial. I don't know the best way to do it. Commented Feb 15, 2017 at 12:39

2 Answers 2

1

Inno Setup has a built-in functionality prompting for a serial number on the optional "User Information" page and verifying the entered number.

[Setup]
UserInfoPage=yes

[Registry]
Root: HKLM; Subkey: "Software\My Company"; ValueType: string; ValueName: "SerialNumber"; \
    ValueData: "{userinfoserial}"

[Code]

function CheckSerial(Serial: String): Boolean;
begin
  Result := (Serial = '123');
end;

enter image description here


For a more advanced implementation, see CustomPage for Serial Number in Inno Setup.

Sign up to request clarification or add additional context in comments.

5 Comments

Nice. Thanks. It's a first step. Then I need to avoid the copy/paste with a regedit key ?
If I secure the installer, it's a good thing. But someone could copy the folder and use my soft without any problem. I think I need to lock the software if a regedit key was not created during with the installer.
So you want to store the serial number to registry? And make your application check the registry to be able to start? Or what?
Something like that, I guess.
I updated my last response to add some tips. Thanks for the help.
0

I works. I recommand to add in the InnoSetup script :

Flags: uninsdeletekey

When the program is uninstalled, delete the entire key.

[Registry]
Root: HKLM; Subkey: "Software\MySoft"; ValueType: string; ValueName: "AppInfo";  ValueData: "value" ; Flags: uninsdeletekey

I used this link to recover the key in my soft.

value = WinRegistry.readString (
                WinRegistry.HKEY_LOCAL_MACHINE,                             
               "SOFTWARE\\MySoft",          
               "AppInfo");

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.