2
0

uSettings.pas 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. //
  16. GnuGettext;
  17. procedure InitGeneralRegistry;
  18. //-------------------------------------------------------------------------
  19. implementation
  20. // ------------------------------------------------------------------------
  21. uses
  22. uGlobals;
  23. procedure InitGeneralRegistry;
  24. var
  25. RegIni: TRegistryIniFile;
  26. FileVersion: cardinal;
  27. begin
  28. GeneralSection := RegGLSViewer + 'General';
  29. FileVersion := GetFileVersion(ParamStr(0));
  30. ExePath := ExtractFilePath(ParamStr(0));
  31. RegIni := TRegistryIniFile.Create(GeneralSection);
  32. try
  33. with RegIni do
  34. begin
  35. if not RegIni.SectionExists(GeneralSection) then
  36. begin
  37. WriteString(GeneralSection, 'ExePath', ExePath); //Don't translate the strings
  38. WriteInteger(GeneralSection, 'FileVersion', FileVersion);
  39. WriteString(GeneralSection, 'License', 'MPL');
  40. end
  41. else
  42. begin
  43. ExePath := ReadString(GeneralSection, 'ExePath', ExePath);
  44. end;
  45. end;
  46. finally
  47. RegIni.Free;
  48. end;
  49. (*
  50. if RegIni.ValueExists(GeneralSection,'SplashStart') then
  51. SplashStart := RegIni.ReadBool(GeneralSection,'SplashStart',False)
  52. else
  53. SplashStart := True;
  54. if RegIni.ValueExists(GeneralSection,'TipOfTheDay') then
  55. TipOfTheDay := RegIni.ReadBool(GeneralSection,'TipOfTheDay', True)
  56. else
  57. TipOfTheDay := False;
  58. *)
  59. end;
  60. initialization
  61. InitGeneralRegistry;
  62. end.