msiserver.idl 17.6 KB
Newer Older
1 2
/*
 * Copyright (C) 2007 Mike McCormack
3
 * Copyright (C) 2007 Misha Koshelev
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

20
#pragma makedep ident
21
#pragma makedep register
22
#pragma makedep regtypelib
23

24
#include "msiserver_dispids.h"
25 26 27 28 29
import "unknwn.idl";
import "wtypes.idl";
import "objidl.idl";
import "oaidl.idl";

30 31
cpp_quote("#if 0")
typedef unsigned long MSIHANDLE;
32
typedef int INSTALLMESSAGE;
33
typedef int MSICONDITION;
34
typedef int MSIRUNMODE;
35
typedef int INSTALLSTATE;
36 37
cpp_quote("#endif")

38 39 40 41 42 43 44
[
    uuid(7BDE2046-D03B-4ffc-B84C-A098F38CFF0B),
    oleautomation,
    object
]
interface IWineMsiRemoteDatabase : IUnknown
{
45 46
    HRESULT IsTablePersistent( [in] LPCWSTR table, [out] MSICONDITION *persistent );
    HRESULT GetPrimaryKeys( [in] LPCWSTR table, [out] MSIHANDLE *keys );
47
    HRESULT GetSummaryInformation( [in] UINT updatecount, [out] MSIHANDLE *suminfo );
48
    HRESULT OpenView( [in] LPCWSTR query, [out] MSIHANDLE *view );
49 50 51
    HRESULT SetMsiHandle( [in] MSIHANDLE handle );
}

52 53 54 55 56 57 58 59 60
[
    uuid(902B3592-9D08-4dfd-A593-D07C52546421),
    oleautomation,
    object
]
interface IWineMsiRemotePackage : IUnknown
{
    HRESULT SetMsiHandle( [in] MSIHANDLE handle );
    HRESULT GetActiveDatabase( [out] MSIHANDLE *handle );
61
    HRESULT GetProperty( [in] BSTR property, [out, size_is(*size)] BSTR value, [in, out] DWORD *size );
James Hawkins's avatar
James Hawkins committed
62
    HRESULT SetProperty( [in] BSTR property, [in] BSTR value );
63
    HRESULT ProcessMessage( [in] INSTALLMESSAGE message, [in] MSIHANDLE record );
James Hawkins's avatar
James Hawkins committed
64 65
    HRESULT DoAction( [in] BSTR action );
    HRESULT Sequence( [in] BSTR table, [in] int sequence );
66
    HRESULT GetTargetPath( [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size );
James Hawkins's avatar
James Hawkins committed
67
    HRESULT SetTargetPath( [in] BSTR folder, [in] BSTR value );
68
    HRESULT GetSourcePath( [in] BSTR folder, [out, size_is(*size)] BSTR value, [in, out] DWORD *size );
69
    HRESULT GetMode( [in] MSIRUNMODE mode, [out] BOOL *ret );
70
    HRESULT SetMode( [in] MSIRUNMODE mode, [in] BOOL state );
James Hawkins's avatar
James Hawkins committed
71 72 73 74
    HRESULT GetFeatureState( [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
    HRESULT SetFeatureState( [in] BSTR feature, [in] INSTALLSTATE state );
    HRESULT GetComponentState( [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
    HRESULT SetComponentState( [in] BSTR component, [in] INSTALLSTATE state );
75
    HRESULT GetLanguage( [out] LANGID *language );
76
    HRESULT SetInstallLevel( [in] int level );
77
    HRESULT FormatRecord( [in] MSIHANDLE record, [out] BSTR *value );
78
    HRESULT EvaluateCondition( [in] BSTR condition );
79 80 81
    HRESULT GetFeatureCost( [in] BSTR feature, [in] INT cost_tree, [in] INSTALLSTATE state, [out] INT *cost );
    HRESULT EnumComponentCosts( [in] BSTR component, [in] DWORD index, [in] INSTALLSTATE state,
                                [out, size_is(*buflen)] BSTR drive, [in, out] DWORD *buflen, [out] INT *cost, [out] INT *temp );
82 83
}

84 85 86 87 88 89 90
[
    uuid(56D58B64-8780-4c22-A8BC-8B0B29E4A9F8),
    oleautomation,
    object
]
interface IWineMsiRemoteCustomAction : IUnknown
{
91
    HRESULT GetActionInfo( [in] LPCGUID guid, [out] INT *type, [out] MSIHANDLE *handle, [out] BSTR *dllname,
92 93 94
                           [out] BSTR *function, [out] IWineMsiRemotePackage **package );
}

95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
[
    uuid(000c101c-0000-0000-c000-000000000046),
    oleautomation,
    object
]
interface IMsiServer : IUnknown
{
    /* FIXME: methods */
}

