Shared.CompilerInt.Struct.pas 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. unit Shared.CompilerInt.Struct;
  2. {
  3. Inno Setup
  4. Copyright (C) 1997-2024 Jordan Russell
  5. Portions by Martijn Laan
  6. For conditions of distribution and use, see LICENSE.TXT.
  7. Compiler interface records and other types
  8. }
  9. interface
  10. uses
  11. Windows;
  12. const
  13. { Constants passed in Code parameter of callback function }
  14. iscbReadScript = 1; { Sent when compiler needs the next script line }
  15. iscbNotifyStatus = 2; { Sent to notify the application of compiler status }
  16. iscbNotifyIdle = 3; { Sent at various intervals during the compilation }
  17. iscbNotifySuccess = 4; { Sent when compilation succeeds }
  18. iscbNotifyError = 5; { Sent when compilation fails or is aborted by the
  19. application }
  20. iscbNotifyPreproc = 6; { Sent to notify the application of preprocessor results }
  21. { Return values for callback function }
  22. iscrSuccess = 0; { Return this for compiler to continue }
  23. iscrRequestAbort = 1; { Return this to abort compilation immediately.
  24. (When this value is returned, it is not necessary
  25. to set any of the "out" fields in the
  26. TCompilerCallbackData; the compiler will ignore
  27. them.) }
  28. { Return values for ISDllCompileScript }
  29. isceNoError = 0; { Successful }
  30. isceInvalidParam = 1; { Bad parameters passed to function }
  31. isceCompileFailure = 2; { There was an error compiling or it was aborted
  32. by the application }
  33. type
  34. { TCompilerCallbackData is a record passed to the callback function. The
  35. fields which you may access vary depending on what Code was passed to the
  36. callback function. }
  37. TCompilerCallbackData = record
  38. case Integer of
  39. iscbReadScript: (
  40. Reset: BOOL; { [in] This field can be ignored in compiler
  41. versions 3.0.1 and later. (Previous versions
  42. of the compiler made multiple passes over the
  43. script, and set Reset to True when it needed
  44. to return to the beginning.) }
  45. LineRead: PChar); { [out] Application returns pointer to the next
  46. line it reads, or a NULL pointer if the end of
  47. file is reached. Application is responsible for
  48. allocating a buffer to hold the line; LineRead
  49. is initially NULL when the callback function
  50. is called. The pointer only needs to remain
  51. valid until the next time the callback function
  52. is called (i.e. the application may return the
  53. same pointer each time). }
  54. iscbNotifyStatus: (
  55. StatusMsg: PChar; { [in] Contents of status message. }
  56. Warning: BOOL); { [in] Warning indicator (new in 6.0.0) }
  57. iscbNotifyIdle: (
  58. CompressProgress: Cardinal; { [in] Amount compressed so far
  59. (new in 4.1.6) }
  60. CompressProgressMax: Cardinal; { [in] Maximum value of CompressProgress
  61. (new in 4.1.6) }
  62. SecondsRemaining: Integer; { [in] Estimated time remaining, or -1
  63. if not known (new in 5.1.13) }
  64. BytesCompressedPerSecond: Cardinal); { [in] Average bytes compressed
  65. per second (new in 5.1.13) }
  66. iscbNotifyPreproc: (
  67. PreprocessedScript: PChar; { [in] Preprocessed script (new in 6.1.0) }
  68. IncludedFilenames: PChar); { [in] Names of #included files. Each name is
  69. a null-terminated string, and the final
  70. name is followed by an additional null
  71. character (new in 6.1.0) }
  72. iscbNotifySuccess: (
  73. OutputExeFilename: PChar; { [in] The name of the resulting setup.exe,
  74. or empty if output was disabled
  75. (latter new in 5.5.5) }
  76. DebugInfo: Pointer; { [in] Debug info (new in 3.0.0.1) }
  77. DebugInfoSize: Cardinal); { [in] Size of debug info (new in 3.0.0.1) }
  78. iscbNotifyError: (
  79. ErrorMsg: PChar; { [in] The error message, or NULL if compilation
  80. was aborted by the application. }
  81. ErrorFilename: PChar; { [in] Filename in which the error occurred. This
  82. is NULL if the file is the main script. }
  83. ErrorLine: Integer); { [in] The line number the error occurred on.
  84. Zero if the error doesn't apply to any
  85. particular line. }
  86. end;
  87. TCompilerCallbackProc = function(Code: Integer;
  88. var Data: TCompilerCallbackData; AppData: Longint): Integer; stdcall;
  89. PCompileScriptParamsEx = ^TCompileScriptParamsEx;
  90. TCompileScriptParamsEx = record
  91. Size: Cardinal; { [in] Set to SizeOf(TCompileScriptParamsEx). }
  92. CompilerPath: PChar; { [in] The "compiler:" directory. This is the
  93. directory which contains the *.e32 files. If this
  94. is set to NULL, the compiler will use the directory
  95. containing the compiler DLL/EXE. }
  96. SourcePath: PChar; { [in] The default source directory, and directory to
  97. look in for #include files. Normally, this is
  98. the directory containing the script file. This
  99. cannot be NULL. }
  100. CallbackProc: TCompilerCallbackProc;
  101. { [in] The callback procedure which the compiler calls
  102. to read the script and for status notification. }
  103. AppData: Longint; { [in] Application-defined. AppData is passed to the
  104. callback function. }
  105. Options: PChar; { [in] Additional options. Each option is a
  106. null-terminated string, and the final option is
  107. followed by an additional null character.
  108. If you do not wish to specify any options, set this
  109. field to NULL or to point to a single null
  110. character.
  111. Currently supported options:
  112. Output=(0|no|false|1|yes|true)
  113. Enables or disables output.
  114. OutputBaseFilename=[filename]
  115. Overrides any OutputBaseFilename setting in the
  116. script; causes the compiler to use [filename]
  117. instead.
  118. OutputDir=[path]
  119. Overrides any output directory in the script;
  120. causes the compiler to use [path] instead.
  121. SignTool-[name]=[command]
  122. Configures a SignTool with name [name] and command
  123. [command].
  124. ISPP:[isppoption]
  125. Configures an ISPP option. }
  126. end;
  127. { The old TCompileScriptParams record. Use this in place of
  128. TCompileScriptParamsEx if you need call ISCmplr.dll versions below
  129. 5.0.5. It's the same except it lacks an Options field. }
  130. TCompileScriptParams = record
  131. Size: Cardinal; { [in] Set to SizeOf(TCompileScriptParams). }
  132. CompilerPath: PChar;
  133. SourcePath: PChar;
  134. CallbackProc: TCompilerCallbackProc;
  135. AppData: Longint;
  136. end;
  137. PCompilerVersionInfo = ^TCompilerVersionInfo;
  138. TCompilerVersionInfo = record
  139. Title: PAnsiChar; { Name of compiler engine - 'Inno Setup' }
  140. Version: PAnsiChar; { Version number text }
  141. BinVersion: Cardinal; { Version number as an integer }
  142. end;
  143. implementation
  144. end.