Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1174 lines
54 KiB

  1. ;begin_both
  2. /*****************************************************************************\
  3. * *
  4. ;end_both
  5. * msi.h - - Interface for external access to Installer Service *
  6. * msip.h - - Interface for internal access to Installer Service * ;internal
  7. ;begin_both
  8. * *
  9. * Version 2.0 *
  10. * *
  11. * NOTES: All buffers sizes are TCHAR count, null included only on input *
  12. * Return argument pointers may be null if not interested in value *
  13. * *
  14. * Copyright (c) Microsoft Corporation. All rights reserved. *
  15. * *
  16. \*****************************************************************************/
  17. ;end_both
  18. #ifndef _MSI_H_
  19. #define _MSI_H_
  20. #ifndef _MSIP_H_ ;internal
  21. #define _MSIP_H_ ;internal
  22. ;begin_both
  23. #ifndef _WIN32_MSI
  24. #if (_WIN32_WINNT >= 0x0501)
  25. #define _WIN32_MSI 200
  26. #elif (_WIN32_WINNT >= 0x0500)
  27. #define _WIN32_MSI 110
  28. #else
  29. #define _WIN32_MSI 100
  30. #endif //_WIN32_WINNT
  31. #endif // !_WIN32_MSI
  32. ;end_both
  33. #if (_WIN32_MSI >= 150)
  34. #ifndef _MSI_NO_CRYPTO
  35. #include "wincrypt.h"
  36. #endif // _MSI_NO_CRYPTO
  37. #endif //(_WIN32_MSI >= 150)
  38. // --------------------------------------------------------------------------
  39. // Installer generic handle definitions
  40. // --------------------------------------------------------------------------
  41. typedef unsigned long MSIHANDLE; // abstract generic handle, 0 == no handle
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. // Close a open handle of any type
  46. // All handles obtained from API calls must be closed when no longer needed
  47. // Normally succeeds, returning TRUE.
  48. UINT WINAPI MsiCloseHandle(MSIHANDLE hAny);
  49. // Close all handles open in the process, a diagnostic call
  50. // This should NOT be used as a cleanup mechanism -- use PMSIHANDLE class
  51. // Can be called at termination to assure that all handles have been closed
  52. // Returns 0 if all handles have been close, else number of open handles
  53. UINT WINAPI MsiCloseAllHandles();
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #ifdef __cplusplus
  58. // C++ wrapper object to automatically free handle when going out of scope
  59. class PMSIHANDLE
  60. {
  61. MSIHANDLE m_h;
  62. public:
  63. PMSIHANDLE():m_h(0){}
  64. PMSIHANDLE(MSIHANDLE h):m_h(h){}
  65. ~PMSIHANDLE(){if (m_h!=0) MsiCloseHandle(m_h);}
  66. void operator =(MSIHANDLE h) {if (m_h) MsiCloseHandle(m_h); m_h=h;}
  67. operator MSIHANDLE() {return m_h;}
  68. MSIHANDLE* operator &() {if (m_h) MsiCloseHandle(m_h); m_h = 0; return &m_h;}
  69. };
  70. #endif //__cplusplus
  71. // Install message type for callback is a combination of the following:
  72. // A message box style: MB_*, where MB_OK is the default
  73. // A message box icon type: MB_ICON*, where no icon is the default
  74. // A default button: MB_DEFBUTTON?, where MB_DEFBUTTON1 is the default
  75. // One of the following install message types, no default
  76. typedef enum tagINSTALLMESSAGE
  77. {
  78. INSTALLMESSAGE_FATALEXIT = 0x00000000L, // premature termination, possibly fatal OOM
  79. INSTALLMESSAGE_ERROR = 0x01000000L, // formatted error message
  80. INSTALLMESSAGE_WARNING = 0x02000000L, // formatted warning message
  81. INSTALLMESSAGE_USER = 0x03000000L, // user request message
  82. INSTALLMESSAGE_INFO = 0x04000000L, // informative message for log
  83. INSTALLMESSAGE_FILESINUSE = 0x05000000L, // list of files in use that need to be replaced
  84. INSTALLMESSAGE_RESOLVESOURCE = 0x06000000L, // request to determine a valid source location
  85. INSTALLMESSAGE_OUTOFDISKSPACE = 0x07000000L, // insufficient disk space message
  86. INSTALLMESSAGE_ACTIONSTART = 0x08000000L, // start of action: action name & description
  87. INSTALLMESSAGE_ACTIONDATA = 0x09000000L, // formatted data associated with individual action item
  88. INSTALLMESSAGE_PROGRESS = 0x0A000000L, // progress gauge info: units so far, total
  89. INSTALLMESSAGE_COMMONDATA = 0x0B000000L, // product info for dialog: language Id, dialog caption
  90. INSTALLMESSAGE_INITIALIZE = 0x0C000000L, // sent prior to UI initialization, no string data
  91. INSTALLMESSAGE_TERMINATE = 0x0D000000L, // sent after UI termination, no string data
  92. INSTALLMESSAGE_SHOWDIALOG = 0x0E000000L, // sent prior to display or authored dialog or wizard
  93. } INSTALLMESSAGE;
  94. // external error handler supplied to installation API functions
  95. typedef int (WINAPI *INSTALLUI_HANDLER%)(LPVOID pvContext, UINT iMessageType, LPCTSTR% szMessage);
  96. typedef enum tagINSTALLUILEVEL
  97. {
  98. INSTALLUILEVEL_NOCHANGE = 0, // UI level is unchanged
  99. INSTALLUILEVEL_DEFAULT = 1, // default UI is used
  100. INSTALLUILEVEL_NONE = 2, // completely silent installation
  101. INSTALLUILEVEL_BASIC = 3, // simple progress and error handling
  102. INSTALLUILEVEL_REDUCED = 4, // authored UI, wizard dialogs suppressed
  103. INSTALLUILEVEL_FULL = 5, // authored UI with wizards, progress, errors
  104. INSTALLUILEVEL_ENDDIALOG = 0x80, // display success/failure dialog at end of install
  105. INSTALLUILEVEL_PROGRESSONLY = 0x40, // display only progress dialog
  106. INSTALLUILEVEL_HIDECANCEL = 0x20, // do not display the cancel button in basic UI
  107. INSTALLUILEVEL_SOURCERESONLY = 0x100, // force display of source resolution even if quiet
  108. } INSTALLUILEVEL;
  109. typedef enum tagINSTALLSTATE
  110. {
  111. INSTALLSTATE_NOTUSED = -7, // component disabled
  112. INSTALLSTATE_BADCONFIG = -6, // configuration data corrupt
  113. INSTALLSTATE_INCOMPLETE = -5, // installation suspended or in progress
  114. INSTALLSTATE_SOURCEABSENT = -4, // run from source, source is unavailable
  115. INSTALLSTATE_MOREDATA = -3, // return buffer overflow
  116. INSTALLSTATE_INVALIDARG = -2, // invalid function argument
  117. INSTALLSTATE_UNKNOWN = -1, // unrecognized product or feature
  118. INSTALLSTATE_BROKEN = 0, // broken
  119. INSTALLSTATE_ADVERTISED = 1, // advertised feature
  120. INSTALLSTATE_REMOVED = 1, // component being removed (action state, not settable)
  121. INSTALLSTATE_ABSENT = 2, // uninstalled (or action state absent but clients remain)
  122. INSTALLSTATE_LOCAL = 3, // installed on local drive
  123. INSTALLSTATE_SOURCE = 4, // run from source, CD or net
  124. INSTALLSTATE_DEFAULT = 5, // use default, local or source
  125. } INSTALLSTATE;
  126. typedef enum tagUSERINFOSTATE
  127. {
  128. USERINFOSTATE_MOREDATA = -3, // return buffer overflow
  129. USERINFOSTATE_INVALIDARG = -2, // invalid function argument
  130. USERINFOSTATE_UNKNOWN = -1, // unrecognized product
  131. USERINFOSTATE_ABSENT = 0, // user info and PID not initialized
  132. USERINFOSTATE_PRESENT = 1, // user info and PID initialized
  133. } USERINFOSTATE;
  134. typedef enum tagINSTALLLEVEL
  135. {
  136. INSTALLLEVEL_DEFAULT = 0, // install authored default
  137. INSTALLLEVEL_MINIMUM = 1, // install only required features
  138. INSTALLLEVEL_MAXIMUM = 0xFFFF, // install all features
  139. } INSTALLLEVEL; // intermediate levels dependent on authoring
  140. typedef enum tagREINSTALLMODE // bit flags
  141. {
  142. REINSTALLMODE_REPAIR = 0x00000001, // Reserved bit - currently ignored
  143. REINSTALLMODE_FILEMISSING = 0x00000002, // Reinstall only if file is missing
  144. REINSTALLMODE_FILEOLDERVERSION = 0x00000004, // Reinstall if file is missing, or older version
  145. REINSTALLMODE_FILEEQUALVERSION = 0x00000008, // Reinstall if file is missing, or equal or older version
  146. REINSTALLMODE_FILEEXACT = 0x00000010, // Reinstall if file is missing, or not exact version
  147. REINSTALLMODE_FILEVERIFY = 0x00000020, // checksum executables, reinstall if missing or corrupt
  148. REINSTALLMODE_FILEREPLACE = 0x00000040, // Reinstall all files, regardless of version
  149. REINSTALLMODE_MACHINEDATA = 0x00000080, // insure required machine reg entries
  150. REINSTALLMODE_USERDATA = 0x00000100, // insure required user reg entries
  151. REINSTALLMODE_SHORTCUT = 0x00000200, // validate shortcuts items
  152. REINSTALLMODE_PACKAGE = 0x00000400, // use re-cache source install package
  153. } REINSTALLMODE;
  154. typedef enum tagINSTALLOGMODE // bit flags for use with MsiEnableLog and MsiSetExternalUI
  155. {
  156. INSTALLLOGMODE_FATALEXIT = (1 << (INSTALLMESSAGE_FATALEXIT >> 24)),
  157. INSTALLLOGMODE_ERROR = (1 << (INSTALLMESSAGE_ERROR >> 24)),
  158. INSTALLLOGMODE_WARNING = (1 << (INSTALLMESSAGE_WARNING >> 24)),
  159. INSTALLLOGMODE_USER = (1 << (INSTALLMESSAGE_USER >> 24)),
  160. INSTALLLOGMODE_INFO = (1 << (INSTALLMESSAGE_INFO >> 24)),
  161. INSTALLLOGMODE_RESOLVESOURCE = (1 << (INSTALLMESSAGE_RESOLVESOURCE >> 24)),
  162. INSTALLLOGMODE_OUTOFDISKSPACE = (1 << (INSTALLMESSAGE_OUTOFDISKSPACE >> 24)),
  163. INSTALLLOGMODE_ACTIONSTART = (1 << (INSTALLMESSAGE_ACTIONSTART >> 24)),
  164. INSTALLLOGMODE_ACTIONDATA = (1 << (INSTALLMESSAGE_ACTIONDATA >> 24)),
  165. INSTALLLOGMODE_COMMONDATA = (1 << (INSTALLMESSAGE_COMMONDATA >> 24)),
  166. INSTALLLOGMODE_PROPERTYDUMP = (1 << (INSTALLMESSAGE_PROGRESS >> 24)), // log only
  167. INSTALLLOGMODE_VERBOSE = (1 << (INSTALLMESSAGE_INITIALIZE >> 24)), // log only
  168. INSTALLLOGMODE_EXTRADEBUG = (1 << (INSTALLMESSAGE_TERMINATE >> 24)), // log only
  169. INSTALLLOGMODE_PROGRESS = (1 << (INSTALLMESSAGE_PROGRESS >> 24)), // external handler only
  170. INSTALLLOGMODE_INITIALIZE = (1 << (INSTALLMESSAGE_INITIALIZE >> 24)), // external handler only
  171. INSTALLLOGMODE_TERMINATE = (1 << (INSTALLMESSAGE_TERMINATE >> 24)), // external handler only
  172. INSTALLLOGMODE_SHOWDIALOG = (1 << (INSTALLMESSAGE_SHOWDIALOG >> 24)), // external handler only
  173. } INSTALLLOGMODE;
  174. typedef enum tagINSTALLLOGATTRIBUTES // flag attributes for MsiEnableLog
  175. {
  176. INSTALLLOGATTRIBUTES_APPEND = (1 << 0),
  177. INSTALLLOGATTRIBUTES_FLUSHEACHLINE = (1 << 1),
  178. } INSTALLLOGATTRIBUTES;
  179. typedef enum tagINSTALLFEATUREATTRIBUTE // bit flags
  180. {
  181. INSTALLFEATUREATTRIBUTE_FAVORLOCAL = 1 << 0,
  182. INSTALLFEATUREATTRIBUTE_FAVORSOURCE = 1 << 1,
  183. INSTALLFEATUREATTRIBUTE_FOLLOWPARENT = 1 << 2,
  184. INSTALLFEATUREATTRIBUTE_FAVORADVERTISE = 1 << 3,
  185. INSTALLFEATUREATTRIBUTE_DISALLOWADVERTISE = 1 << 4,
  186. INSTALLFEATUREATTRIBUTE_NOUNSUPPORTEDADVERTISE = 1 << 5,
  187. } INSTALLFEATUREATTRIBUTE;
  188. typedef enum tagINSTALLMODE
  189. {
  190. INSTALLMODE_NOSOURCERESOLUTION = -3, // skip source resolution
  191. INSTALLMODE_NODETECTION = -2, // skip detection
  192. INSTALLMODE_EXISTING = -1, // provide, if available
  193. INSTALLMODE_DEFAULT = 0, // install, if absent
  194. } INSTALLMODE;
  195. ;begin_internal
  196. #if (_WIN32_MSI >= 150)
  197. #define INSTALLMODE_NODETECTION_ANY (INSTALLMODE)-4 // provide any, if available, supported internally for MsiProvideAssembly
  198. #endif
  199. ;end_internal
  200. ;begin_internal
  201. #if (_WIN32_MSI >= 150)
  202. typedef enum tagMIGRATIONOPTIONS
  203. {
  204. migQuiet = 1 << 0,
  205. migMsiTrust10PackagePolicyOverride = 1 << 1,
  206. } MIGRATIONOPTIONS;
  207. #endif
  208. ;end_internal
  209. #define MAX_FEATURE_CHARS 38 // maximum chars in feature name (same as string GUID)
  210. // Product info attributes: advertised information
  211. #define INSTALLPROPERTY_PACKAGENAME __TEXT("PackageName")
  212. #define INSTALLPROPERTY_TRANSFORMS __TEXT("Transforms")
  213. #define INSTALLPROPERTY_LANGUAGE __TEXT("Language")
  214. #define INSTALLPROPERTY_PRODUCTNAME __TEXT("ProductName")
  215. #define INSTALLPROPERTY_ASSIGNMENTTYPE __TEXT("AssignmentType")
  216. #if (_WIN32_MSI >= 150)
  217. #define INSTALLPROPERTY_INSTANCETYPE __TEXT("InstanceType")
  218. #endif //(_WIN32_MSI >= 150)
  219. ;begin_internal
  220. #define INSTALLPROPERTY_ADVTFLAGS __TEXT("AdvertiseFlags")
  221. ;end_internal
  222. #define INSTALLPROPERTY_PACKAGECODE __TEXT("PackageCode")
  223. #define INSTALLPROPERTY_VERSION __TEXT("Version")
  224. #if (_WIN32_MSI >= 110)
  225. #define INSTALLPROPERTY_PRODUCTICON __TEXT("ProductIcon")
  226. #endif //(_WIN32_MSI >= 110)
  227. // Product info attributes: installed information
  228. #define INSTALLPROPERTY_INSTALLEDPRODUCTNAME __TEXT("InstalledProductName")
  229. #define INSTALLPROPERTY_VERSIONSTRING __TEXT("VersionString")
  230. #define INSTALLPROPERTY_HELPLINK __TEXT("HelpLink")
  231. #define INSTALLPROPERTY_HELPTELEPHONE __TEXT("HelpTelephone")
  232. #define INSTALLPROPERTY_INSTALLLOCATION __TEXT("InstallLocation")
  233. #define INSTALLPROPERTY_INSTALLSOURCE __TEXT("InstallSource")
  234. #define INSTALLPROPERTY_INSTALLDATE __TEXT("InstallDate")
  235. #define INSTALLPROPERTY_PUBLISHER __TEXT("Publisher")
  236. #define INSTALLPROPERTY_LOCALPACKAGE __TEXT("LocalPackage")
  237. #define INSTALLPROPERTY_URLINFOABOUT __TEXT("URLInfoAbout")
  238. #define INSTALLPROPERTY_URLUPDATEINFO __TEXT("URLUpdateInfo")
  239. #define INSTALLPROPERTY_VERSIONMINOR __TEXT("VersionMinor")
  240. #define INSTALLPROPERTY_VERSIONMAJOR __TEXT("VersionMajor")
  241. typedef enum tagSCRIPTFLAGS
  242. {
  243. SCRIPTFLAGS_CACHEINFO = 0x00000001L, // set if the icons need to be created/ removed
  244. SCRIPTFLAGS_SHORTCUTS = 0x00000004L, // set if the shortcuts needs to be created/ deleted
  245. SCRIPTFLAGS_MACHINEASSIGN = 0x00000008L, // set if product to be assigned to machine
  246. SCRIPTFLAGS_REGDATA_CNFGINFO = 0x00000020L, // set if the product cnfg mgmt. registry data needs to be written/ removed
  247. SCRIPTFLAGS_VALIDATE_TRANSFORMS_LIST = 0x00000040L,
  248. #if (_WIN32_MSI >= 110)
  249. SCRIPTFLAGS_REGDATA_CLASSINFO = 0x00000080L, // set if COM classes related app info needs to be created/ deleted
  250. SCRIPTFLAGS_REGDATA_EXTENSIONINFO = 0x00000100L, // set if extension related app info needs to be created/ deleted
  251. SCRIPTFLAGS_REGDATA_APPINFO = SCRIPTFLAGS_REGDATA_CLASSINFO | SCRIPTFLAGS_REGDATA_EXTENSIONINFO, // for source level backward compatibility
  252. #else //_WIN32_MSI == 100
  253. SCRIPTFLAGS_REGDATA_APPINFO = 0x00000010L,
  254. #endif //(_WIN32_MSI >= 110)
  255. SCRIPTFLAGS_REGDATA = SCRIPTFLAGS_REGDATA_APPINFO | SCRIPTFLAGS_REGDATA_CNFGINFO, // for source level backward compatibility
  256. }SCRIPTFLAGS;
  257. typedef enum tagADVERTISEFLAGS
  258. {
  259. ADVERTISEFLAGS_MACHINEASSIGN = 0, // set if the product is to be machine assigned
  260. ADVERTISEFLAGS_USERASSIGN = 1, // set if the product is to be user assigned
  261. }ADVERTISEFLAGS;
  262. typedef enum tagINSTALLTYPE
  263. {
  264. INSTALLTYPE_DEFAULT = 0, // set to indicate default behavior
  265. INSTALLTYPE_NETWORK_IMAGE = 1, // set to indicate network install
  266. INSTALLTYPE_SINGLE_INSTANCE = 2, // set to indicate a particular instance
  267. }INSTALLTYPE;
  268. #if (_WIN32_MSI >= 150)
  269. typedef struct _MSIFILEHASHINFO {
  270. ULONG dwFileHashInfoSize;
  271. ULONG dwData [ 4 ];
  272. } MSIFILEHASHINFO, *PMSIFILEHASHINFO;
  273. typedef enum tagMSIARCHITECTUREFLAGS
  274. {
  275. MSIARCHITECTUREFLAGS_X86 = 0x00000001L, // set if creating the script for i386 platform
  276. MSIARCHITECTUREFLAGS_IA64 = 0x00000002L, // set if creating the script for IA64 platform
  277. MSIARCHITECTUREFLAGS_AMD64 = 0x00000004L // set if creating the script for AMD64 platform
  278. }MSIARCHITECTUREFLAGS;
  279. typedef enum tagMSIOPENPACKAGEFLAGS
  280. {
  281. MSIOPENPACKAGEFLAGS_IGNOREMACHINESTATE = 0x00000001L, // ignore the machine state when creating the engine
  282. }MSIOPENPACKAGEFLAGS;
  283. typedef enum tagMSIADVERTISEOPTIONFLAGS
  284. {
  285. MSIADVERTISEOPTIONFLAGS_INSTANCE = 0x00000001L, // set if advertising a new instance
  286. }MSIADVERTISEOPTIONFLAGS;
  287. #endif //(_WIN32_MSI >= 150)
  288. ;begin_both
  289. #ifdef __cplusplus
  290. extern "C" {
  291. #endif
  292. ;end_both
  293. // --------------------------------------------------------------------------
  294. // Functions to set the UI handling and logging. The UI will be used for error,
  295. // progress, and log messages for all subsequent calls to Installer Service
  296. // API functions that require UI.
  297. // --------------------------------------------------------------------------
  298. // Enable internal UI
  299. INSTALLUILEVEL WINAPI MsiSetInternalUI(
  300. INSTALLUILEVEL dwUILevel, // UI level
  301. HWND *phWnd); // handle of owner window
  302. // Enable external UI handling, returns any previous handler or NULL if none.
  303. // Messages are designated with a combination of bits from INSTALLLOGMODE enum.
  304. INSTALLUI_HANDLER% WINAPI MsiSetExternalUI%(
  305. INSTALLUI_HANDLER% puiHandler, // for progress and error handling
  306. DWORD dwMessageFilter, // bit flags designating messages to handle
  307. LPVOID pvContext); // application context
  308. // Enable logging to a file for all install sessions for the client process,
  309. // with control over which log messages are passed to the specified log file.
  310. // Messages are designated with a combination of bits from INSTALLLOGMODE enum.
  311. UINT WINAPI MsiEnableLog%(
  312. DWORD dwLogMode, // bit flags designating operations to report
  313. LPCTSTR% szLogFile, // log file, or NULL to disable logging
  314. DWORD dwLogAttributes); // INSTALLLOGATTRIBUTES flags
  315. // --------------------------------------------------------------------------
  316. // Functions to query and configure a product as a whole.
  317. // --------------------------------------------------------------------------
  318. // Return the installed state for a product
  319. INSTALLSTATE WINAPI MsiQueryProductState%(
  320. LPCTSTR% szProduct);
  321. // Return product info
  322. UINT WINAPI MsiGetProductInfo%(
  323. LPCTSTR% szProduct, // product code
  324. LPCTSTR% szAttribute, // attribute name, case-sensitive
  325. LPTSTR% lpValueBuf, // returned value, NULL if not desired
  326. DWORD *pcchValueBuf); // in/out buffer character count
  327. // Install a new product.
  328. // Either may be NULL, but the DATABASE property must be specfied
  329. UINT WINAPI MsiInstallProduct%(
  330. LPCTSTR% szPackagePath, // location of package to install
  331. LPCTSTR% szCommandLine); // command line <property settings>
  332. // Install/uninstall an advertised or installed product
  333. // No action if installed and INSTALLSTATE_DEFAULT specified
  334. UINT WINAPI MsiConfigureProduct%(
  335. LPCTSTR% szProduct, // product code
  336. int iInstallLevel, // how much of the product to install
  337. INSTALLSTATE eInstallState); // local/source/default/absent/lock/uncache
  338. // Install/uninstall an advertised or installed product
  339. // No action if installed and INSTALLSTATE_DEFAULT specified
  340. UINT WINAPI MsiConfigureProductEx%(
  341. LPCTSTR% szProduct, // product code
  342. int iInstallLevel, // how much of the product to install
  343. INSTALLSTATE eInstallState, // local/source/default/absent/lock/uncache
  344. LPCTSTR% szCommandLine); // command line <property settings>
  345. // Reinstall product, used to validate or correct problems
  346. UINT WINAPI MsiReinstallProduct%(
  347. LPCTSTR% szProduct, // product code
  348. DWORD szReinstallMode); // one or more REINSTALLMODE modes
  349. #if (_WIN32_MSI >= 150)
  350. // Output reg and shortcut info to script file for specified architecture for Assign or Publish
  351. // If dwPlatform is 0, then the script is created based on the current platform (behavior of MsiAdvertiseProduct)
  352. // If dwPlatform specifies a platform, then the script is created as if the current platform is the
  353. // platform specified in dwPlatform
  354. // If dwOptions includes MSIADVERTISEOPTIONFLAGS_INSTANCE, then a new instance is advertised. Use of
  355. // this option requires that szTransforms include the instance transform that changes the product code
  356. UINT WINAPI MsiAdvertiseProductEx%(
  357. LPCTSTR% szPackagePath, // location of package
  358. LPCTSTR% szScriptfilePath, // if NULL, product is locally advertised
  359. LPCTSTR% szTransforms, // list of transforms to be applied
  360. LANGID lgidLanguage, // install language
  361. DWORD dwPlatform, // the MSIARCHITECTUREFLAGS that control for which platform
  362. // to create the script, ignored if szScriptfilePath is NULL
  363. DWORD dwOptions); // the MSIADVERTISEOPTIONSFLAGS that specify extra advertise parameters
  364. #endif // (_WIN32_MSI >= 150)
  365. // Output reg and shortcut info to script file for Assign or Publish
  366. UINT WINAPI MsiAdvertiseProduct%(
  367. LPCTSTR% szPackagePath, // location of package
  368. LPCTSTR% szScriptfilePath, // if NULL, product is locally advertised
  369. LPCTSTR% szTransforms, // list of transforms to be applied
  370. LANGID lgidLanguage); // install language
  371. #if (_WIN32_MSI >= 150)
  372. // Process advertise script file into supplied locations
  373. // If an icon folder is specified, icon files will be placed there
  374. // If an registry key is specified, registry data will be mapped under it
  375. // If fShortcuts is TRUE, shortcuts will be created. If a special folder is
  376. // returned by SHGetSpecialFolderLocation(?), it will hold the shortcuts.
  377. // if fRemoveItems is TRUE, items that are present will be removed
  378. UINT WINAPI MsiProcessAdvertiseScript%(
  379. LPCTSTR% szScriptFile, // path to script from MsiAdvertiseProduct
  380. LPCTSTR% szIconFolder, // optional path to folder for icon files and transforms
  381. HKEY hRegData, // optional parent registry key
  382. BOOL fShortcuts, // TRUE if shortcuts output to special folder
  383. BOOL fRemoveItems); // TRUE if specified items are to be removed
  384. #endif // (_WIN32_MSI >= 150)
  385. // Process advertise script file using the supplied dwFlags control flags
  386. // if fRemoveItems is TRUE, items that are present will be removed
  387. UINT WINAPI MsiAdvertiseScript%(
  388. LPCTSTR% szScriptFile, // path to script from MsiAdvertiseProduct
  389. DWORD dwFlags, // the SCRIPTFLAGS bit flags that control the script execution
  390. PHKEY phRegData, // optional parent registry key
  391. BOOL fRemoveItems); // TRUE if specified items are to be removed
  392. ;begin_internal
  393. // Return a product code for a product installed from an installer package
  394. UINT WINAPI MsiGetProductCodeFromPackageCode%(
  395. LPCTSTR% szPackageCode, // package code
  396. LPTSTR% lpProductBuf39); // buffer for product code string GUID, 39 chars
  397. ;end_internal
  398. // Return product info from an installer script file:
  399. // product code, language, version, readable name, path to package
  400. // Returns TRUE is success, FALSE if szScriptFile is not a valid script file
  401. UINT WINAPI MsiGetProductInfoFromScript%(
  402. LPCTSTR% szScriptFile, // path to installer script file
  403. LPTSTR% lpProductBuf39, // buffer for product code string GUID, 39 chars
  404. LANGID *plgidLanguage, // return language Id
  405. DWORD *pdwVersion, // return version: Maj:Min:Build <8:8:16>
  406. LPTSTR% lpNameBuf, // buffer to return readable product name
  407. DWORD *pcchNameBuf, // in/out name buffer character count
  408. LPTSTR% lpPackageBuf, // buffer for path to product package
  409. DWORD *pcchPackageBuf);// in/out path buffer character count
  410. // Return the product code for a registered component, called once by apps
  411. UINT WINAPI MsiGetProductCode%(
  412. LPCTSTR% szComponent, // component Id registered for this product
  413. LPTSTR% lpBuf39); // returned string GUID, sized for 39 characters
  414. // Return the registered user information for an installed product
  415. USERINFOSTATE WINAPI MsiGetUserInfo%(
  416. LPCTSTR% szProduct, // product code, string GUID
  417. LPTSTR% lpUserNameBuf, // return user name
  418. DWORD *pcchUserNameBuf, // in/out buffer character count
  419. LPTSTR% lpOrgNameBuf, // return company name
  420. DWORD *pcchOrgNameBuf, // in/out buffer character count
  421. LPTSTR% lpSerialBuf, // return product serial number
  422. DWORD *pcchSerialBuf); // in/out buffer character count
  423. // Obtain and store user info and PID from installation wizard (first run)
  424. UINT WINAPI MsiCollectUserInfo%(
  425. LPCTSTR% szProduct); // product code, string GUID
  426. // --------------------------------------------------------------------------
  427. // Functions to patch existing products
  428. // --------------------------------------------------------------------------
  429. // Patch all possible installed products.
  430. UINT WINAPI MsiApplyPatch%(
  431. LPCTSTR% szPatchPackage, // location of patch package
  432. LPCTSTR% szInstallPackage, // location of package for install to patch <optional>
  433. INSTALLTYPE eInstallType, // type of install to patch
  434. LPCTSTR% szCommandLine); // command line <property settings>
  435. // Return patch info
  436. UINT WINAPI MsiGetPatchInfo%(
  437. LPCTSTR% szPatch, // patch code
  438. LPCTSTR% szAttribute, // attribute name, case-sensitive
  439. LPTSTR% lpValueBuf, // returned value, NULL if not desired
  440. DWORD *pcchValueBuf); // in/out buffer character count
  441. // Enumerate all patches for a product
  442. UINT WINAPI MsiEnumPatches%(
  443. LPCTSTR% szProduct,
  444. DWORD iPatchIndex,
  445. LPTSTR% lpPatchBuf,
  446. LPTSTR% lpTransformsBuf,
  447. DWORD *pcchTransformsBuf);
  448. // --------------------------------------------------------------------------
  449. // Functions to query and configure a feature within a product.
  450. // --------------------------------------------------------------------------
  451. // Return the installed state for a product feature
  452. INSTALLSTATE WINAPI MsiQueryFeatureState%(
  453. LPCTSTR% szProduct,
  454. LPCTSTR% szFeature);
  455. // Indicate intent to use a product feature, increments usage count
  456. // Prompts for CD if not loaded, does not install feature
  457. INSTALLSTATE WINAPI MsiUseFeature%(
  458. LPCTSTR% szProduct,
  459. LPCTSTR% szFeature);
  460. // Indicate intent to use a product feature, increments usage count
  461. // Prompts for CD if not loaded, does not install feature
  462. // Allows for bypassing component detection where performance is critical
  463. INSTALLSTATE WINAPI MsiUseFeatureEx%(
  464. LPCTSTR% szProduct, // product code
  465. LPCTSTR% szFeature, // feature ID
  466. DWORD dwInstallMode, // INSTALLMODE_NODETECTION, else 0
  467. DWORD dwReserved); // reserved, must be 0
  468. // Return the usage metrics for a product feature
  469. UINT WINAPI MsiGetFeatureUsage%(
  470. LPCTSTR% szProduct, // product code
  471. LPCTSTR% szFeature, // feature ID
  472. DWORD *pdwUseCount, // returned use count
  473. WORD *pwDateUsed); // last date used (DOS date format)
  474. // Force the installed state for a product feature
  475. UINT WINAPI MsiConfigureFeature%(
  476. LPCTSTR% szProduct,
  477. LPCTSTR% szFeature,
  478. INSTALLSTATE eInstallState); // local/source/default/absent/lock/uncache
  479. // Reinstall feature, used to validate or correct problems
  480. UINT WINAPI MsiReinstallFeature%(
  481. LPCTSTR% szProduct, // product code
  482. LPCTSTR% szFeature, // feature ID, NULL for entire product
  483. DWORD dwReinstallMode); // one or more REINSTALLMODE modes
  484. // --------------------------------------------------------------------------
  485. // Functions to return a path to a particular component.
  486. // The state of the feature being used should have been checked previously.
  487. // --------------------------------------------------------------------------
  488. // Return full component path, performing any necessary installation
  489. // calls MsiQueryFeatureState to detect that all components are installed
  490. // then calls MsiConfigureFeature if any of its components are uninstalled
  491. // then calls MsiLocateComponent to obtain the path the its key file
  492. UINT WINAPI MsiProvideComponent%(
  493. LPCTSTR% szProduct, // product code in case install required
  494. LPCTSTR% szFeature, // feature ID in case install required
  495. LPCTSTR% szComponent, // component ID
  496. DWORD dwInstallMode,// either of type INSTALLMODE or a combination of the REINSTALLMODE flags
  497. LPTSTR% lpPathBuf, // returned path, NULL if not desired
  498. DWORD *pcchPathBuf);// in/out buffer character count
  499. // Return full component path for a qualified component, performing any necessary installation.
  500. // Prompts for source if necessary and increments the usage count for the feature.
  501. UINT WINAPI MsiProvideQualifiedComponent%(
  502. LPCTSTR% szCategory, // component category ID
  503. LPCTSTR% szQualifier, // specifies which component to access
  504. DWORD dwInstallMode,// either of type INSTALLMODE or a combination of the REINSTALLMODE flags
  505. LPTSTR% lpPathBuf, // returned path, NULL if not desired
  506. DWORD *pcchPathBuf); // in/out buffer character count
  507. // Return full component path for a qualified component, performing any necessary installation.
  508. // Prompts for source if necessary and increments the usage count for the feature.
  509. // The szProduct parameter specifies the product to match that has published the qualified
  510. // component. If null, this API works the same as MsiProvideQualifiedComponent.
  511. UINT WINAPI MsiProvideQualifiedComponentEx%(
  512. LPCTSTR% szCategory, // component category ID
  513. LPCTSTR% szQualifier, // specifies which component to access
  514. DWORD dwInstallMode,// either of type INSTALLMODE or a combination of the REINSTALLMODE flags
  515. LPCTSTR% szProduct, // the product code
  516. DWORD dwUnused1, // not used, must be zero
  517. DWORD dwUnused2, // not used, must be zero
  518. LPTSTR% lpPathBuf, // returned path, NULL if not desired
  519. DWORD *pcchPathBuf); // in/out buffer character count
  520. // Return full path to an installed component
  521. INSTALLSTATE WINAPI MsiGetComponentPath%(
  522. LPCTSTR% szProduct, // product code for client product
  523. LPCTSTR% szComponent, // component Id, string GUID
  524. LPTSTR% lpPathBuf, // returned path
  525. DWORD *pcchBuf); // in/out buffer character count
  526. #if (_WIN32_MSI >= 150)
  527. #define MSIASSEMBLYINFO_NETASSEMBLY 0 // Net assemblies
  528. #define MSIASSEMBLYINFO_WIN32ASSEMBLY 1 // Win32 assemblies
  529. // Return full component path for an assembly installed via the WI, performing any necessary installation.
  530. // Prompts for source if necessary and increments the usage count for the feature.
  531. // The szAssemblyName parameter specifies the stringized assembly name.
  532. // The szAppContext is the full path to the .cfg file or the app exe to which the assembly being requested
  533. // has been privatised to, which is null for global assemblies
  534. UINT WINAPI MsiProvideAssembly%(
  535. LPCTSTR% szAssemblyName, // stringized assembly name
  536. LPCTSTR% szAppContext, // specifies the full path to the parent asm's .cfg file, null for global assemblies
  537. DWORD dwInstallMode,// either of type INSTALLMODE or a combination of the REINSTALLMODE flags
  538. DWORD dwAssemblyInfo, // assembly info, including assembly type
  539. LPTSTR% lpPathBuf, // returned path, NULL if not desired
  540. DWORD *pcchPathBuf); // in/out buffer character count
  541. #endif //(_WIN32_MSI >= 150)
  542. ;begin_internal
  543. // --------------------------------------------------------------------------
  544. // Functions accepting a component descriptor, consisting of
  545. // a product code concatenated with a feature ID and component ID.
  546. // For efficiency, feature and component may be omitted if unambiguous
  547. // --------------------------------------------------------------------------
  548. // Return full component path given a fully-qualified component descriptor
  549. // separates the tokens from the descriptor and calls MsiProvideComponent
  550. UINT WINAPI MsiProvideComponentFromDescriptor%(
  551. LPCTSTR% szDescriptor, // product,feature,component info
  552. LPTSTR% lpPathBuf, // returned path, NULL if not desired
  553. DWORD *pcchPathBuf, // in/out buffer character count
  554. DWORD *pcchArgsOffset); // returned offset of args in descriptor
  555. // Force the installed state for a product feature from a descriptor
  556. UINT WINAPI MsiConfigureFeatureFromDescriptor%(
  557. LPCTSTR% szDescriptor, // product and feature, component ignored
  558. INSTALLSTATE eInstallState); // local/source/default/absent
  559. // Reinstall product or feature using a descriptor as the specification
  560. UINT WINAPI MsiReinstallFeatureFromDescriptor%(
  561. LPCTSTR% szDescriptor, // product and feature, component ignored
  562. DWORD szReinstallMode); // one or more REINSTALLMODE modes
  563. // Query a feature's state using a descriptor as the specification
  564. INSTALLSTATE WINAPI MsiQueryFeatureStateFromDescriptor%(
  565. LPCTSTR% szDescriptor); // product and feature, component ignored
  566. UINT WINAPI MsiDecomposeDescriptor%(
  567. LPCTSTR% szDescriptor,
  568. LPTSTR% szProductCode,
  569. LPTSTR% szFeatureId,
  570. LPTSTR% szComponentCode,
  571. DWORD* pcchArgsOffset);
  572. ;end_internal
  573. // --------------------------------------------------------------------------
  574. // Functions to iterate registered products, features, and components.
  575. // As with reg keys, they accept a 0-based index into the enumeration.
  576. // --------------------------------------------------------------------------
  577. // Enumerate the registered products, either installed or advertised
  578. UINT WINAPI MsiEnumProducts%(
  579. DWORD iProductIndex, // 0-based index into registered products
  580. LPTSTR% lpProductBuf); // buffer of char count: 39 (size of string GUID)
  581. #if (_WIN32_MSI >= 110)
  582. // Enumerate products with given upgrade code
  583. UINT WINAPI MsiEnumRelatedProducts%(
  584. LPCTSTR% lpUpgradeCode, // upgrade code of products to enumerate
  585. DWORD dwReserved, // reserved, must be 0
  586. DWORD iProductIndex, // 0-based index into registered products
  587. LPTSTR% lpProductBuf); // buffer of char count: 39 (size of string GUID)
  588. #endif //(_WIN32_MSI >= 110)
  589. // Enumerate the advertised features for a given product.
  590. // If parent is not required, supplying NULL will improve performance.
  591. UINT WINAPI MsiEnumFeatures%(
  592. LPCTSTR% szProduct,
  593. DWORD iFeatureIndex, // 0-based index into published features
  594. LPTSTR% lpFeatureBuf, // feature name buffer, size=MAX_FEATURE_CHARS+1
  595. LPTSTR% lpParentBuf); // parent feature buffer, size=MAX_FEATURE_CHARS+1
  596. // Enumerate the installed components for all products
  597. UINT WINAPI MsiEnumComponents%(
  598. DWORD iComponentIndex, // 0-based index into installed components
  599. LPTSTR% lpComponentBuf); // buffer of char count: 39 (size of string GUID)
  600. // Enumerate the client products for a component
  601. UINT WINAPI MsiEnumClients%(
  602. LPCTSTR% szComponent,
  603. DWORD iProductIndex, // 0-based index into client products
  604. LPTSTR% lpProductBuf); // buffer of char count: 39 (size of string GUID)
  605. // Enumerate the qualifiers for an advertised component.
  606. UINT WINAPI MsiEnumComponentQualifiers%(
  607. LPCTSTR% szComponent, // generic component ID that is qualified
  608. DWORD iIndex, // 0-based index into qualifiers
  609. LPTSTR% lpQualifierBuf, // qualifier buffer
  610. DWORD *pcchQualifierBuf, // in/out qualifier buffer character count
  611. LPTSTR% lpApplicationDataBuf, // description buffer
  612. DWORD *pcchApplicationDataBuf); // in/out description buffer character count
  613. // --------------------------------------------------------------------------
  614. // Functions to obtain product or package information.
  615. // --------------------------------------------------------------------------
  616. // Open the installation for a product to obtain detailed information
  617. UINT WINAPI MsiOpenProduct%(
  618. LPCTSTR% szProduct, // product code
  619. MSIHANDLE *hProduct); // returned product handle, must be closed
  620. // Open a product package in order to access product properties
  621. UINT WINAPI MsiOpenPackage%(
  622. LPCTSTR% szPackagePath, // path to package, or database handle: #nnnn
  623. MSIHANDLE *hProduct); // returned product handle, must be closed
  624. #if (_WIN32_MSI >= 150)
  625. // Open a product package in order to access product properties
  626. // Option to create a "safe" engine that does not look at machine state
  627. // and does not allow for modification of machine state
  628. UINT WINAPI MsiOpenPackageEx%(
  629. LPCTSTR% szPackagePath, // path to package, or database handle: #nnnn
  630. DWORD dwOptions, // options flags to indicate whether or not to ignore machine state
  631. MSIHANDLE *hProduct); // returned product handle, must be closed
  632. #endif //(_WIN32_MSI >= 150)
  633. // Provide the value for an installation property.
  634. UINT WINAPI MsiGetProductProperty%(
  635. MSIHANDLE hProduct, // product handle obtained from MsiOpenProduct
  636. LPCTSTR% szProperty, // property name, case-sensitive
  637. LPTSTR% lpValueBuf, // returned value, NULL if not desired
  638. DWORD *pcchValueBuf); // in/out buffer character count
  639. // Determine whether a file is a package
  640. // Returns ERROR_SUCCESS if file is a package.
  641. UINT WINAPI MsiVerifyPackage%(
  642. LPCTSTR% szPackagePath); // location of package
  643. // Provide descriptive information for product feature: title and description.
  644. // Returns the install level for the feature, or -1 if feature is unknown.
  645. // 0 = feature is not available on this machine
  646. // 1 = highest priority, feature installed if parent is installed
  647. // >1 = decreasing priority, feature installation based on InstallLevel property
  648. UINT WINAPI MsiGetFeatureInfo%(
  649. MSIHANDLE hProduct, // product handle obtained from MsiOpenProduct
  650. LPCTSTR% szFeature, // feature name
  651. DWORD *lpAttributes, // attribute flags for the feature, using INSTALLFEATUREATTRIBUTE
  652. LPTSTR% lpTitleBuf, // returned localized name, NULL if not desired
  653. DWORD *pcchTitleBuf, // in/out buffer character count
  654. LPTSTR% lpHelpBuf, // returned description, NULL if not desired
  655. DWORD *pcchHelpBuf); // in/out buffer character count
  656. // --------------------------------------------------------------------------
  657. // Functions to access or install missing components and files.
  658. // These should be used as a last resort.
  659. // --------------------------------------------------------------------------
  660. // Install a component unexpectedly missing, provided only for error recovery
  661. // This would typically occur due to failue to establish feature availability
  662. // The product feature having the smallest incremental cost is installed
  663. UINT WINAPI MsiInstallMissingComponent%(
  664. LPCTSTR% szProduct, // product code
  665. LPCTSTR% szComponent, // component Id, string GUID
  666. INSTALLSTATE eInstallState); // local/source/default, absent invalid
  667. // Install a file unexpectedly missing, provided only for error recovery
  668. // This would typically occur due to failue to establish feature availability
  669. // The missing component is determined from the product's File table, then
  670. // the product feature having the smallest incremental cost is installed
  671. UINT WINAPI MsiInstallMissingFile%(
  672. LPCTSTR% szProduct, // product code
  673. LPCTSTR% szFile); // file name, without path
  674. // Return full path to an installed component without a product code
  675. // This function attempts to determine the product using MsiGetProductCode
  676. // but is not guaranteed to find the correct product for the caller.
  677. // MsiGetComponentPath should always be called when possible.
  678. INSTALLSTATE WINAPI MsiLocateComponent%(
  679. LPCTSTR% szComponent, // component Id, string GUID
  680. LPTSTR% lpPathBuf, // returned path
  681. DWORD *pcchBuf); // in/out buffer character count
  682. #if (_WIN32_MSI >= 110)
  683. // --------------------------------------------------------------------------
  684. // Functions used to manage the list of valid sources.
  685. // --------------------------------------------------------------------------
  686. // Opens the list of sources for the specified user's install of the product
  687. // and removes all network sources from the list. A NULL or empty value for
  688. // the user name indicates the per-machine install.
  689. UINT WINAPI MsiSourceListClearAll%(
  690. LPCTSTR% szProduct, // product code
  691. LPCTSTR% szUserName, // user name or NULL/empty for per-machine
  692. DWORD dwReserved); // reserved - must be 0
  693. // Opens the list of sources for the specified user's install of the product
  694. // and adds the provided source as a new network source. A NULL or empty
  695. // value for the user name indicates the per-machine install.
  696. UINT WINAPI MsiSourceListAddSource%(
  697. LPCTSTR% szProduct, // product code
  698. LPCTSTR% szUserName, // user name or NULL/empty for per-machine
  699. DWORD dwReserved, // reserved - must be 0
  700. LPCTSTR% szSource); // new source
  701. // Forces the installer to reevaluate the list of sources the next time that
  702. // the specified product needs a source.
  703. UINT WINAPI MsiSourceListForceResolution%(
  704. LPCTSTR% szProduct, // product code
  705. LPCTSTR% szUserName, // user name or NULL/empty for per-machine
  706. DWORD dwReserved); // reserved - must be 0
  707. #endif //(_WIN32_MSI >= 110)
  708. // --------------------------------------------------------------------------
  709. // Utility functions
  710. // --------------------------------------------------------------------------
  711. // Give the version string and language for a specified file
  712. UINT WINAPI MsiGetFileVersion%(
  713. LPCTSTR% szFilePath, // path to the file
  714. LPTSTR% lpVersionBuf, // returned version string
  715. DWORD *pcchVersionBuf, // in/out buffer byte count
  716. LPTSTR% lpLangBuf, // returned language string
  717. DWORD *pcchLangBuf); // in/out buffer byte count
  718. #if (_WIN32_MSI >= 150)
  719. UINT WINAPI MsiGetFileHash%(
  720. LPCTSTR% szFilePath, // path to the file
  721. DWORD dwOptions, // options
  722. PMSIFILEHASHINFO pHash); // returned file hash info
  723. #endif //(_WIN32_MSI >= 150)
  724. #if (_WIN32_MSI >= 150)
  725. #ifndef _MSI_NO_CRYPTO
  726. HRESULT WINAPI MsiGetFileSignatureInformation%(
  727. LPCTSTR% szSignedObjectPath, // path to the signed object
  728. DWORD dwFlags, // special extra error case flags
  729. PCCERT_CONTEXT *ppcCertContext, // returned signer cert context
  730. BYTE *pbHashData, // returned hash buffer, NULL if not desired
  731. DWORD *pcbHashData); // in/out buffer byte count
  732. // By default, when only requesting the certificate context, an invalid hash
  733. // in the digital signature is not a fatal error. Set this flag in the dwFlags
  734. // parameter to make the TRUST_E_BAD_DIGEST error fatal.
  735. #define MSI_INVALID_HASH_IS_FATAL 0x1
  736. #endif// _MSI_NO_CRYPTO
  737. #endif //(_WIN32_MSI >= 150)
  738. #if (_WIN32_MSI >= 110)
  739. // examine a shortcut, and retrieve its descriptor information
  740. // if available.
  741. UINT WINAPI MsiGetShortcutTarget%(
  742. LPCTSTR% szShortcutPath, // full file path for the shortcut
  743. LPTSTR% szProductCode, // returned product code - GUID
  744. LPTSTR% szFeatureId, // returned Feature Id.
  745. LPTSTR% szComponentCode); // returned component code - GUID
  746. #endif //(_WIN32_MSI >= 110)
  747. #if (_WIN32_MSI >= 110)
  748. // checks to see if a product is managed
  749. // checks per-machine if called from system context, per-user if from
  750. // user context
  751. UINT WINAPI MsiIsProductElevated%(
  752. LPCTSTR% szProduct, // product code
  753. BOOL *pfElevated); // result
  754. #endif //(_WIN32_MSI >= 110)
  755. ;begin_internal
  756. // Load a string resource, preferring a specified language
  757. // Behaves like LoadString if 0 passed as language
  758. // Truncates string as necessary to fit into buffer (like LoadString)
  759. // Returns the codepage of the string, or 0 if string is not found
  760. UINT WINAPI MsiLoadString%(
  761. HINSTANCE hInstance, // handle of module containing string resource
  762. UINT uID, // resource identifier
  763. LPTSTR% lpBuffer, // address of buffer for resource
  764. int nBufferMax, // size of buffer
  765. WORD wLanguage); // preferred resource language
  766. // MessageBox implementation that allows language information to be specified
  767. // MB_SYSTEMMODAL and MB_TASKMODAL are not supported, modality handled by parent hWnd
  768. // If no parent window is specified, the current context window will be used,
  769. // which is itself parented to the window set by SetInternalUI.
  770. int WINAPI MsiMessageBox%(
  771. HWND hWnd, // parent window handle, 0 to use that of current context
  772. LPCTSTR% lpText, // message text
  773. LPCTSTR% lpCaption, // caption, must be neutral or in system codepage
  774. UINT uiType, // standard MB types, icons, and def buttons
  775. UINT uiCodepage, // codepage of message text, used to set font charset
  776. LANGID iLangId); // language to use for button text
  777. #if (_WIN32_MSI >= 150)
  778. // Creates the %systemroot%\Installer directory with secure ACLs
  779. // Verifies the ownership of the %systemroot%\Installer directory if it exists
  780. // If ownership is not system or admin, the directory is deleted and recreated
  781. // dwReserved is for future use and must be 0
  782. UINT WINAPI MsiCreateAndVerifyInstallerDirectory(DWORD dwReserved);
  783. #endif //(_WIN32_MSI >= 150)
  784. ;end_internal
  785. ;begin_internal
  786. #if (_WIN32_MSI >= 150)
  787. // Caller notifies us of a user who's been moved and results sid change. This
  788. // internal API is only called by LoadUserProfile.
  789. UINT WINAPI MsiNotifySidChange%(LPCTSTR% pOldSid,
  790. LPCTSTR% pNewSid);
  791. #endif //(_WIN32_MSI >= 150)
  792. ;end_internal
  793. ;begin_internal
  794. #if (_WIN32_MSI >= 150)
  795. // Called by DeleteProfile to clean up MSI data when cleaning up a user's
  796. // profile.
  797. UINT WINAPI MsiDeleteUserData%(LPCTSTR% pSid,
  798. LPCTSTR% pComputerName,
  799. LPVOID pReserved);
  800. #endif //(_WIN32_MSI >= 150)
  801. ;end_internal
  802. // --------------------------------------------------------------------------
  803. // Internal state migration APIs.
  804. // --------------------------------------------------------------------------
  805. ;begin_internal
  806. #if (_WIN32_MSI >= 150)
  807. DWORD WINAPI Migrate10CachedPackages%(
  808. LPCTSTR% szProductCode, // Product Code GUID to migrate
  809. LPCTSTR% szUser, // Domain\User to migrate packages for
  810. LPCTSTR% szAlternativePackage, // Package to cache if one can't be automatically found - recommended
  811. const MIGRATIONOPTIONS migOptions); // Options for re-caching.
  812. #endif //(_WIN32_MSI >= 150)
  813. ;end_internal
  814. ;begin_both
  815. #ifdef __cplusplus
  816. }
  817. #endif
  818. ;end_both
  819. // --------------------------------------------------------------------------
  820. // Error codes for installer access functions - until merged to winerr.h
  821. // --------------------------------------------------------------------------
  822. #ifndef ERROR_INSTALL_FAILURE
  823. #define ERROR_INSTALL_USEREXIT 1602L // User cancel installation.
  824. #define ERROR_INSTALL_FAILURE 1603L // Fatal error during installation.
  825. #define ERROR_INSTALL_SUSPEND 1604L // Installation suspended, incomplete.
  826. // LOCALIZE BEGIN:
  827. #define ERROR_UNKNOWN_PRODUCT 1605L // This action is only valid for products that are currently installed.
  828. // LOCALIZE END
  829. #define ERROR_UNKNOWN_FEATURE 1606L // Feature ID not registered.
  830. #define ERROR_UNKNOWN_COMPONENT 1607L // Component ID not registered.
  831. #define ERROR_UNKNOWN_PROPERTY 1608L // Unknown property.
  832. #define ERROR_INVALID_HANDLE_STATE 1609L // Handle is in an invalid state.
  833. // LOCALIZE BEGIN:
  834. #define ERROR_BAD_CONFIGURATION 1610L // The configuration data for this product is corrupt. Contact your support personnel.
  835. // LOCALIZE END:
  836. #define ERROR_INDEX_ABSENT 1611L // Component qualifier not present.
  837. // LOCALIZE BEGIN:
  838. #define ERROR_INSTALL_SOURCE_ABSENT 1612L // The installation source for this product is not available. Verify that the source exists and that you can access it.
  839. // LOCALIZE END
  840. #define ERROR_PRODUCT_UNINSTALLED 1614L // Product is uninstalled.
  841. #define ERROR_BAD_QUERY_SYNTAX 1615L // SQL query syntax invalid or unsupported.
  842. #define ERROR_INVALID_FIELD 1616L // Record field does not exist.
  843. #endif
  844. // LOCALIZE BEGIN:
  845. #ifndef ERROR_INSTALL_SERVICE_FAILURE
  846. #define ERROR_INSTALL_SERVICE_FAILURE 1601L // The Windows Installer Service could not be accessed. This can occur if you are running Windows in safe mode, or if the Windows Installer is not correctly installed. Contact your support personnel for assistance.
  847. #define ERROR_INSTALL_PACKAGE_VERSION 1613L // This installation package cannot be installed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service.
  848. #define ERROR_INSTALL_ALREADY_RUNNING 1618L // Another installation is already in progress. Complete that installation before proceeding with this install.
  849. #define ERROR_INSTALL_PACKAGE_OPEN_FAILED 1619L // This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.
  850. #define ERROR_INSTALL_PACKAGE_INVALID 1620L // This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package.
  851. #define ERROR_INSTALL_UI_FAILURE 1621L // There was an error starting the Windows Installer service user interface. Contact your support personnel.
  852. #define ERROR_INSTALL_LOG_FAILURE 1622L // Error opening installation log file. Verify that the specified log file location exists and is writable.
  853. #define ERROR_INSTALL_LANGUAGE_UNSUPPORTED 1623L // This language of this installation package is not supported by your system.
  854. #define ERROR_INSTALL_PACKAGE_REJECTED 1625L // The system administrator has set policies to prevent this installation.
  855. // LOCALIZE END
  856. #define ERROR_FUNCTION_NOT_CALLED 1626L // Function could not be executed.
  857. #define ERROR_FUNCTION_FAILED 1627L // Function failed during execution.
  858. #define ERROR_INVALID_TABLE 1628L // Invalid or unknown table specified.
  859. #define ERROR_DATATYPE_MISMATCH 1629L // Data supplied is of wrong type.
  860. #define ERROR_UNSUPPORTED_TYPE 1630L // Data of this type is not supported.
  861. // LOCALIZE BEGIN:
  862. #define ERROR_CREATE_FAILED 1631L // The Windows Installer service failed to start. Contact your support personnel.
  863. // LOCALIZE END:
  864. #endif
  865. // LOCALIZE BEGIN:
  866. #ifndef ERROR_INSTALL_TEMP_UNWRITABLE
  867. #define ERROR_INSTALL_TEMP_UNWRITABLE 1632L // The Temp folder is on a drive that is full or is inaccessible. Free up space on the drive or verify that you have write permission on the Temp folder.
  868. #endif
  869. #ifndef ERROR_INSTALL_PLATFORM_UNSUPPORTED
  870. #define ERROR_INSTALL_PLATFORM_UNSUPPORTED 1633L // This installation package is not supported by this processor type. Contact your product vendor.
  871. #endif
  872. // LOCALIZE END
  873. #ifndef ERROR_INSTALL_NOTUSED
  874. #define ERROR_INSTALL_NOTUSED 1634L // Component not used on this machine
  875. #endif
  876. // LOCALIZE BEGIN:
  877. #ifndef ERROR_INSTALL_TRANSFORM_FAILURE
  878. #define ERROR_INSTALL_TRANSFORM_FAILURE 1624L // Error applying transforms. Verify that the specified transform paths are valid.
  879. #endif
  880. #ifndef ERROR_PATCH_PACKAGE_OPEN_FAILED
  881. #define ERROR_PATCH_PACKAGE_OPEN_FAILED 1635L // This patch package could not be opened. Verify that the patch package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer patch package.
  882. #define ERROR_PATCH_PACKAGE_INVALID 1636L // This patch package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer patch package.
  883. #define ERROR_PATCH_PACKAGE_UNSUPPORTED 1637L // This patch package cannot be processed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service.
  884. #endif
  885. #ifndef ERROR_PRODUCT_VERSION
  886. #define ERROR_PRODUCT_VERSION 1638L // Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.
  887. #endif
  888. #ifndef ERROR_INVALID_COMMAND_LINE
  889. #define ERROR_INVALID_COMMAND_LINE 1639L // Invalid command line argument. Consult the Windows Installer SDK for detailed command line help.
  890. #endif
  891. // The following three error codes are not returned from MSI version 1.0
  892. #ifndef ERROR_INSTALL_REMOTE_DISALLOWED
  893. #define ERROR_INSTALL_REMOTE_DISALLOWED 1640L // Only administrators have permission to add, remove, or configure server software during a Terminal services remote session. If you want to install or configure software on the server, contact your network administrator.
  894. #endif
  895. // LOCALIZE END
  896. #ifndef ERROR_SUCCESS_REBOOT_INITIATED
  897. #define ERROR_SUCCESS_REBOOT_INITIATED 1641L // The requested operation completed successfully. The system will be restarted so the changes can take effect.
  898. #endif
  899. // LOCALIZE BEGIN:
  900. #ifndef ERROR_PATCH_TARGET_NOT_FOUND
  901. #define ERROR_PATCH_TARGET_NOT_FOUND 1642L // The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch.
  902. #endif
  903. // LOCALIZE END
  904. // The following two error codes are not returned from MSI version 1.0, 1.1. or 1.2
  905. // LOCALIZE BEGIN:
  906. #ifndef ERROR_PATCH_PACKAGE_REJECTED
  907. #define ERROR_PATCH_PACKAGE_REJECTED 1643L // The patch package is not permitted by software restriction policy.
  908. #endif
  909. #ifndef ERROR_INSTALL_TRANSFORM_REJECTED
  910. #define ERROR_INSTALL_TRANSFORM_REJECTED 1644L // One or more customizations are not permitted by software restriction policy.
  911. #endif
  912. // LOCALIZE END
  913. // The following error code is returned only from MSI post version 2.0
  914. // LOCALIZE BEGIN:
  915. #ifndef ERROR_INSTALL_REMOTE_PROHIBITED
  916. #define ERROR_INSTALL_REMOTE_PROHIBITED 1645L // The Windows Installer does not permit installation from a Remote Desktop Connection.
  917. #endif
  918. // LOCALIZE END
  919. #endif // _MSI_H_
  920. #endif // _MSIP_H_ ;internal