[
    uuid(000c101d-0000-0000-c000-000000000046),
    oleautomation,
    object
]
interface IMsiMessage : IUnknown
{
    /* FIXME: methods */
}

[
    uuid(000c1025-0000-0000-c000-000000000046),
    oleautomation,
    object
]
interface IMsiCustomAction : IUnknown
{
    /* FIXME: methods */
}

[
    uuid(000c1033-0000-0000-c000-000000000046),
    oleautomation,
    object
]
interface IMsiRemoteAPI : IUnknown
{
    /* FIXME: methods */
}

[
    helpstring("Msi install server"),
    progid("IMsiServer"),
    uuid(000c101c-0000-0000-c000-000000000046)
]
coclass MsiServer { interface IMsiServer; }

[
    helpstring("Microsoft Windows Installer Message RPC"),
    progid("WindowsInstaller.Message"),
    uuid(000c101d-0000-0000-c000-000000000046)
]
coclass MsiServerMessage { interface IMsiMessage; }

[
    threading(both),
    uuid(000c103e-0000-0000-c000-000000000046)
]
coclass PSFactoryBuffer { interface IPSFactoryBuffer; }

155 156 157 158 159 160 161 162
[
    helpstring("Microsoft Windows Installer"),
    threading(apartment),
    progid("WindowsInstaller.Installer"),
    uuid(000c1090-0000-0000-c000-000000000046)
]
coclass MsiInstaller { interface Installer; }

163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
[
    uuid(000c1082-0000-0000-c000-000000000046)
]
coclass MsiTransform { }

[
    uuid(000c1084-0000-0000-c000-000000000046)
]
coclass MsiDatabase { }

[
    uuid(000c1086-0000-0000-c000-000000000046)
]
coclass MsiPatch { }

[
    threading(apartment),
    uuid(000c1094-0000-0000-c000-000000000046)
]
/* FIXME: unidentified class */
coclass MsiServerX3 { interface IMsiServer; }

[
    uuid(ba26e6fa-4f27-4f56-953a-3f90272018aa)
]
coclass WineMsiRemoteCustomAction { interface WineMsiRemoteCustomAction; }

[
    uuid(902b3592-9d08-4dfd-a593-d07c52546421)
]
coclass WineMsiRemotePackage { interface WineMsiRemotePackage; }

