Is there any way to let the user enter the serial key for the product when running the (Innosetup) product installer with flags /SP- /SILENT /SUPPRESSMSGBOXES
?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can create new command line parameter and pass the serial number in it.
/SERIAL=12345679
If this parameter is missing then do not allow to continue (show error/correct usage or simply terminate installation).
回答2:
To expand on @Slappy's answer:
You can use a /SERIAL=
command line parameter, but InnoSetup doesn't support this as one of its standard command line parameters, so you'll have to do a bit of Pascal scripting. Something like the following should work.
procedure CheckForCommandLineSerial();
var
i: Integer;
begin
for i := 1 to ParamCount do
begin
if (Pos('/serial=', Lowercase(ParamStr(i))) = 1) and (Length(ParamStr(i)) > 8) then
begin
WizardForm.UserInfoSerialEdit.Text := Copy(ParamStr(i), 9, Length(ParamStr(i)) - 8);
exit;
end
end;
end;
You can call this from your InitializeWizard
event function.