uSettings.pas 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // uSettings for GLSViewer
  3. //
  4. unit uSettings;
  5. interface
  6. uses
  7. Winapi.Windows,
  8. Winapi.Messages,
  9. System.Win.Registry,
  10. System.IniFiles,
  11. System.SysUtils,
  12. Vcl.Forms,
  13. Vcl.Graphics,
  14. Vcl.ActnList;
  15. procedure InitGeneralRegistry;
  16. implementation // ----------------------------------------------------------
  17. uses
  18. uGlobals;
  19. procedure InitGeneralRegistry;
  20. var
  21. RegIni: TRegistryIniFile;
  22. FileVersion: cardinal;
  23. begin
  24. GeneralSection := RegGLSViewer + 'General';
  25. FileVersion := GetFileVersion(ParamStr(0));
  26. ExePath := ExtractFilePath(ParamStr(0));
  27. RegIni := TRegistryIniFile.Create(GeneralSection);
  28. try
  29. with RegIni do
  30. begin
  31. if not RegIni.SectionExists(GeneralSection) then
  32. begin
  33. WriteString(GeneralSection, 'ExePath', ExePath); //Don't translate the strings
  34. WriteInteger(GeneralSection, 'FileVersion', FileVersion);
  35. WriteString(GeneralSection, 'License', 'MPL');
  36. end
  37. else
  38. begin
  39. ExePath := ReadString(GeneralSection, 'ExePath', ExePath);
  40. end;
  41. end;
  42. finally
  43. RegIni.Free;
  44. end;
  45. (*
  46. if RegIni.ValueExists(GeneralSection,'SplashStart') then
  47. SplashStart := RegIni.ReadBool(GeneralSection,'SplashStart',False)
  48. else
  49. SplashStart := True;
  50. if RegIni.ValueExists(GeneralSection,'TipOfTheDay') then
  51. TipOfTheDay := RegIni.ReadBool(GeneralSection,'TipOfTheDay', True)
  52. else
  53. TipOfTheDay := False;
  54. *)
  55. end;
  56. initialization //-----------------------------------------------------------
  57. InitGeneralRegistry;
  58. end.