JwaPatchWiz.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:23k
源码类别:

Windows编程

开发平台:

Delphi

  1. {******************************************************************************}
  2. {                                                                       }
  3. { MSI Patch Wizard API interface Unit for Object Pascal                        }
  4. {                                                                       }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
  6. { Corporation. All Rights Reserved.                                            }
  7. {                 }
  8. { The original file is: patchwiz.h, released August 2001. The original Pascal  }
  9. { code is: PatchWiz.pas, released December 2001. The initial developer of the  }
  10. { Pascal code is Marcel van Brakel (brakelm@chello.nl).                        }
  11. {                                                                              }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
  13. { Marcel van Brakel. All Rights Reserved.                                      }
  14. {                 }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  16. {                }
  17. { You may retrieve the latest version of this file at the Project JEDI home    }
  18. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  19. { http://members.chello.nl/m.vanbrakel2                                        }
  20. {                }
  21. { The contents of this file are used with permission, subject to the Mozilla   }
  22. { Public License Version 1.1 (the "License"); you may not use this file except }
  23. { in compliance with the License. You may obtain a copy of the License at      }
  24. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  25. {                                                                              }
  26. { Software distributed under the License is distributed on an "AS IS" basis,   }
  27. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  28. { the specific language governing rights and limitations under the License.    }
  29. {                                                                              }
  30. { Alternatively, the contents of this file may be used under the terms of the  }
  31. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  32. { provisions of the LGPL License are applicable instead of those above.        }
  33. { If you wish to allow use of your version of this file only under the terms   }
  34. { of the LGPL License and not to allow others to use your version of this file }
  35. { under the MPL, indicate your decision by deleting  the provisions above and  }
  36. { replace  them with the notice and other provisions required by the LGPL      }
  37. { License.  If you do not delete the provisions above, a recipient may use     }
  38. { your version of this file under either the MPL or the LGPL License.          }
  39. {                 }
  40. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  41. {                 }
  42. {******************************************************************************}
  43. unit JwaPatchWiz;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "PatchWiz.h"'}
  47. {$HPPEMIT ''}
  48. {$I WINDEFINES.INC}
  49. interface
  50. uses
  51.   JwaWinType;
  52.   (* PATCHWIZ.H - public header file for PATCHWIZ.DLL *)
  53. (*
  54. ** UINT WINAPI UiCreatePatchPackage ( LPTSTR szPcpPath,
  55. ** LPTSTR szPatchPath, LPTSTR szLogPath, HWND hwndStatus,
  56. ** LPTSTR szTempFolder, BOOL fRemoveTempFolderIfPresent );
  57. **
  58. ** Arguments:
  59. **   szPcpPath - full absolute path to Windows Installer database
  60. ** (PCP file) that contains appropriate tables of input-data for
  61. ** Patch creation process such as Properties and TargetImages.
  62. **   szPatchPath - optional, full absolute path to Patching Package
  63. ** file (MSP file) to create and stuff with output.  If this
  64. ** NULL or an empty string, the api will try to use
  65. ** Properties.Value where Properties.Name = PatchOutputPath
  66. ** from the PCP file.
  67. **   szLogPath - optional, full absolute path to text log file to
  68. ** append to.  Caller should truncate file if wanted.
  69. **   hwndStatus - optional, window handle to display status text.
  70. ** More details to come later.
  71. **   szTempFolder - optional location to use for temp files.
  72. ** Default is %TEMP%~pcw_tmp.tmp.
  73. **   fRemoveTempFolderIfPresent - remove temp folder (and all its
  74. ** contents) if present.  If FALSE and folder is present, api
  75. ** will fail.
  76. **
  77. ** Return Values: ERROR_SUCCESS, plus ERROR_PCW_* that follow.
  78. *)
  79. const
  80.   ERROR_PCW_BASE = DWORD($C00E5101);
  81.   {$EXTERNALSYM ERROR_PCW_BASE}
  82.   ERROR_PCW_PCP_DOESNT_EXIST              = (ERROR_PCW_BASE + $00);
  83.   {$EXTERNALSYM ERROR_PCW_PCP_DOESNT_EXIST}
  84.   ERROR_PCW_PCP_BAD_FORMAT                = (ERROR_PCW_BASE + $01);
  85.   {$EXTERNALSYM ERROR_PCW_PCP_BAD_FORMAT}
  86.   ERROR_PCW_CANT_CREATE_TEMP_FOLDER       = (ERROR_PCW_BASE + $02);
  87.   {$EXTERNALSYM ERROR_PCW_CANT_CREATE_TEMP_FOLDER}
  88.   ERROR_PCW_MISSING_PATCH_PATH            = (ERROR_PCW_BASE + $03);
  89.   {$EXTERNALSYM ERROR_PCW_MISSING_PATCH_PATH}
  90.   ERROR_PCW_CANT_OVERWRITE_PATCH          = (ERROR_PCW_BASE + $04);
  91.   {$EXTERNALSYM ERROR_PCW_CANT_OVERWRITE_PATCH}
  92.   ERROR_PCW_CANT_CREATE_PATCH_FILE        = (ERROR_PCW_BASE + $05);
  93.   {$EXTERNALSYM ERROR_PCW_CANT_CREATE_PATCH_FILE}
  94.   ERROR_PCW_MISSING_PATCH_GUID            = (ERROR_PCW_BASE + $06);
  95.   {$EXTERNALSYM ERROR_PCW_MISSING_PATCH_GUID}
  96.   ERROR_PCW_BAD_PATCH_GUID                = (ERROR_PCW_BASE + $07);
  97.   {$EXTERNALSYM ERROR_PCW_BAD_PATCH_GUID}
  98.   ERROR_PCW_BAD_GUIDS_TO_REPLACE          = (ERROR_PCW_BASE + $08);
  99.   {$EXTERNALSYM ERROR_PCW_BAD_GUIDS_TO_REPLACE}
  100.   ERROR_PCW_BAD_TARGET_PRODUCT_CODE_LIST  = (ERROR_PCW_BASE + $09);
  101.   {$EXTERNALSYM ERROR_PCW_BAD_TARGET_PRODUCT_CODE_LIST}
  102.   ERROR_PCW_NO_UPGRADED_IMAGES_TO_PATCH   = (ERROR_PCW_BASE + $0a);
  103.   {$EXTERNALSYM ERROR_PCW_NO_UPGRADED_IMAGES_TO_PATCH}
  104.   //#define ERROR_PCW_BAD_API_PATCHING_OPTION_FLAGS  (ERROR_PCW_BASE + 0x0b) -- obsolete
  105.   ERROR_PCW_BAD_API_PATCHING_SYMBOL_FLAGS = (ERROR_PCW_BASE + $0c);
  106.   {$EXTERNALSYM ERROR_PCW_BAD_API_PATCHING_SYMBOL_FLAGS}
  107.   ERROR_PCW_OODS_COPYING_MSI              = (ERROR_PCW_BASE + $0d);
  108.   {$EXTERNALSYM ERROR_PCW_OODS_COPYING_MSI}
  109.   ERROR_PCW_UPGRADED_IMAGE_NAME_TOO_LONG  = (ERROR_PCW_BASE + $0e);
  110.   {$EXTERNALSYM ERROR_PCW_UPGRADED_IMAGE_NAME_TOO_LONG}
  111.   ERROR_PCW_BAD_UPGRADED_IMAGE_NAME       = (ERROR_PCW_BASE + $0f);
  112.   {$EXTERNALSYM ERROR_PCW_BAD_UPGRADED_IMAGE_NAME}
  113.   ERROR_PCW_DUP_UPGRADED_IMAGE_NAME       = (ERROR_PCW_BASE + $10);
  114.   {$EXTERNALSYM ERROR_PCW_DUP_UPGRADED_IMAGE_NAME}
  115.   ERROR_PCW_UPGRADED_IMAGE_PATH_TOO_LONG  = (ERROR_PCW_BASE + $11);
  116.   {$EXTERNALSYM ERROR_PCW_UPGRADED_IMAGE_PATH_TOO_LONG}
  117.   ERROR_PCW_UPGRADED_IMAGE_PATH_EMPTY     = (ERROR_PCW_BASE + $12);
  118.   {$EXTERNALSYM ERROR_PCW_UPGRADED_IMAGE_PATH_EMPTY}
  119.   ERROR_PCW_UPGRADED_IMAGE_PATH_NOT_EXIST = (ERROR_PCW_BASE + $13);
  120.   {$EXTERNALSYM ERROR_PCW_UPGRADED_IMAGE_PATH_NOT_EXIST}
  121.   ERROR_PCW_UPGRADED_IMAGE_PATH_NOT_MSI   = (ERROR_PCW_BASE + $14);
  122.   {$EXTERNALSYM ERROR_PCW_UPGRADED_IMAGE_PATH_NOT_MSI}
  123.   ERROR_PCW_UPGRADED_IMAGE_COMPRESSED     = (ERROR_PCW_BASE + $15);
  124.   {$EXTERNALSYM ERROR_PCW_UPGRADED_IMAGE_COMPRESSED}
  125.   ERROR_PCW_TARGET_IMAGE_NAME_TOO_LONG    = (ERROR_PCW_BASE + $16);
  126.   {$EXTERNALSYM ERROR_PCW_TARGET_IMAGE_NAME_TOO_LONG}
  127.   ERROR_PCW_BAD_TARGET_IMAGE_NAME         = (ERROR_PCW_BASE + $17);
  128.   {$EXTERNALSYM ERROR_PCW_BAD_TARGET_IMAGE_NAME}
  129.   ERROR_PCW_DUP_TARGET_IMAGE_NAME         = (ERROR_PCW_BASE + $18);
  130.   {$EXTERNALSYM ERROR_PCW_DUP_TARGET_IMAGE_NAME}
  131.   ERROR_PCW_TARGET_IMAGE_PATH_TOO_LONG    = (ERROR_PCW_BASE + $19);
  132.   {$EXTERNALSYM ERROR_PCW_TARGET_IMAGE_PATH_TOO_LONG}
  133.   ERROR_PCW_TARGET_IMAGE_PATH_EMPTY       = (ERROR_PCW_BASE + $1a);
  134.   {$EXTERNALSYM ERROR_PCW_TARGET_IMAGE_PATH_EMPTY}
  135.   ERROR_PCW_TARGET_IMAGE_PATH_NOT_EXIST   = (ERROR_PCW_BASE + $1b);
  136.   {$EXTERNALSYM ERROR_PCW_TARGET_IMAGE_PATH_NOT_EXIST}
  137.   ERROR_PCW_TARGET_IMAGE_PATH_NOT_MSI     = (ERROR_PCW_BASE + $1c);
  138.   {$EXTERNALSYM ERROR_PCW_TARGET_IMAGE_PATH_NOT_MSI}
  139.   ERROR_PCW_TARGET_IMAGE_COMPRESSED       = (ERROR_PCW_BASE + $1d);
  140.   {$EXTERNALSYM ERROR_PCW_TARGET_IMAGE_COMPRESSED}
  141.   ERROR_PCW_TARGET_BAD_PROD_VALIDATE      = (ERROR_PCW_BASE + $1e);
  142.   {$EXTERNALSYM ERROR_PCW_TARGET_BAD_PROD_VALIDATE}
  143.   ERROR_PCW_TARGET_BAD_PROD_CODE_VAL      = (ERROR_PCW_BASE + $1f);
  144.   {$EXTERNALSYM ERROR_PCW_TARGET_BAD_PROD_CODE_VAL}
  145.   ERROR_PCW_UPGRADED_MISSING_SRC_FILES       = (ERROR_PCW_BASE + $20);
  146.   {$EXTERNALSYM ERROR_PCW_UPGRADED_MISSING_SRC_FILES}
  147.   ERROR_PCW_TARGET_MISSING_SRC_FILES         = (ERROR_PCW_BASE + $21);
  148.   {$EXTERNALSYM ERROR_PCW_TARGET_MISSING_SRC_FILES}
  149.   ERROR_PCW_IMAGE_FAMILY_NAME_TOO_LONG       = (ERROR_PCW_BASE + $22);
  150.   {$EXTERNALSYM ERROR_PCW_IMAGE_FAMILY_NAME_TOO_LONG}
  151.   ERROR_PCW_BAD_IMAGE_FAMILY_NAME            = (ERROR_PCW_BASE + $23);
  152.   {$EXTERNALSYM ERROR_PCW_BAD_IMAGE_FAMILY_NAME}
  153.   ERROR_PCW_DUP_IMAGE_FAMILY_NAME            = (ERROR_PCW_BASE + $24);
  154.   {$EXTERNALSYM ERROR_PCW_DUP_IMAGE_FAMILY_NAME}
  155.   ERROR_PCW_BAD_IMAGE_FAMILY_SRC_PROP        = (ERROR_PCW_BASE + $25);
  156.   {$EXTERNALSYM ERROR_PCW_BAD_IMAGE_FAMILY_SRC_PROP}
  157.   ERROR_PCW_UFILEDATA_LONG_FILE_TABLE_KEY    = (ERROR_PCW_BASE + $26);
  158.   {$EXTERNALSYM ERROR_PCW_UFILEDATA_LONG_FILE_TABLE_KEY}
  159.   ERROR_PCW_UFILEDATA_BLANK_FILE_TABLE_KEY   = (ERROR_PCW_BASE + $27);
  160.   {$EXTERNALSYM ERROR_PCW_UFILEDATA_BLANK_FILE_TABLE_KEY}
  161.   ERROR_PCW_UFILEDATA_MISSING_FILE_TABLE_KEY = (ERROR_PCW_BASE + $28);
  162.   {$EXTERNALSYM ERROR_PCW_UFILEDATA_MISSING_FILE_TABLE_KEY}
  163.   ERROR_PCW_EXTFILE_LONG_FILE_TABLE_KEY      = (ERROR_PCW_BASE + $29);
  164.   {$EXTERNALSYM ERROR_PCW_EXTFILE_LONG_FILE_TABLE_KEY}
  165.   ERROR_PCW_EXTFILE_BLANK_FILE_TABLE_KEY     = (ERROR_PCW_BASE + $2a);
  166.   {$EXTERNALSYM ERROR_PCW_EXTFILE_BLANK_FILE_TABLE_KEY}
  167.   ERROR_PCW_EXTFILE_BAD_FAMILY_FIELD         = (ERROR_PCW_BASE + $2b);
  168.   {$EXTERNALSYM ERROR_PCW_EXTFILE_BAD_FAMILY_FIELD}
  169.   ERROR_PCW_EXTFILE_LONG_PATH_TO_FILE        = (ERROR_PCW_BASE + $2c);
  170.   {$EXTERNALSYM ERROR_PCW_EXTFILE_LONG_PATH_TO_FILE}
  171.   ERROR_PCW_EXTFILE_BLANK_PATH_TO_FILE       = (ERROR_PCW_BASE + $2d);
  172.   {$EXTERNALSYM ERROR_PCW_EXTFILE_BLANK_PATH_TO_FILE}
  173.   ERROR_PCW_EXTFILE_MISSING_FILE             = (ERROR_PCW_BASE + $2e);
  174.   {$EXTERNALSYM ERROR_PCW_EXTFILE_MISSING_FILE}
  175. //#define ERROR_PCW_FILERANGE_LONG_FILE_TABLE_KEY       (ERROR_PCW_BASE + 0x2f) -- obsolete
  176. //#define ERROR_PCW_FILERANGE_BLANK_FILE_TABLE_KEY      (ERROR_PCW_BASE + 0x30) -- obsolete
  177. //#define ERROR_PCW_FILERANGE_MISSING_FILE_TABLE_KEY    (ERROR_PCW_BASE + 0x31) -- obsolete
  178. //#define ERROR_PCW_FILERANGE_LONG_PATH_TO_FILE         (ERROR_PCW_BASE + 0x32) -- obsolete
  179. //#define ERROR_PCW_FILERANGE_MISSING_FILE              (ERROR_PCW_BASE + 0x33) -- obsolete
  180. //#define ERROR_PCW_FILERANGE_INVALID_OFFSET            (ERROR_PCW_BASE + 0x34) -- obsolete
  181. //#define ERROR_PCW_FILERANGE_INVALID_SIZE              (ERROR_PCW_BASE + 0x35) -- obsolete
  182. //#define ERROR_PCW_FILERANGE_INVALID_RETAIN            (ERROR_PCW_BASE + 0x36) -- obsolete
  183. //#define ERROR_PCW_BAD_MEDIA_SRC_PROP_NAME             (ERROR_PCW_BASE + 0x37) -- obsolete
  184. //#define ERROR_PCW_BAD_MEDIA_DISK_ID                   (ERROR_PCW_BASE + 0x38) -- obsolete
  185.   ERROR_PCW_BAD_FILE_SEQUENCE_START       = (ERROR_PCW_BASE + $39);
  186.   {$EXTERNALSYM ERROR_PCW_BAD_FILE_SEQUENCE_START}
  187.   ERROR_PCW_CANT_COPY_FILE_TO_TEMP_FOLDER = (ERROR_PCW_BASE + $3a);
  188.   {$EXTERNALSYM ERROR_PCW_CANT_COPY_FILE_TO_TEMP_FOLDER}
  189.   ERROR_PCW_CANT_CREATE_ONE_PATCH_FILE    = (ERROR_PCW_BASE + $3b);
  190.   {$EXTERNALSYM ERROR_PCW_CANT_CREATE_ONE_PATCH_FILE}
  191.   ERROR_PCW_BAD_IMAGE_FAMILY_DISKID       = (ERROR_PCW_BASE + $3c);
  192.   {$EXTERNALSYM ERROR_PCW_BAD_IMAGE_FAMILY_DISKID}
  193.   ERROR_PCW_BAD_IMAGE_FAMILY_FILESEQSTART = (ERROR_PCW_BASE + $3d);
  194.   {$EXTERNALSYM ERROR_PCW_BAD_IMAGE_FAMILY_FILESEQSTART}
  195.   ERROR_PCW_BAD_UPGRADED_IMAGE_FAMILY     = (ERROR_PCW_BASE + $3e);
  196.   {$EXTERNALSYM ERROR_PCW_BAD_UPGRADED_IMAGE_FAMILY}
  197.   ERROR_PCW_BAD_TARGET_IMAGE_UPGRADED     = (ERROR_PCW_BASE + $3f);
  198.   {$EXTERNALSYM ERROR_PCW_BAD_TARGET_IMAGE_UPGRADED}
  199.   ERROR_PCW_DUP_TARGET_IMAGE_PACKCODE    = (ERROR_PCW_BASE + $40);
  200.   {$EXTERNALSYM ERROR_PCW_DUP_TARGET_IMAGE_PACKCODE}
  201.   ERROR_PCW_UFILEDATA_BAD_UPGRADED_FIELD = (ERROR_PCW_BASE + $41);
  202.   {$EXTERNALSYM ERROR_PCW_UFILEDATA_BAD_UPGRADED_FIELD}
  203.   ERROR_PCW_MISMATCHED_PRODUCT_CODES     = (ERROR_PCW_BASE + $42);
  204.   {$EXTERNALSYM ERROR_PCW_MISMATCHED_PRODUCT_CODES}
  205.   ERROR_PCW_MISMATCHED_PRODUCT_VERSIONS  = (ERROR_PCW_BASE + $43);
  206.   {$EXTERNALSYM ERROR_PCW_MISMATCHED_PRODUCT_VERSIONS}
  207.   ERROR_PCW_CANNOT_WRITE_DDF             = (ERROR_PCW_BASE + $44);
  208.   {$EXTERNALSYM ERROR_PCW_CANNOT_WRITE_DDF}
  209.   ERROR_PCW_CANNOT_RUN_MAKECAB           = (ERROR_PCW_BASE + $45);
  210.   {$EXTERNALSYM ERROR_PCW_CANNOT_RUN_MAKECAB}
  211. //#define ERROR_PCW_CANNOT_CREATE_STORAGE               (ERROR_PCW_BASE + 0x46) -- obsolete
  212. //#define ERROR_PCW_CANNOT_CREATE_STREAM                (ERROR_PCW_BASE + 0x47) -- obsolete
  213. //#define ERROR_PCW_CANNOT_WRITE_STREAM                 (ERROR_PCW_BASE + 0x48) -- obsolete
  214. //#define ERROR_PCW_CANNOT_READ_CABINET                 (ERROR_PCW_BASE + 0x49) -- obsolete
  215.   ERROR_PCW_WRITE_SUMMARY_PROPERTIES           = (ERROR_PCW_BASE + $4a);
  216.   {$EXTERNALSYM ERROR_PCW_WRITE_SUMMARY_PROPERTIES}
  217.   ERROR_PCW_TFILEDATA_LONG_FILE_TABLE_KEY      = (ERROR_PCW_BASE + $4b);
  218.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_LONG_FILE_TABLE_KEY}
  219.   ERROR_PCW_TFILEDATA_BLANK_FILE_TABLE_KEY     = (ERROR_PCW_BASE + $4c);
  220.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_BLANK_FILE_TABLE_KEY}
  221.   ERROR_PCW_TFILEDATA_MISSING_FILE_TABLE_KEY   = (ERROR_PCW_BASE + $4d);
  222.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_MISSING_FILE_TABLE_KEY}
  223.   ERROR_PCW_TFILEDATA_BAD_TARGET_FIELD         = (ERROR_PCW_BASE + $4e);
  224.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_BAD_TARGET_FIELD}
  225.   ERROR_PCW_UPGRADED_IMAGE_PATCH_PATH_TOO_LONG = (ERROR_PCW_BASE + $4f);
  226.   {$EXTERNALSYM ERROR_PCW_UPGRADED_IMAGE_PATCH_PATH_TOO_LONG}
  227.   ERROR_PCW_UPGRADED_IMAGE_PATCH_PATH_NOT_EXIST = (ERROR_PCW_BASE + $50);
  228.   {$EXTERNALSYM ERROR_PCW_UPGRADED_IMAGE_PATCH_PATH_NOT_EXIST}
  229.   ERROR_PCW_UPGRADED_IMAGE_PATCH_PATH_NOT_MSI   = (ERROR_PCW_BASE + $51);
  230.   {$EXTERNALSYM ERROR_PCW_UPGRADED_IMAGE_PATCH_PATH_NOT_MSI}
  231.   ERROR_PCW_DUP_UPGRADED_IMAGE_PACKCODE         = (ERROR_PCW_BASE + $52);
  232.   {$EXTERNALSYM ERROR_PCW_DUP_UPGRADED_IMAGE_PACKCODE}
  233.   ERROR_PCW_UFILEIGNORE_BAD_UPGRADED_FIELD      = (ERROR_PCW_BASE + $53);
  234.   {$EXTERNALSYM ERROR_PCW_UFILEIGNORE_BAD_UPGRADED_FIELD}
  235.   ERROR_PCW_UFILEIGNORE_LONG_FILE_TABLE_KEY     = (ERROR_PCW_BASE + $54);
  236.   {$EXTERNALSYM ERROR_PCW_UFILEIGNORE_LONG_FILE_TABLE_KEY}
  237.   ERROR_PCW_UFILEIGNORE_BLANK_FILE_TABLE_KEY    = (ERROR_PCW_BASE + $55);
  238.   {$EXTERNALSYM ERROR_PCW_UFILEIGNORE_BLANK_FILE_TABLE_KEY}
  239.   ERROR_PCW_UFILEIGNORE_BAD_FILE_TABLE_KEY      = (ERROR_PCW_BASE + $56);
  240.   {$EXTERNALSYM ERROR_PCW_UFILEIGNORE_BAD_FILE_TABLE_KEY}
  241.   ERROR_PCW_FAMILY_RANGE_NAME_TOO_LONG          = (ERROR_PCW_BASE + $57);
  242.   {$EXTERNALSYM ERROR_PCW_FAMILY_RANGE_NAME_TOO_LONG}
  243.   ERROR_PCW_BAD_FAMILY_RANGE_NAME               = (ERROR_PCW_BASE + $58);
  244.   {$EXTERNALSYM ERROR_PCW_BAD_FAMILY_RANGE_NAME}
  245.   ERROR_PCW_FAMILY_RANGE_LONG_FILE_TABLE_KEY    = (ERROR_PCW_BASE + $59);
  246.   {$EXTERNALSYM ERROR_PCW_FAMILY_RANGE_LONG_FILE_TABLE_KEY}
  247.   ERROR_PCW_FAMILY_RANGE_BLANK_FILE_TABLE_KEY   = (ERROR_PCW_BASE + $5a);
  248.   {$EXTERNALSYM ERROR_PCW_FAMILY_RANGE_BLANK_FILE_TABLE_KEY}
  249.   ERROR_PCW_FAMILY_RANGE_LONG_RETAIN_OFFSETS    = (ERROR_PCW_BASE + $5b);
  250.   {$EXTERNALSYM ERROR_PCW_FAMILY_RANGE_LONG_RETAIN_OFFSETS}
  251.   ERROR_PCW_FAMILY_RANGE_BLANK_RETAIN_OFFSETS   = (ERROR_PCW_BASE + $5c);
  252.   {$EXTERNALSYM ERROR_PCW_FAMILY_RANGE_BLANK_RETAIN_OFFSETS}
  253.   ERROR_PCW_FAMILY_RANGE_BAD_RETAIN_OFFSETS     = (ERROR_PCW_BASE + $5d);
  254.   {$EXTERNALSYM ERROR_PCW_FAMILY_RANGE_BAD_RETAIN_OFFSETS}
  255.   ERROR_PCW_FAMILY_RANGE_LONG_RETAIN_LENGTHS    = (ERROR_PCW_BASE + $5e);
  256.   {$EXTERNALSYM ERROR_PCW_FAMILY_RANGE_LONG_RETAIN_LENGTHS}
  257.   ERROR_PCW_FAMILY_RANGE_BLANK_RETAIN_LENGTHS   = (ERROR_PCW_BASE + $5f);
  258.   {$EXTERNALSYM ERROR_PCW_FAMILY_RANGE_BLANK_RETAIN_LENGTHS}
  259.   ERROR_PCW_FAMILY_RANGE_BAD_RETAIN_LENGTHS = (ERROR_PCW_BASE + $60);
  260.   {$EXTERNALSYM ERROR_PCW_FAMILY_RANGE_BAD_RETAIN_LENGTHS}
  261.   ERROR_PCW_FAMILY_RANGE_COUNT_MISMATCH     = (ERROR_PCW_BASE + $61);
  262.   {$EXTERNALSYM ERROR_PCW_FAMILY_RANGE_COUNT_MISMATCH}
  263.   ERROR_PCW_EXTFILE_LONG_IGNORE_OFFSETS     = (ERROR_PCW_BASE + $62);
  264.   {$EXTERNALSYM ERROR_PCW_EXTFILE_LONG_IGNORE_OFFSETS}
  265.   ERROR_PCW_EXTFILE_BAD_IGNORE_OFFSETS      = (ERROR_PCW_BASE + $63);
  266.   {$EXTERNALSYM ERROR_PCW_EXTFILE_BAD_IGNORE_OFFSETS}
  267.   ERROR_PCW_EXTFILE_LONG_IGNORE_LENGTHS     = (ERROR_PCW_BASE + $64);
  268.   {$EXTERNALSYM ERROR_PCW_EXTFILE_LONG_IGNORE_LENGTHS}
  269.   ERROR_PCW_EXTFILE_BAD_IGNORE_LENGTHS      = (ERROR_PCW_BASE + $65);
  270.   {$EXTERNALSYM ERROR_PCW_EXTFILE_BAD_IGNORE_LENGTHS}
  271.   ERROR_PCW_EXTFILE_IGNORE_COUNT_MISMATCH   = (ERROR_PCW_BASE + $66);
  272.   {$EXTERNALSYM ERROR_PCW_EXTFILE_IGNORE_COUNT_MISMATCH}
  273.   ERROR_PCW_EXTFILE_LONG_RETAIN_OFFSETS     = (ERROR_PCW_BASE + $67);
  274.   {$EXTERNALSYM ERROR_PCW_EXTFILE_LONG_RETAIN_OFFSETS}
  275.   ERROR_PCW_EXTFILE_BAD_RETAIN_OFFSETS      = (ERROR_PCW_BASE + $68);
  276.   {$EXTERNALSYM ERROR_PCW_EXTFILE_BAD_RETAIN_OFFSETS}
  277. //#define ERROR_PCW_EXTFILE_RETAIN_COUNT_MISMATCH       (ERROR_PCW_BASE + 0x69) -- obsolete
  278.   ERROR_PCW_TFILEDATA_LONG_IGNORE_OFFSETS   = (ERROR_PCW_BASE + $6a);
  279.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_LONG_IGNORE_OFFSETS}
  280.   ERROR_PCW_TFILEDATA_BAD_IGNORE_OFFSETS    = (ERROR_PCW_BASE + $6b);
  281.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_BAD_IGNORE_OFFSETS}
  282.   ERROR_PCW_TFILEDATA_LONG_IGNORE_LENGTHS   = (ERROR_PCW_BASE + $6c);
  283.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_LONG_IGNORE_LENGTHS}
  284.   ERROR_PCW_TFILEDATA_BAD_IGNORE_LENGTHS    = (ERROR_PCW_BASE + $6d);
  285.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_BAD_IGNORE_LENGTHS}
  286.   ERROR_PCW_TFILEDATA_IGNORE_COUNT_MISMATCH = (ERROR_PCW_BASE + $6e);
  287.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_IGNORE_COUNT_MISMATCH}
  288.   ERROR_PCW_TFILEDATA_LONG_RETAIN_OFFSETS   = (ERROR_PCW_BASE + $6f);
  289.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_LONG_RETAIN_OFFSETS}
  290.   ERROR_PCW_TFILEDATA_BAD_RETAIN_OFFSETS = (ERROR_PCW_BASE + $70);
  291.   {$EXTERNALSYM ERROR_PCW_TFILEDATA_BAD_RETAIN_OFFSETS}
  292. //#define ERROR_PCW_TFILEDATA_RETAIN_COUNT_MISMATCH     (ERROR_PCW_BASE + 0x71) -- obsolete
  293.   ERROR_PCW_CANT_GENERATE_TRANSFORM            = (ERROR_PCW_BASE + $72);
  294.   {$EXTERNALSYM ERROR_PCW_CANT_GENERATE_TRANSFORM}
  295.   ERROR_PCW_CANT_CREATE_SUMMARY_INFO           = (ERROR_PCW_BASE + $73);
  296.   {$EXTERNALSYM ERROR_PCW_CANT_CREATE_SUMMARY_INFO}
  297.   ERROR_PCW_CANT_GENERATE_TRANSFORM_POUND      = (ERROR_PCW_BASE + $74);
  298.   {$EXTERNALSYM ERROR_PCW_CANT_GENERATE_TRANSFORM_POUND}
  299.   ERROR_PCW_CANT_CREATE_SUMMARY_INFO_POUND     = (ERROR_PCW_BASE + $75);
  300.   {$EXTERNALSYM ERROR_PCW_CANT_CREATE_SUMMARY_INFO_POUND}
  301.   ERROR_PCW_BAD_UPGRADED_IMAGE_PRODUCT_CODE    = (ERROR_PCW_BASE + $76);
  302.   {$EXTERNALSYM ERROR_PCW_BAD_UPGRADED_IMAGE_PRODUCT_CODE}
  303.   ERROR_PCW_BAD_UPGRADED_IMAGE_PRODUCT_VERSION = (ERROR_PCW_BASE + $77);
  304.   {$EXTERNALSYM ERROR_PCW_BAD_UPGRADED_IMAGE_PRODUCT_VERSION}
  305.   ERROR_PCW_BAD_UPGRADED_IMAGE_UPGRADE_CODE    = (ERROR_PCW_BASE + $78);
  306.   {$EXTERNALSYM ERROR_PCW_BAD_UPGRADED_IMAGE_UPGRADE_CODE}
  307.   ERROR_PCW_BAD_TARGET_IMAGE_PRODUCT_CODE      = (ERROR_PCW_BASE + $79);
  308.   {$EXTERNALSYM ERROR_PCW_BAD_TARGET_IMAGE_PRODUCT_CODE}
  309.   ERROR_PCW_BAD_TARGET_IMAGE_PRODUCT_VERSION   = (ERROR_PCW_BASE + $7a);
  310.   {$EXTERNALSYM ERROR_PCW_BAD_TARGET_IMAGE_PRODUCT_VERSION}
  311.   ERROR_PCW_BAD_TARGET_IMAGE_UPGRADE_CODE      = (ERROR_PCW_BASE + $7b);
  312.   {$EXTERNALSYM ERROR_PCW_BAD_TARGET_IMAGE_UPGRADE_CODE}
  313.   ERROR_PCW_MATCHED_PRODUCT_VERSIONS           = (ERROR_PCW_BASE + $7c);
  314.   {$EXTERNALSYM ERROR_PCW_MATCHED_PRODUCT_VERSIONS}
  315.   ERROR_PCW_NEXTxd                             = (ERROR_PCW_BASE + $7d);
  316.   {$EXTERNALSYM ERROR_PCW_NEXTxd}
  317.   ERROR_PCW_NEXTxe                             = (ERROR_PCW_BASE + $7e);
  318.   {$EXTERNALSYM ERROR_PCW_NEXTxe}
  319.   ERROR_PCW_NEXTxf                             = (ERROR_PCW_BASE + $7f);
  320.   {$EXTERNALSYM ERROR_PCW_NEXTxf}
  321. (*
  322. #define ERROR_PCW_NEXTx0           (ERROR_PCW_BASE + 0x80)
  323. #define ERROR_PCW_NEXTx1           (ERROR_PCW_BASE + 0x81)
  324. #define ERROR_PCW_NEXTx2           (ERROR_PCW_BASE + 0x82)
  325. #define ERROR_PCW_NEXTx3           (ERROR_PCW_BASE + 0x83)
  326. #define ERROR_PCW_NEXTx4           (ERROR_PCW_BASE + 0x84)
  327. #define ERROR_PCW_NEXTx5           (ERROR_PCW_BASE + 0x85)
  328. #define ERROR_PCW_NEXTx6           (ERROR_PCW_BASE + 0x86)
  329. #define ERROR_PCW_NEXTx7           (ERROR_PCW_BASE + 0x87)
  330. #define ERROR_PCW_NEXTx8           (ERROR_PCW_BASE + 0x88)
  331. #define ERROR_PCW_NEXTx9           (ERROR_PCW_BASE + 0x89)
  332. #define ERROR_PCW_NEXTxa           (ERROR_PCW_BASE + 0x8a)
  333. #define ERROR_PCW_NEXTxb           (ERROR_PCW_BASE + 0x8b)
  334. #define ERROR_PCW_NEXTxc           (ERROR_PCW_BASE + 0x8c)
  335. #define ERROR_PCW_NEXTxd           (ERROR_PCW_BASE + 0x8d)
  336. #define ERROR_PCW_NEXTxe           (ERROR_PCW_BASE + 0x8e)
  337. #define ERROR_PCW_NEXTxf           (ERROR_PCW_BASE + 0x8f)
  338. *)
  339. //  Control IDs for hwndStatus child Text controls; title is required
  340.   IDC_STATUS_TITLE = ($1cf0);
  341.   {$EXTERNALSYM IDC_STATUS_TITLE}
  342.   IDC_STATUS_DATA1 = ($1cf1);
  343.   {$EXTERNALSYM IDC_STATUS_DATA1}
  344.   IDC_STATUS_DATA2 = ($1cf2);
  345.   {$EXTERNALSYM IDC_STATUS_DATA2}
  346. function UiCreatePatchPackageA(szaPcpPath, szaPatchPath, szaLogPath: LPSTR; hwndStatus: HWND; szaTempFolder: LPSTR; fRemoveTempFolderIfPresent: BOOL): UINT; stdcall;
  347. {$EXTERNALSYM UiCreatePatchPackageA}
  348. function UiCreatePatchPackageW(szwPcpPath, szwPatchPath, szwLogPath: LPWSTR; hwndStatus: HWND; szwTempFolder: LPWSTR; fRemoveTempFolderIfPresent: BOOL): UINT; stdcall;
  349. {$EXTERNALSYM UiCreatePatchPackageW}
  350. {$IFDEF UNICODE}
  351. function UiCreatePatchPackage(szwPcpPath, szwPatchPath, szwLogPath: LPWSTR; hwndStatus: HWND; szwTempFolder: LPWSTR; fRemoveTempFolderIfPresent: BOOL): UINT; stdcall;
  352. {$EXTERNALSYM UiCreatePatchPackage}
  353. {$ELSE}
  354. function UiCreatePatchPackage(szaPcpPath, szaPatchPath, szaLogPath: LPSTR; hwndStatus: HWND; szaTempFolder: LPSTR; fRemoveTempFolderIfPresent: BOOL): UINT; stdcall;
  355. {$EXTERNALSYM UiCreatePatchPackage}
  356. {$ENDIF}
  357. implementation
  358. const
  359.   patchwiz = 'patchwiz.dll'; // mvb Installed in SamplesSysMgmtMsiPatching
  360. {$IFDEF DYNAMIC_LINK}
  361. var
  362.   _UiCreatePatchPackageA: Pointer;
  363. function UiCreatePatchPackageA;
  364. begin
  365.   GetProcedureAddress(_UiCreatePatchPackageA, patchwiz, 'UiCreatePatchPackageA');
  366.   asm
  367.     mov esp, ebp
  368.     pop ebp
  369.     jmp [_UiCreatePatchPackageA]
  370.   end;
  371. end;
  372. {$ELSE}
  373. function UiCreatePatchPackageA; external patchwiz name 'UiCreatePatchPackageA';
  374. {$ENDIF DYNAMIC_LINK}
  375. {$IFDEF DYNAMIC_LINK}
  376. var
  377.   _UiCreatePatchPackageW: Pointer;
  378. function UiCreatePatchPackageW;
  379. begin
  380.   GetProcedureAddress(_UiCreatePatchPackageW, patchwiz, 'UiCreatePatchPackageW');
  381.   asm
  382.     mov esp, ebp
  383.     pop ebp
  384.     jmp [_UiCreatePatchPackageW]
  385.   end;
  386. end;
  387. {$ELSE}
  388. function UiCreatePatchPackageW; external patchwiz name 'UiCreatePatchPackageW';
  389. {$ENDIF DYNAMIC_LINK}
  390. {$IFDEF UNICODE}
  391. {$IFDEF DYNAMIC_LINK}
  392. var
  393.   _UiCreatePatchPackage: Pointer;
  394. function UiCreatePatchPackage;
  395. begin
  396.   GetProcedureAddress(_UiCreatePatchPackage, patchwiz, 'UiCreatePatchPackageW');
  397.   asm
  398.     mov esp, ebp
  399.     pop ebp
  400.     jmp [_UiCreatePatchPackage]
  401.   end;
  402. end;
  403. {$ELSE}
  404. function UiCreatePatchPackage; external patchwiz name 'UiCreatePatchPackageW';
  405. {$ENDIF DYNAMIC_LINK}
  406. {$ELSE}
  407. {$IFDEF DYNAMIC_LINK}
  408. var
  409.   _UiCreatePatchPackage: Pointer;
  410. function UiCreatePatchPackage;
  411. begin
  412.   GetProcedureAddress(_UiCreatePatchPackage, patchwiz, 'UiCreatePatchPackageA');
  413.   asm
  414.     mov esp, ebp
  415.     pop ebp
  416.     jmp [_UiCreatePatchPackage]
  417.   end;
  418. end;
  419. {$ELSE}
  420. function UiCreatePatchPackage; external patchwiz name 'UiCreatePatchPackageA';
  421. {$ENDIF DYNAMIC_LINK}
  422. {$ENDIF}
  423. end.