Skip to content

Omaha COM interface

ronginme edited this page Sep 11, 2017 · 7 revisions

Omaha's COM interface described in file omaha\goopdate\omaha3_idl.idl.
Also after build Omaha client you can find it at:
omaha\scoons-out\opt-win\staging\idls
or
omaha\scoons-out\dbg-win\staging\idls

What needs to do for COM interacting with Omaha client from .Net (C# for example)? See https://msdn.microsoft.com/en-us/library/aa645736(v=vs.71).aspx#vcwlkcominteroppart1cclienttutorialanchor1

  1. You need to convert type library omaha3_idl.tlb to assembly.
    • Launch "Developer Command Prompt for VS2015".
    • Locate omaha\scoons-out\opt-win\staging\idls\omaha3_idl.idl
      or
      omaha\scoons-out\dbg-win\staging\idls\omaha3_idl.idl.
    • Call tlbimp omaha3_idl.tlb. This makes GoogleUpdate3Lib.dll.
  2. You need to add reference to GoogleUpdate3Lib.dll in your .Net application.
    • Call "Add reference..." in VS2015 for your application project. Browse and select GoogleUpdate3Lib.dll.
  3. You need to add using directive in your source code.
    • Before you can use the COM interfaces and classes you need to add uses directive in your source code.

For help, you can see TestAppWPF in examples. Some applications examples

Attention!!!
In TestAppWPF example you can find omaha_idls\GoogleUpdate3Lib.dll, but you mustn't use this one because if you use this one you need to use same GUIDs also. This GoogleUpdate3Lib.dll use only for an errorless build. You need to use your own GoogleUpdate3Lib.dll with your own GUIDs. Also in TestAppWPF example, you can see public enum currentState.
If you want to use that you need to add enum CurrentState; in omaha\goopdate\omaha3_idl.idl and rebuild for new omaha3_idl.tlb, then make new GoogleUpdate3Lib.dll