msi: Add support for patching files.
[wine] / dlls / msi / msiserver.idl
1 /*
2  * Copyright (C) 2007 Mike McCormack
3  * Copyright (C) 2007 Misha Koshelev
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  */
19
20 #include "msiserver_dispids.h"
21 import "unknwn.idl";
22 import "wtypes.idl";
23 import "objidl.idl";
24 import "oaidl.idl";
25
26 cpp_quote("#if 0")
27 typedef unsigned long MSIHANDLE;
28 typedef int INSTALLMESSAGE;
29 typedef int MSICONDITION;
30 typedef int MSIRUNMODE;
31 typedef int INSTALLSTATE;
32 cpp_quote("#endif")
33
34 [
35     uuid(7BDE2046-D03B-4ffc-B84C-A098F38CFF0B),
36     oleautomation,
37     object
38 ]
39 interface IWineMsiRemoteDatabase : IUnknown
40 {
41     HRESULT IsTablePersistent( [in] LPCWSTR table, [out] MSICONDITION *persistent );
42     HRESULT GetPrimaryKeys( [in] LPCWSTR table, [out] MSIHANDLE *keys );
43     HRESULT GetSummaryInformation( [in] UINT updatecount, [out] MSIHANDLE *suminfo );
44     HRESULT OpenView( [in] LPCWSTR query, [out] MSIHANDLE *view );
45     HRESULT SetMsiHandle( [in] MSIHANDLE handle );
46 }
47
48 [
49     uuid(902B3592-9D08-4dfd-A593-D07C52546421),
50     oleautomation,
51     object
52 ]
53 interface IWineMsiRemotePackage : IUnknown
54 {
55     HRESULT SetMsiHandle( [in] MSIHANDLE handle );
56     HRESULT GetActiveDatabase( [out] MSIHANDLE *handle );
57     HRESULT GetProperty( [in] BSTR property, [out] BSTR *value, [out] DWORD *size );
58     HRESULT SetProperty( [in] BSTR property, [in] BSTR value );
59     HRESULT ProcessMessage( [in] INSTALLMESSAGE message, [in] MSIHANDLE record );
60     HRESULT DoAction( [in] BSTR action );
61     HRESULT Sequence( [in] BSTR table, [in] int sequence );
62     HRESULT GetTargetPath( [in] BSTR folder, [out] BSTR *value, [out] DWORD *size );
63     HRESULT SetTargetPath( [in] BSTR folder, [in] BSTR value );
64     HRESULT GetSourcePath( [in] BSTR folder, [out] BSTR *value, [out] DWORD *size );
65     HRESULT GetMode( [in] MSIRUNMODE mode, [out] BOOL *ret );
66     HRESULT SetMode( [in] MSIRUNMODE mode, [in] BOOL state );
67     HRESULT GetFeatureState( [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
68     HRESULT SetFeatureState( [in] BSTR feature, [in] INSTALLSTATE state );
69     HRESULT GetComponentState( [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
70     HRESULT SetComponentState( [in] BSTR component, [in] INSTALLSTATE state );
71     HRESULT GetLanguage( [out] LANGID *language );
72     HRESULT SetInstallLevel( [in] int level );
73     HRESULT FormatRecord( [in] MSIHANDLE record, [out] BSTR *value );
74     HRESULT EvaluateCondition( [in] BSTR condition );
75     HRESULT GetFeatureCost( [in] BSTR feature, [in] INT cost_tree, [in] INSTALLSTATE state, [out] INT *cost);
76 }
77
78 [
79     uuid(56D58B64-8780-4c22-A8BC-8B0B29E4A9F8),
80     oleautomation,
81     object
82 ]
83 interface IWineMsiRemoteCustomAction : IUnknown
84 {
85     HRESULT GetActionInfo( [in] LPCGUID guid, [out] INT *type, [out] MSIHANDLE *handle, [out] BSTR *dllname,
86                            [out] BSTR *function, [out] IWineMsiRemotePackage **package );
87 }
88
89 [
90     uuid(000c101c-0000-0000-c000-000000000046),
91     oleautomation,
92     object
93 ]
94 interface IMsiServer : IUnknown
95 {
96     /* FIXME: methods */
97 }
98
99 [
100     uuid(000c101d-0000-0000-c000-000000000046),
101     oleautomation,
102     object
103 ]
104 interface IMsiMessage : IUnknown
105 {
106     /* FIXME: methods */
107 }
108
109 [
110     uuid(000c1025-0000-0000-c000-000000000046),
111     oleautomation,
112     object
113 ]
114 interface IMsiCustomAction : IUnknown
115 {
116     /* FIXME: methods */
117 }
118
119 [
120     uuid(000c1033-0000-0000-c000-000000000046),
121     oleautomation,
122     object
123 ]
124 interface IMsiRemoteAPI : IUnknown
125 {
126     /* FIXME: methods */
127 }
128
129 [
130     helpstring("Msi install server"),
131     progid("IMsiServer"),
132     uuid(000c101c-0000-0000-c000-000000000046)
133 ]
134 coclass MsiServer { interface IMsiServer; }
135
136 [
137     helpstring("Microsoft Windows Installer Message RPC"),
138     progid("WindowsInstaller.Message"),
139     uuid(000c101d-0000-0000-c000-000000000046)
140 ]
141 coclass MsiServerMessage { interface IMsiMessage; }
142
143 [
144     threading(both),
145     uuid(000c103e-0000-0000-c000-000000000046)
146 ]
147 coclass PSFactoryBuffer { interface IPSFactoryBuffer; }
148
149 [
150     uuid(000c1082-0000-0000-c000-000000000046)
151 ]
152 coclass MsiTransform { }
153
154 [
155     uuid(000c1084-0000-0000-c000-000000000046)
156 ]
157 coclass MsiDatabase { }
158
159 [
160     uuid(000c1086-0000-0000-c000-000000000046)
161 ]
162 coclass MsiPatch { }
163
164 [
165     threading(apartment),
166     uuid(000c1094-0000-0000-c000-000000000046)
167 ]
168 /* FIXME: unidentified class */
169 coclass MsiServerX3 { interface IMsiServer; }
170
171 [
172     uuid(ba26e6fa-4f27-4f56-953a-3f90272018aa)
173 ]
174 coclass WineMsiRemoteCustomAction { interface WineMsiRemoteCustomAction; }
175
176 [
177     uuid(902b3592-9d08-4dfd-a593-d07c52546421)
178 ]
179 coclass WineMsiRemotePackage { interface WineMsiRemotePackage; }
180
181
182 [ uuid(000C1092-0000-0000-C000-000000000046), version(1.0) ]
183 library WindowsInstaller
184 {
185     dispinterface Installer;
186     dispinterface Record;
187     dispinterface Session;
188     dispinterface Database;
189     dispinterface SummaryInfo;
190     dispinterface View;
191     dispinterface UIPreview;
192     dispinterface FeatureInfo;
193     dispinterface RecordList;
194     dispinterface StringList;
195     dispinterface Product;
196     dispinterface Patch;
197
198     typedef enum {
199         msiInstallStateNotUsed = -7,
200         msiInstallStateBadConfig = -6,
201         msiInstallStateIncomplete = -5,
202         msiInstallStateSourceAbsent = -4,
203         msiInstallStateInvalidArg = -2,
204         msiInstallStateUnknown = -1,
205         msiInstallStateBroken = 0,
206         msiInstallStateAdvertised = 1,
207         msiInstallStateRemoved = 1,
208         msiInstallStateAbsent = 2,
209         msiInstallStateLocal = 3,
210         msiInstallStateSource = 4,
211         msiInstallStateDefault = 5
212     } MsiInstallState;
213
214     typedef enum {
215         msiOpenDatabaseModeReadOnly = 0,
216         msiOpenDatabaseModeTransact = 1,
217         msiOpenDatabaseModeDirect = 2,
218         msiOpenDatabaseModeCreate = 3,
219         msiOpenDatabaseModeCreateDirect = 4,
220         msiOpenDatabaseModePatchFile = 32
221     } MsiOpenDatabaseMode;
222
223     typedef enum {
224         msiUILevelNoChange = 0,
225         msiUILevelDefault = 1,
226         msiUILevelNone = 2,
227         msiUILevelBasic = 3,
228         msiUILevelReduced = 4,
229         msiUILevelFull = 5,
230         msiUILevelHideCancel = 32,
231         msiUILevelProgressOnly = 64,
232         msiUILevelEndDialog = 128,
233         msiUILevelSourceResOnly = 256
234     } MsiUILevel;
235
236     [ uuid(000C1090-0000-0000-C000-000000000046) ]
237     dispinterface Installer
238     {
239     properties:
240         [id(DISPID_INSTALLER_UILEVEL)]
241             MsiUILevel UILevel;
242     methods:
243         [id(DISPID_INSTALLER_CREATERECORD)]
244             Record *CreateRecord([in] long Count);
245         [id(DISPID_INSTALLER_OPENPACKAGE)]
246             Session* OpenPackage(
247                 [in] VARIANT PackagePath,
248                 [in, optional, defaultvalue(0)] long Options);
249         [id(DISPID_INSTALLER_OPENPRODUCT)]
250             Session* OpenProduct(
251                 [in] BSTR ProductCode);
252         [id(DISPID_INSTALLER_SUMMARYINFORMATION)]
253             SummaryInfo* SummaryInformation(
254                 [in] BSTR PackagePath,
255                 [in, optional, defaultvalue(0)] long UpdateCount);
256         [id(DISPID_INSTALLER_OPENDATABASE)]
257             Database *OpenDatabase(
258                     [in] BSTR DatabasePath,
259                     [in] VARIANT OpenMode);
260         [id(DISPID_INSTALLER_ENABLELOG)]
261             void EnableLog(
262                     [in] BSTR LogMode,
263                     [in] BSTR LogFile);
264         [id(DISPID_INSTALLER_INSTALLPRODUCT)]
265             void InstallProduct(
266                 [in] BSTR PackagePath,
267                 [in, optional, defaultvalue("0")] BSTR PropertyValues);
268         [id(DISPID_INSTALLER_VERSION)]
269             BSTR Version();
270         [id(DISPID_INSTALLER_LASTERRORRECORD)]
271             Record* LastErrorRecord();
272         [id(DISPID_INSTALLER_REGISTRYVALUE), propget]
273             BSTR RegistryValue(
274                 [in] VARIANT Root,
275                 [in] BSTR Key,
276                 [in, optional] VARIANT Value);
277         [id(DISPID_INSTALLER_ENVIRONMENT), propget]
278             BSTR Environment([in] BSTR Variable);
279         [id(DISPID_INSTALLER_ENVIRONMENT), propput]
280             void Environment(
281                 [in] BSTR Variable,
282                 [in] BSTR rhs);
283         [id(DISPID_INSTALLER_FILEATTRIBUTES)]
284             long FileAttributes([in] BSTR FilePath);
285         [id(DISPID_INSTALLER_FILESIZE)]
286             long FileSize([in] BSTR FilePath);
287         [id(DISPID_INSTALLER_FILEVERSION)]
288             BSTR FileVersion(
289                 [in] BSTR FilePath,
290                 [in, optional] VARIANT Language);
291         [id(DISPID_INSTALLER_PRODUCTSTATE), propget]
292             MsiInstallState ProductState(
293                 [in] BSTR Product);
294         [id(DISPID_INSTALLER_PRODUCTINFO), propget]
295             BSTR ProductInfo(
296                 [in] BSTR Product,
297                 [in] BSTR Attribute);
298         [id(DISPID_INSTALLER_PRODUCTS), propget]
299             StringList *Products();
300         [id(DISPID_INSTALLER_RELATEDPRODUCTS), propget]
301             StringList *RelatedProducts(
302                 [in] BSTR UpgradeCode);
303     }
304
305     [ uuid(000C1093-0000-0000-C000-000000000046) ]
306     dispinterface Record
307     {
308     properties:
309     methods:
310         [id(DISPID_RECORD_STRINGDATA), propget]
311             BSTR StringData([in] long Field);
312         [id(DISPID_RECORD_STRINGDATA), propput]
313             void StringData(
314                 [in] long Field,
315                 [in] BSTR rhs);
316         [id(DISPID_RECORD_INTEGERDATA), propget]
317             long IntegerData([in] long Field);
318         [id(DISPID_RECORD_INTEGERDATA), propput]
319             void IntegerData(
320                 [in] long Field,
321                 [in] long rhs);
322         [id(DISPID_RECORD_FIELDCOUNT), propget]
323             long FieldCount();
324     }
325
326     [ uuid(000C1095-0000-0000-C000-000000000046) ]
327     dispinterface StringList
328     {
329         properties:
330         methods:
331         [id(DISPID_LIST__NEWENUM)]
332             IUnknown _NewEnum();
333         [id(DISPID_LIST_ITEM), propget]
334             BSTR Item(long Index);
335         [id(DISPID_LIST_COUNT), propget]
336             long Count();
337     }
338
339     [ uuid(000C1096-0000-0000-C000-000000000046) ]
340     dispinterface RecordList
341     {
342         properties:
343         methods:
344     }
345
346     [ uuid(000C109A-0000-0000-C000-000000000046) ]
347     dispinterface UIPreview
348     {
349         properties:
350         methods:
351     }
352
353     [ uuid(000C109B-0000-0000-C000-000000000046) ]
354     dispinterface SummaryInfo
355     {
356         properties:
357         methods:
358         [id(DISPID_SUMMARYINFO_PROPERTY), propget]
359             VARIANT Property([in] long Pid);
360         [id(DISPID_SUMMARYINFO_PROPERTY), propput]
361             void Property(
362                 [in] long Pid,
363                 [in] VARIANT rhs);
364         [id(DISPID_SUMMARYINFO_PROPERTYCOUNT), propget]
365             long PropertyCount();
366     }
367
368     typedef enum {
369         msiViewModifySeek = -1,
370         msiViewModifyRefresh = 0,
371         msiViewModifyInsert = 1,
372         msiViewModifyUpdate = 2,
373         msiViewModifyAssign = 3,
374         msiViewModifyReplace = 4,
375         msiViewModifyMerge = 5,
376         msiViewModifyDelete = 6,
377         msiViewModifyInsertTemporary = 7,
378         msiViewModifyValidate = 8,
379         msiViewModifyValidateNew = 9,
380         msiViewModifyValidateField = 10,
381         msiViewModifyValidateDelete = 11,
382     } _MsiViewModify;                                /* Added underscore to avoid conflict with function name */
383
384     [ uuid(000C109C-0000-0000-C000-000000000046) ]
385     dispinterface View
386     {
387         properties:
388         methods:
389         [id(DISPID_VIEW_EXECUTE)]
390             void Execute([in, optional, defaultvalue(0)] Record *Params);
391         [id(DISPID_VIEW_FETCH)]
392             Record* Fetch();
393         [id(DISPID_VIEW_MODIFY)]
394             void Modify(
395                 [in] _MsiViewModify Mode,
396                 Record *Record);
397         [id(DISPID_VIEW_CLOSE)]
398             void Close();
399     }
400
401     [ uuid(000C109D-0000-0000-C000-000000000046) ]
402     dispinterface Database
403     {
404         properties:
405         methods:
406         [id(DISPID_DATABASE_OPENVIEW)]
407             View* OpenView([in] BSTR Sql);
408         [id(DISPID_DATABASE_SUMMARYINFORMATION), propget]
409             SummaryInfo *SummaryInformation([in, optional, defaultvalue(0)] long UpdateCount);
410     }
411
412     typedef enum {
413         msiDoActionStatusNoAction = 0,
414         msiDoActionStatusSuccess = 1,
415         msiDoActionStatusUserExit = 2,
416         msiDoActionStatusFailure = 3,
417         msiDoActionStatusSuspend = 4,
418         msiDoActionStatusFinished = 5,
419         msiDoActionStatusWrongState = 6,
420         msiDoActionStatusBadActionData = 7
421     } MsiDoActionStatus;
422
423     typedef enum {
424         msiRunModeAdmin = 0,
425         msiRunModeAdvertise = 1,
426         msiRunModeMaintenance = 2,
427         msiRunModeRollbackEnabled = 3,
428         msiRunModeLogEnabled = 4,
429         msiRunModeOperations = 5,
430         msiRunModeRebootAtEnd = 6,
431         msiRunModeRebootNow = 7,
432         msiRunModeCabinet = 8,
433         msiRunModeSourceShortNames = 9,
434         msiRunModeTargetShortNames = 10,
435         msiRunModeWindows9x = 12,
436         msiRunModeZawEnabled = 13,
437         msiRunModeScheduled = 16,
438         msiRunModeRollback = 17,
439         msiRunModeCommit = 18
440     } MsiRunMode;
441
442     typedef enum {
443         msiEvaluateConditionFalse = 0,
444         msiEvaluateConditionTrue = 1,
445         msiEvaluateConditionNone = 2,
446         msiEvaluateConditionError = 3
447     } _MsiEvaluateCondition;           /* Added underscore to avoid conflict with function name */
448
449     typedef enum {
450         msiMessageStatusError = -1,
451         msiMessageStatusNone = 0,
452         msiMessageStatusOk = 1,
453         msiMessageStatusCancel = 2,
454         msiMessageStatusAbort = 3,
455         msiMessageStatusRetry = 4,
456         msiMessageStatusIgnore = 5,
457         msiMessageStatusYes = 6,
458         msiMessageStatusNo = 7
459     } MsiMessageStatus;
460
461     typedef enum {
462         msiMessageTypeFatalExit = 0,
463         msiMessageTypeError          = 0x01000000,
464         msiMessageTypeWarning        = 0x02000000,
465         msiMessageTypeUser           = 0x03000000,
466         msiMessageTypeInfo           = 0x04000000,
467         msiMessageTypeFilesInUse     = 0x05000000,
468         msiMessageTypeResolveSource  = 0x06000000,
469         msiMessageTypeOutOfDiskSpace = 0x07000000,
470         msiMessageTypeActionStart    = 0x08000000,
471         msiMessageTypeActionData     = 0x09000000,
472         msiMessageTypeProgress       = 0x0a000000,
473         msiMessageTypeCommonData     = 0x0b000000,
474         msiMessageTypeOk = 0,
475         msiMessageTypeOkCancel = 1,
476         msiMessageTypeAbortRetryIgnore = 2,
477         msiMessageTypeYesNoCancel = 3,
478         msiMessageTypeYesNo = 4,
479         msiMessageTypeRetryCancel = 5,
480         msiMessageTypeDefault1 = 0,
481         msiMessageTypeDefault2 = 256,
482         msiMessageTypeDefault3 = 512
483     } MsiMessageType;
484
485     [ uuid(000C109E-0000-0000-C000-000000000046) ]
486     dispinterface Session
487     {
488     properties:
489     methods:
490         [id(DISPID_SESSION_INSTALLER), propget]
491             Installer *Installer();
492         [id(DISPID_SESSION_PROPERTY), propget]
493             BSTR Property([in] BSTR Name);
494         [id(DISPID_SESSION_PROPERTY), propput]
495             void Property(
496                 [in] BSTR Name,
497                 [in] BSTR rhs);
498         [id(DISPID_SESSION_LANGUAGE), propget]
499             long Language();
500         [id(DISPID_SESSION_MODE), propget]
501             VARIANT_BOOL Mode([in] MsiRunMode Flag);
502         [id(DISPID_SESSION_MODE), propput]
503             void Mode(
504                 [in] MsiRunMode Flag,
505                 [in] VARIANT_BOOL rhs);
506         [id(DISPID_SESSION_DATABASE), propget]
507             Database* Database();
508         [id(DISPID_SESSION_DOACTION)]
509             MsiDoActionStatus DoAction([in] BSTR Action);
510         [id(DISPID_SESSION_EVALUATECONDITION)]
511             _MsiEvaluateCondition EvaluateCondition([in] BSTR Expression);
512         [id(DISPID_SESSION_MESSAGE)]
513             MsiMessageStatus Message(
514                 [in] MsiMessageType Kind,
515                 [in] Record *Record);
516         [id(DISPID_SESSION_FEATURECURRENTSTATE), propget]
517             MsiInstallState FeatureCurrentState([in] BSTR Feature);
518         [id(DISPID_SESSION_FEATUREREQUESTSTATE), propget]
519             MsiInstallState FeatureRequestState([in] BSTR Feature);
520         [id(DISPID_SESSION_FEATUREREQUESTSTATE), propput]
521             void FeatureRequestState(
522                 [in] BSTR Feature,
523                 [in] MsiInstallState rhs);
524         [id(DISPID_SESSION_SETINSTALLLEVEL)]
525             void SetInstallLevel([in] long Level);
526     }
527
528     [ uuid(000C109F-0000-0000-C000-000000000046) ]
529     dispinterface FeatureInfo
530     {
531         properties:
532         methods:
533     }
534
535     [ uuid(000C10A0-0000-0000-C000-000000000046) ]
536     dispinterface Product
537     {
538         properties:
539         methods:
540     }
541
542     [ uuid(000C10A1-0000-0000-C000-000000000046) ]
543     dispinterface Patch
544     {
545         properties:
546         methods:
547     }
548
549     [
550        helpstring("Microsoft Windows Installer"),
551        threading(apartment),
552        progid("WindowsInstaller.Installer"),
553        uuid(000c1090-0000-0000-c000-000000000046)
554     ]
555     coclass MsiInstaller { interface Installer; }
556 }