如何在 innosetup 中添加具有函数值的注册表项。我想将注册表中 IsServer 的值设置为 InstallAsServer 的返回值
[Code]
[Registry]
Root: HKLM; Subkey: "Software\company\product\Settings"; ValueType: string; ValueName: "IsServer"; ValueData: {code:InstallAsServer}
var
Page: TInputOptionWizardPage;
IsServer: Boolean;
procedure InitializeWizard;
begin
Page := CreateInputOptionPage(wpWelcome,
'Install Type', 'Select Install Type',
'Please select Installation type; If Server click Server else Client',
True, False);
// Add items
Page.Add('Install as Server');
Page.Add('Install as Client');
// Set initial values (optional)
Page.Values[0] := True;
Page.Values[1] := False;
IsServer := Page.Values[0];
end;
function InstallAsServer(emppararm: string): string; //emppararm not used just for syntax
begin
if (IsServer=False) then
begin
result:= '0';
end
else
begin
result:= '1';
end
end;
但即使我在页面中选择服务器或客户端,我总是将值设置为 1