Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get returning value of a function in Inno setup

i need to write in registry the current date, when my app were installed. For this i have created function in [code] section and trying to call it from [registry] section but it doesnt work. How can i call my function from [registry] section to get the value which it returns?

[Registry]
Root: HKLM; Subkey: SOFTWARE\MyAppName; ValueType: string; ValueName: date; ValueData: **{code:DateTime}**; Flags: createvalueifdoesntexist; Tasks: ; Languages: 
[Code]
function DateTime() : String;
begin
  result := GetDateTimeString('dd/mm/yyyy hh:nn:ss', '-', ':');
end;
like image 771
andymcgregor Avatar asked Jan 22 '12 10:01

andymcgregor


1 Answers

You have to declare the function with a string parameter

function DateTime(param: string) : String;

even if it is not used inside the function.

The {code: call allows one string parameter. If you omit it (like you did), an empty string is used.

like image 169
Uwe Raabe Avatar answered Nov 07 '22 08:11

Uwe Raabe