问题
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:
CustomPage for Serial Number in Inno Setup
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!)
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:
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
来源:https://stackoverflow.com/questions/34690961/how-to-store-serial-numbers-in-a-sharepoint-list-for-to-call-from-inno-setup-an