195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
[ uuid(000C1092-0000-0000-C000-000000000046), version(1.0) ]
library WindowsInstaller
{
    dispinterface Installer;
    dispinterface Record;
    dispinterface Session;
    dispinterface Database;
    dispinterface SummaryInfo;
    dispinterface View;
    dispinterface UIPreview;
    dispinterface FeatureInfo;
    dispinterface RecordList;
    dispinterface StringList;
    dispinterface Product;
    dispinterface Patch;

211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
    typedef enum {
        msiInstallStateNotUsed = -7,
        msiInstallStateBadConfig = -6,
        msiInstallStateIncomplete = -5,
        msiInstallStateSourceAbsent = -4,
        msiInstallStateInvalidArg = -2,
        msiInstallStateUnknown = -1,
        msiInstallStateBroken = 0,
        msiInstallStateAdvertised = 1,
        msiInstallStateRemoved = 1,
        msiInstallStateAbsent = 2,
        msiInstallStateLocal = 3,
        msiInstallStateSource = 4,
        msiInstallStateDefault = 5
    } MsiInstallState;

227 228 229 230 231 232 233 234 235
    typedef enum {
        msiOpenDatabaseModeReadOnly = 0,
        msiOpenDatabaseModeTransact = 1,
        msiOpenDatabaseModeDirect = 2,
        msiOpenDatabaseModeCreate = 3,
        msiOpenDatabaseModeCreateDirect = 4,
        msiOpenDatabaseModePatchFile = 32
    } MsiOpenDatabaseMode;

236 237 238 239 240 241 242 243 244 245 246 247 248
    typedef enum {
        msiUILevelNoChange = 0,
        msiUILevelDefault = 1,
        msiUILevelNone = 2,
        msiUILevelBasic = 3,
        msiUILevelReduced = 4,
        msiUILevelFull = 5,
        msiUILevelHideCancel = 32,
        msiUILevelProgressOnly = 64,
        msiUILevelEndDialog = 128,
        msiUILevelSourceResOnly = 256
    } MsiUILevel;

249 250 251 252
    [ uuid(000C1090-0000-0000-C000-000000000046) ]
    dispinterface Installer
    {
    properties:
253 254
        [id(DISPID_INSTALLER_UILEVEL)]
            MsiUILevel UILevel;
255
    methods:
256 257
        [id(DISPID_INSTALLER_CREATERECORD)]
            Record *CreateRecord([in] long Count);
258 259
        [id(DISPID_INSTALLER_OPENPACKAGE)]
            Session* OpenPackage(
260
                [in] VARIANT PackagePath,
261
                [in, defaultvalue(0)] long Options);
262 263 264 265 266 267
        [id(DISPID_INSTALLER_OPENPRODUCT)]
            Session* OpenProduct(
                [in] BSTR ProductCode);
        [id(DISPID_INSTALLER_SUMMARYINFORMATION)]
            SummaryInfo* SummaryInformation(
                [in] BSTR PackagePath,
268
                [in, defaultvalue(0)] long UpdateCount);
269
        [id(DISPID_INSTALLER_OPENDATABASE)]
270 271 272
            Database *OpenDatabase(
                    [in] BSTR DatabasePath,
                    [in] VARIANT OpenMode);
273 274 275 276
        [id(DISPID_INSTALLER_ENABLELOG)]
            void EnableLog(
                    [in] BSTR LogMode,
                    [in] BSTR LogFile);
277 278 279
        [id(DISPID_INSTALLER_INSTALLPRODUCT)]
            void InstallProduct(
                [in] BSTR PackagePath,
280
                [in, defaultvalue("0")] BSTR PropertyValues);
281 282
        [id(DISPID_INSTALLER_VERSION)]
            BSTR Version();
283 284
        [id(DISPID_INSTALLER_LASTERRORRECORD)]
            Record* LastErrorRecord();
285 286 287 288 289
        [id(DISPID_INSTALLER_REGISTRYVALUE), propget]
            BSTR RegistryValue(
                [in] VARIANT Root,
                [in] BSTR Key,
                [in, optional] VARIANT Value);
290 291 292 293 294 295 296 297 298 299 300 301 302 303
        [id(DISPID_INSTALLER_ENVIRONMENT), propget]
            BSTR Environment([in] BSTR Variable);
        [id(DISPID_INSTALLER_ENVIRONMENT), propput]
            void Environment(
                [in] BSTR Variable,
                [in] BSTR rhs);
        [id(DISPID_INSTALLER_FILEATTRIBUTES)]
            long FileAttributes([in] BSTR FilePath);
        [id(DISPID_INSTALLER_FILESIZE)]
            long FileSize([in] BSTR FilePath);
        [id(DISPID_INSTALLER_FILEVERSION)]
            BSTR FileVersion(
                [in] BSTR FilePath,
                [in, optional] VARIANT Language);
304 305 306
        [id(DISPID_INSTALLER_PRODUCTSTATE), propget]
            MsiInstallState ProductState(
                [in] BSTR Product);
307 308 309 310
        [id(DISPID_INSTALLER_PRODUCTINFO), propget]
            BSTR ProductInfo(
                [in] BSTR Product,
                [in] BSTR Attribute);
311 312
        [id(DISPID_INSTALLER_PRODUCTS), propget]
            StringList *Products();
313 314 315
        [id(DISPID_INSTALLER_RELATEDPRODUCTS), propget]
            StringList *RelatedProducts(
                [in] BSTR UpgradeCode);
316 317 318 319 320 321 322
    }

    [ uuid(000C1093-0000-0000-C000-000000000046) ]
    dispinterface Record
    {
    properties:
    methods:
323
        [id(DISPID_RECORD_STRINGDATA), propget]
324
            BSTR StringData([in] long Field);
325 326
        [id(DISPID_RECORD_STRINGDATA), propput]
            void StringData(
327
                [in] long Field,
328
                [in] BSTR rhs);
329 330 331 332 333 334
        [id(DISPID_RECORD_INTEGERDATA), propget]
            long IntegerData([in] long Field);
        [id(DISPID_RECORD_INTEGERDATA), propput]
            void IntegerData(
                [in] long Field,
                [in] long rhs);
335 336
        [id(DISPID_RECORD_FIELDCOUNT), propget]
            long FieldCount();
337 338 339 340 341 342 343
    }

    [ uuid(000C1095-0000-0000-C000-000000000046) ]
    dispinterface StringList
    {
        properties:
        methods:
344 345
        [id(DISPID_LIST__NEWENUM)]
            IUnknown _NewEnum();
346
        [id(DISPID_LIST_ITEM), propget]
347
            BSTR Item(long Index);
348
        [id(DISPID_LIST_COUNT), propget]
349
            long Count();
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
    }

    [ uuid(000C1096-0000-0000-C000-000000000046) ]
    dispinterface RecordList
    {
        properties:
        methods:
    }

    [ uuid(000C109A-0000-0000-C000-000000000046) ]
    dispinterface UIPreview
    {
        properties:
        methods:
    }

    [ uuid(000C109B-0000-0000-C000-000000000046) ]
    dispinterface SummaryInfo
    {
        properties:
        methods:
371 372
        [id(DISPID_SUMMARYINFO_PROPERTY), propget]
            VARIANT Property([in] long Pid);
373 374 375 376
        [id(DISPID_SUMMARYINFO_PROPERTY), propput]
            void Property(
                [in] long Pid,
                [in] VARIANT rhs);
377 378
        [id(DISPID_SUMMARYINFO_PROPERTYCOUNT), propget]
            long PropertyCount();
379 380
    }

381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396
    typedef enum {
        msiViewModifySeek = -1,
        msiViewModifyRefresh = 0,
        msiViewModifyInsert = 1,
        msiViewModifyUpdate = 2,
        msiViewModifyAssign = 3,
        msiViewModifyReplace = 4,
        msiViewModifyMerge = 5,
        msiViewModifyDelete = 6,
        msiViewModifyInsertTemporary = 7,
        msiViewModifyValidate = 8,
        msiViewModifyValidateNew = 9,
        msiViewModifyValidateField = 10,
        msiViewModifyValidateDelete = 11,
    } _MsiViewModify;                                /* Added underscore to avoid conflict with function name */

397 398 399 400 401
    [ uuid(000C109C-0000-0000-C000-000000000046) ]
    dispinterface View
    {
        properties:
        methods:
402
        [id(DISPID_VIEW_EXECUTE)]
403
            void Execute([in, defaultvalue(0)] Record *Params);
404 405
        [id(DISPID_VIEW_FETCH)]
            Record* Fetch();
406 407 408 409
        [id(DISPID_VIEW_MODIFY)]
            void Modify(
                [in] _MsiViewModify Mode,
                Record *Record);
410 411
        [id(DISPID_VIEW_CLOSE)]
            void Close();
412 413 414 415 416 417 418
    }

    [ uuid(000C109D-0000-0000-C000-000000000046) ]
    dispinterface Database
    {
        properties:
        methods:
419
        [id(DISPID_DATABASE_OPENVIEW)]
420
            View* OpenView([in] BSTR Sql);
421
        [id(DISPID_DATABASE_SUMMARYINFORMATION), propget]
422
            SummaryInfo *SummaryInformation([in, defaultvalue(0)] long UpdateCount);
423 424
    }

425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
    typedef enum {
        msiDoActionStatusNoAction = 0,
        msiDoActionStatusSuccess = 1,
        msiDoActionStatusUserExit = 2,
        msiDoActionStatusFailure = 3,
        msiDoActionStatusSuspend = 4,
        msiDoActionStatusFinished = 5,
        msiDoActionStatusWrongState = 6,
        msiDoActionStatusBadActionData = 7
    } MsiDoActionStatus;

    typedef enum {
        msiRunModeAdmin = 0,
        msiRunModeAdvertise = 1,
        msiRunModeMaintenance = 2,
        msiRunModeRollbackEnabled = 3,
        msiRunModeLogEnabled = 4,
        msiRunModeOperations = 5,
        msiRunModeRebootAtEnd = 6,
        msiRunModeRebootNow = 7,
        msiRunModeCabinet = 8,
        msiRunModeSourceShortNames = 9,
        msiRunModeTargetShortNames = 10,
        msiRunModeWindows9x = 12,
        msiRunModeZawEnabled = 13,
        msiRunModeScheduled = 16,
        msiRunModeRollback = 17,
        msiRunModeCommit = 18
    } MsiRunMode;

455 456 457 458 459 460 461
    typedef enum {
        msiEvaluateConditionFalse = 0,
        msiEvaluateConditionTrue = 1,
        msiEvaluateConditionNone = 2,
        msiEvaluateConditionError = 3
    } _MsiEvaluateCondition;           /* Added underscore to avoid conflict with function name */

462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
    typedef enum {
        msiMessageStatusError = -1,
        msiMessageStatusNone = 0,
        msiMessageStatusOk = 1,
        msiMessageStatusCancel = 2,
        msiMessageStatusAbort = 3,
        msiMessageStatusRetry = 4,
        msiMessageStatusIgnore = 5,
        msiMessageStatusYes = 6,
        msiMessageStatusNo = 7
    } MsiMessageStatus;

    typedef enum {
        msiMessageTypeFatalExit = 0,
        msiMessageTypeError          = 0x01000000,
        msiMessageTypeWarning        = 0x02000000,
        msiMessageTypeUser           = 0x03000000,
        msiMessageTypeInfo           = 0x04000000,
        msiMessageTypeFilesInUse     = 0x05000000,
        msiMessageTypeResolveSource  = 0x06000000,
        msiMessageTypeOutOfDiskSpace = 0x07000000,
        msiMessageTypeActionStart    = 0x08000000,
        msiMessageTypeActionData     = 0x09000000,
        msiMessageTypeProgress       = 0x0a000000,
        msiMessageTypeCommonData     = 0x0b000000,
        msiMessageTypeOk = 0,
        msiMessageTypeOkCancel = 1,
        msiMessageTypeAbortRetryIgnore = 2,
        msiMessageTypeYesNoCancel = 3,
        msiMessageTypeYesNo = 4,
        msiMessageTypeRetryCancel = 5,
        msiMessageTypeDefault1 = 0,
        msiMessageTypeDefault2 = 256,
        msiMessageTypeDefault3 = 512
    } MsiMessageType;

498 499 500 501 502
    [ uuid(000C109E-0000-0000-C000-000000000046) ]
    dispinterface Session
    {
    properties:
    methods:
503 504
        [id(DISPID_SESSION_INSTALLER), propget]
            Installer *Installer();
505
        [id(DISPID_SESSION_PROPERTY), propget]
506
            BSTR Property([in] BSTR Name);
507 508
        [id(DISPID_SESSION_PROPERTY), propput]
            void Property(
509
                [in] BSTR Name,
510 511 512 513
                [in] BSTR rhs);
        [id(DISPID_SESSION_LANGUAGE), propget]
            long Language();
        [id(DISPID_SESSION_MODE), propget]
514
            VARIANT_BOOL Mode([in] MsiRunMode Flag);
515 516
        [id(DISPID_SESSION_MODE), propput]
            void Mode(
517
                [in] MsiRunMode Flag,
518 519 520 521
                [in] VARIANT_BOOL rhs);
        [id(DISPID_SESSION_DATABASE), propget]
            Database* Database();
        [id(DISPID_SESSION_DOACTION)]
522
            MsiDoActionStatus DoAction([in] BSTR Action);
523 524
        [id(DISPID_SESSION_EVALUATECONDITION)]
            _MsiEvaluateCondition EvaluateCondition([in] BSTR Expression);
525 526 527 528
        [id(DISPID_SESSION_MESSAGE)]
            MsiMessageStatus Message(
                [in] MsiMessageType Kind,
                [in] Record *Record);
529
        [id(DISPID_SESSION_FEATURECURRENTSTATE), propget]
530
            MsiInstallState FeatureCurrentState([in] BSTR Feature);
531
        [id(DISPID_SESSION_FEATUREREQUESTSTATE), propget]
532
            MsiInstallState FeatureRequestState([in] BSTR Feature);
533 534
        [id(DISPID_SESSION_FEATUREREQUESTSTATE), propput]
            void FeatureRequestState(
535
                [in] BSTR Feature,
536 537
                [in] MsiInstallState rhs);
        [id(DISPID_SESSION_SETINSTALLLEVEL)]
538
            void SetInstallLevel([in] long Level);
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
    }

    [ uuid(000C109F-0000-0000-C000-000000000046) ]
    dispinterface FeatureInfo
    {
        properties:
        methods:
    }

    [ uuid(000C10A0-0000-0000-C000-000000000046) ]
    dispinterface Product
    {
        properties:
        methods:
    }

    [ uuid(000C10A1-0000-0000-C000-000000000046) ]
    dispinterface Patch
    {
        properties:
        methods:
    }
}