1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
var
PathSim, Path : String;
function FSPath9(param: string): String;
var
File : TstringList;
begin
if (RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\Microsoft Games\Flight Simulator\9.0\', 'AppPath', PathSim))
or (RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\Microsoft Games\Flight Simulator\9.1\', 'AppPath', PathSim)) then
begin
Result:= PathSim;
Path := PathSim + '\Modules\CPS.ini';
File := TStringList.Create;
File.Insert(0, '[Main]');
File.Insert(1, 'Menu0=CPS');
File.Insert(2, '[CPS]');
File.Insert(3, 'Caption=&CPS');
File.Insert(4, 'Menu0=FUEL_MANAGEMENT_SHEET');
File.Insert(5, 'Menu1=DESCENT_CALCULATOR');
File.Insert(6, '[FUEL_MANAGEMENT_SHEET]');
File.Insert(7, 'Open=' + ExpandConstant('{app}')+'\CFM.exe');
File.Insert(8, '[DESCENT_CALCULATOR]');
File.Insert(9, 'Open=' + ExpandConstant('{app}')+'\CDC.exe');
File.SaveToFile(Path);
File.Free;
end
else
begin
Result:= '';
end;
end;
function FSPathX(param: string): String;
var
File : TstringList;
begin
if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\Microsoft Games\Flight Simulator\10.0', 'AppPath',PathSim) then
begin
Result:= PathSim;
Path:= ExpandConstant('{userappdata}')+'\Microsoft\FSX\' + 'dll.xml';
File:= TstringList.Create;
File.LoadFromFile(Path);
if File[7] <> ' <Name>CPS</Name>' then
begin
File.SaveToFile(Path + ' before_CPS.xml');
File.Insert(6, ' <Launch.Addon>');
File.Insert(7, ' <Name>CPS</Name>');
File.Insert(8, ' <Disabled>False</Disabled>');
File.Insert(9, ' <ManualLoad>False</ManualLoad>');
File.Insert(10, ' <Path>CPSModulesStart.dll</Path>');
File.Insert(11, ' </Launch.Addon>');
File.SaveToFile(Path);
File.Free;
end;
end
else
begin
Result:= '';
end;
end;
function FSPathP3D(param: string): String;
var
File : TstringList;
begin
if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Lockheed Martin\Prepar3D v3', 'AppPath',PathSim) then
begin
Result:= PathSim;
Path:= ExpandConstant('{userappdata}')+'\Lockheed Martin\Prepar3D v3\' + 'DLL.XML';
File:= TstringList.Create;
File.LoadFromFile(Path);
if File[7] <> ' <Name>CPS</Name>' then
begin
File.SaveToFile(Path + ' before_CPS.xml');
File.Insert(6, ' <Launch.Addon>');
File.Insert(7, ' <Name>CPS</Name>');
File.Insert(8, ' <Disabled>False</Disabled>');
File.Insert(9, ' <ManualLoad>False</ManualLoad>');
File.Insert(10, ' <Path>CPSModulesStart.dll</Path>');
File.Insert(11, ' </Launch.Addon>');
File.SaveToFile(Path);
File.Free;
end;
end
else
begin
Result:= '';
end;
end; |
Partager