versionresource.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <fpdoc-descriptions>
  3. <package name="fcl-res">
  4. <!--
  5. ====================================================================
  6. versionresource
  7. ====================================================================
  8. -->
  9. <module name="versionresource">
  10. <short>Contains a version information resource type</short>
  11. <descr>
  12. <p>This unit contains <link id="TVersionResource"/>, a <link id="resource.TAbstractResource">TAbstractResource</link> descendant specialized in handling resource of type <link id="resource.RT_VERSION">RT_VERSION</link>.</p>
  13. <p>Adding this unit to a program's <var>uses</var> clause registers class <link id="TVersionResource"/> for type <link id="resource.RT_VERSION">RT_VERSION</link> with <link id="resfactory.TResourceFactory">TResourceFactory</link>.</p>
  14. </descr>
  15. <!-- unresolved type reference Visibility: default -->
  16. <element name="SysUtils">
  17. </element>
  18. <!-- unresolved type reference Visibility: default -->
  19. <element name="Classes">
  20. </element>
  21. <!-- unresolved type reference Visibility: default -->
  22. <element name="resource">
  23. </element>
  24. <!-- unresolved type reference Visibility: default -->
  25. <element name="versionconsts">
  26. </element>
  27. <!-- unresolved type reference Visibility: default -->
  28. <element name="versiontypes">
  29. </element>
  30. <!-- record type Visibility: default -->
  31. <element name="TVerBlockHeader">
  32. <short>This type is internally used</short>
  33. <descr>
  34. <p>This type is internally used by <link id="TVersionResource"/></p>
  35. </descr>
  36. </element>
  37. <!-- object Visibility: default -->
  38. <element name="TVersionResource">
  39. <short>Version information resource type</short>
  40. <descr>
  41. <p>This class represents a resource of type <link id="resource.RT_VERSION">RT_VERSION</link>.</p>
  42. <p>A resource of this type provides version information for a Microsoft Windows executable or dll, which is shown when checking properties of a file in Windows Explorer.</p>
  43. <p>Information is stored in <link id="TVersionResource.FixedInfo">FixedInfo</link>, <link id="TVersionResource.StringFileInfo">StringFileInfo</link> and <link id="TVersionResource.VarFileInfo">VarFileInfo</link>.</p>
  44. <remark>This class doesn't allow its type to be changed to anything else than <link id="resource.RT_VERSION">RT_VERSION</link>, and its name to be different from 1. Attempts to do so result in a <link id="resource.EResourceDescChangeNotAllowedException">EResourceDescChangeNotAllowedException</link>.</remark>
  45. <remark>If you need to access <link id="resource.TAbstractResource.RawData">RawData</link> after you modified something, be sure to call <link id="resource.TAbstractResource.UpdateRawData">UpdateRawData</link> first. This isn't needed however when resource is written to a stream, since <link id="resource.TResources">TResources</link> takes care of it.</remark>
  46. <p><b>Sample code</b></p>
  47. <p>This code creates a version information resource</p>
  48. <code>
  49. const
  50. myVersion : TFileProductVersion = (1,2,0,0);
  51. var
  52. resources : TResources;
  53. aRes : TVersionResource;
  54. st : TVersionStringTable;
  55. ti : TVerTranslationInfo;
  56. begin
  57. aRes:=TVersionResource.Create(nil,nil); //it's always RT_VERSION and 1 respectively
  58. resources:=TResources.Create;
  59. resources.Add(aRes);
  60. aRes.FixedInfo.FileVersion:=myversion;
  61. aRes.FixedInfo.ProductVersion:=myversion;
  62. aRes.FixedInfo.FileFlagsMask:=VS_FFI_FILEFLAGSMASK;
  63. aRes.FixedInfo.FileFlags:=0;
  64. aRes.FixedInfo.FileOS:=VOS_NT_WINDOWS32;
  65. aRes.FixedInfo.FileType:=VFT_APP;
  66. aRes.FixedInfo.FileSubType:=0;
  67. aRes.FixedInfo.FileDate:=0;
  68. st:=TVersionStringTable.Create('041004B0'); //Italian, unicode codepage
  69. st.Add('CompanyName','Foo Corporation');
  70. st.Add('FileDescription','Foo suite core program');
  71. st.Add('FileVersion','1.2');
  72. st.Add('ProductVersion','1.2');
  73. aRes.StringFileInfo.Add(st);
  74. ti.language:=$0410; //Italian
  75. ti.codepage:=$04B0; //Unicode codepage
  76. aRes.VarFileInfo.Add(ti);
  77. resources.WriteToFile('myresource.res');
  78. resources.Free; //destroys aRes as well.
  79. end;
  80. </code>
  81. </descr>
  82. <seealso>
  83. <link id="TVersionResource.FixedInfo"/>
  84. <link id="TVersionResource.StringFileInfo"/>
  85. <link id="TVersionResource.VarFileInfo"/>
  86. </seealso>
  87. </element>
  88. <!-- constructor Visibility: public -->
  89. <element name="TVersionResource.Create">
  90. <short>Creates a new version information resource</short>
  91. <descr>
  92. <p>Please note that <var>aType</var> and <var>aName</var> parameters are not used, since this class always uses <link id="resource.RT_VERSION">RT_VERSION</link> as type and 1 as name.</p>
  93. </descr>
  94. </element>
  95. <!-- argument Visibility: default -->
  96. <element name="TVersionResource.Create.aType">
  97. <short>Ignored. Can be <var>nil</var>.</short>
  98. </element>
  99. <!-- argument Visibility: default -->
  100. <element name="TVersionResource.Create.aName">
  101. <short>Ignored. Can be <var>nil</var>.</short>
  102. </element>
  103. <!-- property Visibility: public -->
  104. <element name="TVersionResource.FixedInfo">
  105. <short>Language independent part of version information</short>
  106. <seealso>
  107. <link id="versiontypes.TVersionFixedInfo">TVersionFixedInfo</link>
  108. </seealso>
  109. </element>
  110. <!-- property Visibility: public -->
  111. <element name="TVersionResource.StringFileInfo">
  112. <short>Language dependent part of version information</short>
  113. <seealso>
  114. <link id="versiontypes.TVersionStringFileInfo">TVersionStringFileInfo</link>
  115. </seealso>
  116. </element>
  117. <!-- property Visibility: public -->
  118. <element name="TVersionResource.VarFileInfo">
  119. <short>List of supported languages</short>
  120. <seealso>
  121. <link id="versiontypes.TVersionVarFileInfo">TVersionVarFileInfo</link>
  122. </seealso>
  123. </element>
  124. </module> <!-- versionresource -->
  125. </package>
  126. </fpdoc-descriptions>