I'm using Inno Setup for my installation and am adding the following function to the existing [Code]
section:
function Get64Or32: String;
begin
if IsWin64 then
begin
Result := 'Program Files (x86)';
end
else
begin
Result := 'Program Files';
end;
end;
I keep getting the following error:
10:41:08 Invalid prototype for 'Get64Or32'
I have tried several permutations including having the parenthesis after the function name but get the same error each time.
I'm attempting to use this from the [Registry]
section to pinpoint the Java location:
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType:string; ValueName:"JRE_HOME"; ValueData:"C:\{code:Get64or32}\Java\jre_1.8.0_151"; Flags: preservestringtype uninsdeletevalue uninsdeletekeyifempty; Permissions: users-modify;