title: InnoSetup & Pascal - Type mismatch error on run even after successful compile
body: <p>When I compile the code below, it completes without errors, but when I attempt to run the setup file I get a type mismatch error. Can anyone tell me what might be causing it? (exact error message is "Runtime Error (at 1:66): Type Mismatch.")</p>
  
  <pre><code>[Setup]
  DefaultDirName={code:AppDir}\MyApp
  
  [Code]
  function AppDir(Param: String): String;
  var
   Check: Integer;
  begin
   Check := GetWindowsVersion();
   if Check = 6.0 then
   Result := ExpandConstant('{userdocs}')
   else
   Result := ExpandConstant('{pf}');
  end;
  </code></pre>