atl80: Added AtlComModuleRegisterServer implementation (based on AtlModuleRegisterSer...
[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, size_is(*size)] BSTR value, [in, 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, size_is(*size)] BSTR value, [in, out] DWORD *size );
63     HRESULT SetTargetPath( [in] BSTR folder, [in] BSTR value );
64     HRESULT GetSourcePath( [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, 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     HRESULT EnumComponentCosts( [in] BSTR component, [in] DWORD index, [in] INSTALLSTATE state,
77                                 [out, size_is(*buflen)] BSTR drive, [in, out] DWORD *buflen, [out] INT *cost, [out] INT *temp );
78 }
79
80 [
81     uuid(56D58B64-8780-4c22-A8BC-8B0B29E4A9F8),
82     oleautomation,
83     object
84 ]
85 interface IWineMsiRemoteCustomAction : IUnknown
86 {
87     HRESULT GetActionInfo( [in] LPCGUID guid, [out] INT *type, [out] MSIHANDLE *handle, [out] BSTR *dllname,
88                            [out] BSTR *function, [out] IWineMsiRemotePackage **package );
89 }
90
91 [
92     uuid(000c101c-0000-0000-c000-000000000046),
93     oleautomation,
94     object
95 ]
96 interface IMsiServer : IUnknown
97 {
98     /* FIXME: methods */
99 }
100
101 [
102     uuid(000c101d-0000-0000-c000-000000000046),
103     oleautomation,
104     object
105 ]
106 interface IMsiMessage : IUnknown
107 {
108     /* FIXME: methods */
109 }
110
111 [
112     uuid(000c1025-0000-0000-c000-000000000046),
113     oleautomation,
114     object
115 ]
116 interface IMsiCustomAction : IUnknown
117 {
118     /* FIXME: methods */
119 }
120
121 [
122     uuid(000c1033-0000-0000-c000-000000000046),
123     oleautomation,
124     object
125 ]
126 interface IMsiRemoteAPI : IUnknown
127 {
128     /* FIXME: methods */
129 }
130
131 [
132     helpstring("Msi install server"),
133     progid("IMsiServer"),
134     uuid(000c101c-0000-0000-c000-000000000046)
135 ]
136 coclass MsiServer { interface IMsiServer; }
137
138 [
139     helpstring("Microsoft Windows Installer Message RPC"),
140     progid("WindowsInstaller.Message"),
141     uuid(000c101d-0000-0000-c000-000000000046)
142 ]
143 coclass MsiServerMessage { interface IMsiMessage; }
144
145 [
146     threading(both),
147     uuid(000c103e-0000-0000-c000-000000000046)
148 ]
149 coclass PSFactoryBuffer { interface IPSFactoryBuffer; }
150
151 [
152     uuid(000c1082-0000-0000-c000-000000000046)
153 ]
154 coclass MsiTransform { }
155
156 [
157     uuid(000c1084-0000-0000-c000-000000000046)
158 ]
159 coclass MsiDatabase { }
160
161 [
162     uuid(000c1086-0000-0000-c000-000000000046)
163 ]
164 coclass MsiPatch { }
165
166 [
167     threading(apartment),
168     uuid(000c1094-0000-0000-c000-000000000046)
169 ]
170 /* FIXME: unidentified class */
171 coclass MsiServerX3 { interface IMsiServer; }
172
173 [
174     uuid(ba26e6fa-4f27-4f56-953a-3f90272018aa)
175 ]
176 coclass WineMsiRemoteCustomAction { interface WineMsiRemoteCustomAction; }
177
178 [
179     uuid(902b3592-9d08-4dfd-a593-d07c52546421)
180 ]
181 coclass WineMsiRemotePackage { interface WineMsiRemotePackage; }
182
183
184 [ uuid(000C1092-0000-0000-C000-000000000046), version(1.0) ]
185 library WindowsInstaller
186 {
187     dispinterface Installer;
188     dispinterface Record;
189     dispinterface Session;
190     dispinterface Database;
191     dispinterface SummaryInfo;
192     dispinterface View;
193     dispinterface UIPreview;
194     dispinterface FeatureInfo;
195     dispinterface RecordList;
196     dispinterface StringList;
197     dispinterface Product;
198     dispinterface Patch;
199
200     typedef enum {
201         msiInstallStateNotUsed = -7,
202         msiInstallStateBadConfig = -6,
203         msiInstallStateIncomplete = -5,
204         msiInstallStateSourceAbsent = -4,
205         msiInstallStateInvalidArg = -2,
206         msiInstallStateUnknown = -1,
207         msiInstallStateBroken = 0,
208         msiInstallStateAdvertised = 1,
209         msiInstallStateRemoved = 1,
210         msiInstallStateAbsent = 2,
211         msiInstallStateLocal = 3,
212         msiInstallStateSource = 4,
213         msiInstallStateDefault = 5
214     } MsiInstallState;
215
216     typedef enum {
217         msiOpenDatabaseModeReadOnly = 0,
218         msiOpenDatabaseModeTransact = 1,
219         msiOpenDatabaseModeDirect = 2,
220         msiOpenDatabaseModeCreate = 3,
221         msiOpenDatabaseModeCreateDirect = 4,
222         msiOpenDatabaseModePatchFile = 32
223     } MsiOpenDatabaseMode;
224
225     typedef enum {
226         msiUILevelNoChange = 0,
227         msiUILevelDefault = 1,
228         msiUILevelNone = 2,
229         msiUILevelBasic = 3,
230         msiUILevelReduced = 4,
231         msiUILevelFull = 5,
232         msiUILevelHideCancel = 32,
233         msiUILevelProgressOnly = 64,
234         msiUILevelEndDialog = 128,
235         msiUILevelSourceResOnly = 256
236     } MsiUILevel;
237
238     [ uuid(000C1090-0000-0000-C000-000000000046) ]
239     dispinterface Installer
240     {
241     properties:
242         [id(DISPID_INSTALLER_UILEVEL)]
243             MsiUILevel UILevel;
244     methods:
245         [id(DISPID_INSTALLER_CREATERECORD)]
246             Record *CreateRecord([in] long Count);
247         [id(DISPID_INSTALLER_OPENPACKAGE)]
248             Session* OpenPackage(
249                 [in] VARIANT PackagePath,
250                 [in, optional, defaultvalue(0)] long Options);
251         [id(DISPID_INSTALLER_OPENPRODUCT)]
252             Session* OpenProduct(
253                 [in] BSTR ProductCode);
254         [id(DISPID_INSTALLER_SUMMARYINFORMATION)]
255             SummaryInfo* SummaryInformation(
256                 [in] BSTR PackagePath,
257                 [in, optional, defaultvalue(0)] long UpdateCount);
258         [id(DISPID_INSTALLER_OPENDATABASE)]
259             Database *OpenDatabase(
260                     [in] BSTR DatabasePath,
261                     [in] VARIANT OpenMode);
262         [id(DISPID_INSTALLER_ENABLELOG)]
263             void EnableLog(
264                     [in] BSTR LogMode,
265                     [in] BSTR LogFile);
266         [id(DISPID_INSTALLER_INSTALLPRODUCT)]
267             void InstallProduct(
268                 [in] BSTR PackagePath,
269                 [in, optional, defaultvalue("0")] BSTR PropertyValues);
270         [id(DISPID_INSTALLER_VERSION)]
271             BSTR Version();
272         [id(DISPID_INSTALLER_LASTERRORRECORD)]
273             Record* LastErrorRecord();
274         [id(DISPID_INSTALLER_REGISTRYVALUE), propget]
275             BSTR RegistryValue(
276                 [in] VARIANT Root,
277                 [in] BSTR Key,
278                 [in, optional] VARIANT Value);
279         [id(DISPID_INSTALLER_ENVIRONMENT), propget]
280             BSTR Environment([in] BSTR Variable);
281         [id(DISPID_INSTALLER_ENVIRONMENT), propput]
282             void Environment(
283                 [in] BSTR Variable,
284                 [in] BSTR rhs);
285         [id(DISPID_INSTALLER_FILEATTRIBUTES)]
286             long FileAttributes([in] BSTR FilePath);
287         [id(DISPID_INSTALLER_FILESIZE)]
288             long FileSize([in] BSTR FilePath);
289         [id(DISPID_INSTALLER_FILEVERSION)]
290             BSTR FileVersion(
291                 [in] BSTR FilePath,
292                 [in, optional] VARIANT Language);
293         [id(DISPID_INSTALLER_PRODUCTSTATE), propget]
294             MsiInstallState ProductState(
295                 [in] BSTR Product);
296         [id(DISPID_INSTALLER_PRODUCTINFO), propget]
297             BSTR ProductInfo(
298                 [in] BSTR Product,
299                 [in] BSTR Attribute);
300         [id(DISPID_INSTALLER_PRODUCTS), propget]
301             StringList *Products();
302         [id(DISPID_INSTALLER_RELATEDPRODUCTS), propget]
303             StringList *RelatedProducts(
304                 [in] BSTR UpgradeCode);
305     }
306
307     [ uuid(000C1093-0000-0000-C000-000000000046) ]
308     dispinterface Record
309     {
310     properties:
311     methods:
312         [id(DISPID_RECORD_STRINGDATA), propget]
313             BSTR StringData([in] long Field);
314         [id(DISPID_RECORD_STRINGDATA), propput]
315             void StringData(
316                 [in] long Field,
317                 [in] BSTR rhs);
318         [id(DISPID_RECORD_INTEGERDATA), propget]
319             long IntegerData([in] long Field);
320         [id(DISPID_RECORD_INTEGERDATA), propput]
321             void IntegerData(
322                 [in] long Field,
323                 [in] long rhs);
324         [id(DISPID_RECORD_FIELDCOUNT), propget]
325             long FieldCount();
326     }
327
328     [ uuid(000C1095-0000-0000-C000-000000000046) ]
329     dispinterface StringList
330     {
331         properties:
332         methods:
333         [id(DISPID_LIST__NEWENUM)]
334             IUnknown _NewEnum();
335         [id(DISPID_LIST_ITEM), propget]
336             BSTR Item(long Index);
337         [id(DISPID_LIST_COUNT), propget]
338             long Count();
339     }
340
341     [ uuid(000C1096-0000-0000-C000-000000000046) ]
342     dispinterface RecordList
343     {
344         properties:
345         methods:
346     }
347
348     [ uuid(000C109A-0000-0000-C000-000000000046) ]
349     dispinterface UIPreview
350     {
351         properties:
352         methods:
353     }
354
355     [ uuid(000C109B-0000-0000-C000-000000000046) ]
356     dispinterface SummaryInfo
357     {
358         properties:
359         methods:
360         [id(DISPID_SUMMARYINFO_PROPERTY), propget]
361             VARIANT Property([in] long Pid);
362         [id(DISPID_SUMMARYINFO_PROPERTY), propput]
363             void Property(
364                 [in] long Pid,
365                 [in] VARIANT rhs);
366         [id(DISPID_SUMMARYINFO_PROPERTYCOUNT), propget]
367             long PropertyCount();
368     }
369
370     typedef enum {
371         msiViewModifySeek = -1,
372         msiViewModifyRefresh = 0,
373         msiViewModifyInsert = 1,
374         msiViewModifyUpdate = 2,
375         msiViewModifyAssign = 3,
376         msiViewModifyReplace = 4,
377         msiViewModifyMerge = 5,
378         msiViewModifyDelete = 6,
379         msiViewModifyInsertTemporary = 7,
380         msiViewModifyValidate = 8,
381         msiViewModifyValidateNew = 9,
382         msiViewModifyValidateField = 10,
383         msiViewModifyValidateDelete = 11,
384     } _MsiViewModify;                                /* Added underscore to avoid conflict with function name */
385
386     [ uuid(000C109C-0000-0000-C000-000000000046) ]
387     dispinterface View
388     {
389         properties:
390         methods:
391         [id(DISPID_VIEW_EXECUTE)]
392             void Execute([in, optional, defaultvalue(0)] Record *Params);
393         [id(DISPID_VIEW_FETCH)]
394             Record* Fetch();
395         [id(DISPID_VIEW_MODIFY)]
396             void Modify(
397                 [in] _MsiViewModify Mode,
398                 Record *Record);
399         [id(DISPID_VIEW_CLOSE)]
400             void Close();
401     }
402
403     [ uuid(000C109D-0000-0000-C000-000000000046) ]
404     dispinterface Database
405     {
406         properties:
407         methods:
408         [id(DISPID_DATABASE_OPENVIEW)]
409             View* OpenView([in] BSTR Sql);
410         [id(DISPID_DATABASE_SUMMARYINFORMATION), propget]
411             SummaryInfo *SummaryInformation([in, optional, defaultvalue(0)] long UpdateCount);
412     }
413
414     typedef enum {
415         msiDoActionStatusNoAction = 0,
416         msiDoActionStatusSuccess = 1,
417         msiDoActionStatusUserExit = 2,
418         msiDoActionStatusFailure = 3,
419         msiDoActionStatusSuspend = 4,
420         msiDoActionStatusFinished = 5,
421         msiDoActionStatusWrongState = 6,
422         msiDoActionStatusBadActionData = 7
423     } MsiDoActionStatus;
424
425     typedef enum {
426         msiRunModeAdmin = 0,
427         msiRunModeAdvertise = 1,
428         msiRunModeMaintenance = 2,
429         msiRunModeRollbackEnabled = 3,
430         msiRunModeLogEnabled = 4,
431         msiRunModeOperations = 5,
432         msiRunModeRebootAtEnd = 6,
433         msiRunModeRebootNow = 7,
434         msiRunModeCabinet = 8,
435         msiRunModeSourceShortNames = 9,
436         msiRunModeTargetShortNames = 10,
437         msiRunModeWindows9x = 12,
438         msiRunModeZawEnabled = 13,
439         msiRunModeScheduled = 16,
440         msiRunModeRollback = 17,
441         msiRunModeCommit = 18
442     } MsiRunMode;
443
444     typedef enum {
445         msiEvaluateConditionFalse = 0,
446         msiEvaluateConditionTrue = 1,
447         msiEvaluateConditionNone = 2,
448         msiEvaluateConditionError = 3
449     } _MsiEvaluateCondition;           /* Added underscore to avoid conflict with function name */
450
451     typedef enum {
452         msiMessageStatusError = -1,
453         msiMessageStatusNone = 0,
454         msiMessageStatusOk = 1,
455         msiMessageStatusCancel = 2,
456         msiMessageStatusAbort = 3,
457         msiMessageStatusRetry = 4,
458         msiMessageStatusIgnore = 5,
459         msiMessageStatusYes = 6,
460         msiMessageStatusNo = 7
461     } MsiMessageStatus;
462
463     typedef enum {
464         msiMessageTypeFatalExit = 0,
465         msiMessageTypeError          = 0x01000000,
466         msiMessageTypeWarning        = 0x02000000,
467         msiMessageTypeUser           = 0x03000000,
468         msiMessageTypeInfo           = 0x04000000,
469         msiMessageTypeFilesInUse     = 0x05000000,
470         msiMessageTypeResolveSource  = 0x06000000,
471         msiMessageTypeOutOfDiskSpace = 0x07000000,
472         msiMessageTypeActionStart    = 0x08000000,
473         msiMessageTypeActionData     = 0x09000000,
474         msiMessageTypeProgress       = 0x0a000000,
475         msiMessageTypeCommonData     = 0x0b000000,
476         msiMessageTypeOk = 0,
477         msiMessageTypeOkCancel = 1,
478         msiMessageTypeAbortRetryIgnore = 2,
479         msiMessageTypeYesNoCancel = 3,
480         msiMessageTypeYesNo = 4,
481         msiMessageTypeRetryCancel = 5,
482         msiMessageTypeDefault1 = 0,
483         msiMessageTypeDefault2 = 256,
484         msiMessageTypeDefault3 = 512
485     } MsiMessageType;
486
487     [ uuid(000C109E-0000-0000-C000-000000000046) ]
488     dispinterface Session
489     {
490     properties:
491     methods:
492         [id(DISPID_SESSION_INSTALLER), propget]
493             Installer *Installer();
494         [id(DISPID_SESSION_PROPERTY), propget]
495             BSTR Property([in] BSTR Name);
496         [id(DISPID_SESSION_PROPERTY), propput]
497             void Property(
498                 [in] BSTR Name,
499                 [in] BSTR rhs);
500         [id(DISPID_SESSION_LANGUAGE), propget]
501             long Language();
502         [id(DISPID_SESSION_MODE), propget]
503             VARIANT_BOOL Mode([in] MsiRunMode Flag);
504         [id(DISPID_SESSION_MODE), propput]
505             void Mode(
506                 [in] MsiRunMode Flag,
507                 [in] VARIANT_BOOL rhs);
508         [id(DISPID_SESSION_DATABASE), propget]
509             Database* Database();
510         [id(DISPID_SESSION_DOACTION)]
511             MsiDoActionStatus DoAction([in] BSTR Action);
512         [id(DISPID_SESSION_EVALUATECONDITION)]
513             _MsiEvaluateCondition EvaluateCondition([in] BSTR Expression);
514         [id(DISPID_SESSION_MESSAGE)]
515             MsiMessageStatus Message(
516                 [in] MsiMessageType Kind,
517                 [in] Record *Record);
518         [id(DISPID_SESSION_FEATURECURRENTSTATE), propget]
519             MsiInstallState FeatureCurrentState([in] BSTR Feature);
520         [id(DISPID_SESSION_FEATUREREQUESTSTATE), propget]
521             MsiInstallState FeatureRequestState([in] BSTR Feature);
522         [id(DISPID_SESSION_FEATUREREQUESTSTATE), propput]
523             void FeatureRequestState(
524                 [in] BSTR Feature,
525                 [in] MsiInstallState rhs);
526         [id(DISPID_SESSION_SETINSTALLLEVEL)]
527             void SetInstallLevel([in] long Level);
528     }
529
530     [ uuid(000C109F-0000-0000-C000-000000000046) ]
531     dispinterface FeatureInfo
532     {
533         properties:
534         methods:
535     }
536
537     [ uuid(000C10A0-0000-0000-C000-000000000046) ]
538     dispinterface Product
539     {
540         properties:
541         methods:
542     }
543
544     [ uuid(000C10A1-0000-0000-C000-000000000046) ]
545     dispinterface Patch
546     {
547         properties:
548         methods:
549     }
550
551     [
552        helpstring("Microsoft Windows Installer"),
553        threading(apartment),
554        progid("WindowsInstaller.Installer"),
555        uuid(000c1090-0000-0000-c000-000000000046)
556     ]
557     coclass MsiInstaller { interface Installer; }
558 }