1

I continue looking for the better way to distribute my application making use of Inno Setup, therefore I would to know if is possible to do a (check-serial).

I tried with the follows methods:

  1. CustomPage for Serial Number in Inno Setup

  2. How to create dynamically changing serial numbers using Inno Setup?

    • I want some similar like this. But with the exception that I have where to save my passwords (I think that SharePoint List could be helpful, I am not sure!)
  3. How to do a dynamic password in Inno Setup?

    • Not Is enough for my boss! and I want to believe that is possible do something more elegant.

Finally, I have a SharePoint account and I would like do some in my code of Inno Setup for to control of installations, i.e. Whether I have 123 number like a serial then it works normal until I change this value in the List.

I don't want that always be a same serial

Thanks again!

Community
  • 1
  • 1
DavidSaa
  • 49
  • 1
  • 9
  • Anyway, I do not see how sharepoint list is a good tools for a serial number management. How do you prevent all users from using the same serial number? You need an online service. I believe this is nicely covered in the comments to a question you already know: [How to create dynamically changing serial numbers using Inno Setup?](http://stackoverflow.com/q/24696318/850848) – Martin Prikryl Jan 09 '16 at 19:20

1 Answers1

1

To check a serial number against an HTTP resource, you can use the below code.

I do not know SharePoint, so I cannot give you details on how to adjust it to SharePoint.

[Setup]
UserInfoPage=yes

[Code]

var
  SerialNumber: string;

function InitializeSetup(): Boolean;
var
  WinHttpReq: Variant;
begin
  Result := True;

  try
    WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1');
    WinHttpReq.Open('GET', 'https://www.example.com/serial.php', false);
    WinHttpReq.Send();
    if WinHttpReq.Status = 200 then
    begin
      SerialNumber := Trim(WinHttpReq.ResponseText);
    end;
  except
  end;
  
  if SerialNumber = '' then
  begin
    MsgBox('Cannot retrieve serial number.', mbError, MB_OK);
    Result := False;
  end;
end;

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

For a similar question, see:
Inno Setup - How to validate serial number online

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992