Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Inno setup Inno:将用户和串行数据写入注册表_Inno Setup - Fatal编程技术网

Inno setup Inno:将用户和串行数据写入注册表

Inno setup Inno:将用户和串行数据写入注册表,inno-setup,Inno Setup,在inno安装过程中,我试图将用户名和序列号写入注册表,在编译过程中出现以下错误: Invalid prototype for 'RegisteredUser' 来自Inno的区块 [Code] function RegisteredUser(): String; begin Result := 'test'; end; [Registry] Root: HKLM; Subkey: "SOFTWARE\Platform\Brand"; ValueType: string; ValueN

在inno安装过程中,我试图将用户名和序列号写入注册表,在编译过程中出现以下错误:

Invalid prototype for 'RegisteredUser'
来自Inno的区块

[Code]
function RegisteredUser(): String;
begin
  Result := 'test';
end;

[Registry] 
Root: HKLM; Subkey: "SOFTWARE\Platform\Brand"; ValueType: string; ValueName: "RegisteredUser"; ValueData: {code:RegisteredUser};
有什么想法吗

或者,如果我可以直接在[Code]中创建注册表,也可以使用它
感谢

显然,在inno设置中,
{code:block}
调用的函数必须是单字符串参数函数(即使您不使用它)

function RegisteredUser(Param: String): string;
begin
  Result := SerialPage.Values[0];
end;

是的,从非[Code]区域调用的函数必须有一个字符串参数。这给了它们很大的灵活性,可以执行以下操作:[Files]Source:“B\MYFILE.TXT”;DestDir:“{app}”;Check:DirExists(ExpandConstant('{app}\SubDir'))检查“Check parameters”用于完整讨论的Inno设置帮助索引中的条目。