How to store serial numbers in a Sharepoint List,

2019-06-11 04:16发布

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!

1条回答
劫难
2楼-- · 2019-06-11 04:58

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

I do not now 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
  Log('InitializeSetup');

  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

查看更多
登录 后发表回答