Deploying COM Components with ClickOnce

We are developing a C # WPF application (.Net 4.0), which requires a β€œscreen recording". We rated the ByteScout Screen Capture SDK (free trial) and it does exactly what we need.

However, the problem is that our application is designed to deploy ClickOnce on the computers of our clients (and not on our network) and which, most likely, will be registered as limited, not administrative users. The SDK has a redistributable component, but this requires installation separately - not suitable for ClickOnce.

ByteScout seems to address this need in its documentation in the "Pre-Deployment" section:

/*
 * REGISTRRATION FREE SCENARIO DEPLOYMENT: allows to just copy DLLs from the SDK without installing them
 * See SAMPLE.EXE.manfest as the sample. 
 * 1) Rename "SAMPLE.EXE.manifest" into the actual application name (e.g. "MyApp.exe.manifest")
 * 2) Edit this .manifest file and replace "SAMPLE.EXE" with your application name (e.g. "MyApp.exe")
 * 3) Copy put this .manifest file into the same folder where your MyApp.exe is located
 * 4) Copy all dlls from /x86/ folder into the same folder as your application
 * So you will have files in the folder:
 * - MyApp.exe
 * - MyApp.exe.manifest
 * - BytescoutVideoMixerFilter.dll
 * - BytescoutScreenCapturingFilter.dll
 * - BytescoutScreenCapturing.dll
 * 5) Now you should be able run MyApp.exe without Screen Capturing SDK installed

: app.manifest - - SAMPLE.EXE.manifest:

<file name="BytescoutScreenCapturing.dll">
    <comClass
        description="Capturer Class"
        clsid="{48967118-C4C9-435C-94D8-001247B9A52A}"
        threadingModel="Apartment"
        progid="BytescoutScreenCapturing.Capturer"
        tlbid="{8EDAD3BB-AE5F-43B4-A2F1-B04F4130F2E0}" />
    <comClass
        description="C:\Documents and Settings\Administrator\My Documents\Capture From Entire Screen\bin\Debug\BytescoutScreenCapturing.dll"
        clsid="{DCAFCA37-546E-4D0A-9C02-D3221E65FCA9}"
        threadingModel="Both" />

    <typelib tlbid="{8EDAD3BB-AE5F-43B4-A2F1-B04F4130F2E0}"
        version="1.0"
        helpdir="C:\Documents and Settings\Administrator\My Documents\Capture From Entire Screen\bin\Debug\" />

</file>

<comInterfaceExternalProxyStub
    name="ICapturer"
    iid="{DCAFCA37-546E-4D0A-9C02-D3221E65FCA9}"
    proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"
    baseInterface="{00000000-0000-0000-C000-000000000046}"
    tlbid="{8EDAD3BB-AE5F-43B4-A2F1-B04F4130F2E0}" />

<comInterfaceExternalProxyStub
    name="IVideoWMVSettings"
    iid="{1A814EC2-55A9-4FA2-99E2-2C20A897C2E7}"
    proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"
    baseInterface="{00000000-0000-0000-C000-000000000046}"
    tlbid="{8EDAD3BB-AE5F-43B4-A2F1-B04F4130F2E0}" />

<file name="BytescoutScreenCapturingFilter.dll">

    <comClass
        description="Bytescout Screen Capturing Filter"
        clsid="{0F5D4CE4-2166-4FF7-9AA1-91330D35978A}"
        threadingModel="Both" />

    <comClass
        description="Screen Capturing Property Page"
        clsid="{22DD33B0-30C4-420D-A955-844E2B85A1F3}"
        threadingModel="Both" />

    <comClass
        description="Screen Capturing Property Page"
        clsid="{9D153AAA-0477-4C2E-B827-211F10561B44}"
        threadingModel="Both" />

    <comClass
        description="Screen Capturing Property Page"
        clsid="{26882CF7-F62F-47DB-9A3C-D1191591BD04}"
        threadingModel="Both" />

</file>

<file name="BytescoutVideoMixerFilter.dll">

    <comClass
        description="Bytescout Video Mixer Filter"
        clsid="{4407F28D-97C2-41C5-A23F-2FAE465CE7BB}"
        threadingModel="Both" />

</file>

, :

  • BytescoutScreenCapturingLib, " " "True"
  • DLL - BytescoutScreenCapturing.dll, BytescoutScreenCapturingFilter.dll BytescoutVideoMixerFilter.dll "", " " " "
  • app.manifest .

, , . :

Activation context generation failed for "myapp.exe.Manifest".
Error in manifest or policy file "myapp.exe.Manifest" on line 89. The value "" of attribute "resourceid" in element "typelib" is invalid.

Bytescout , : , . , , " ".

" " COM-; ( ) COM, , , (A) (B) (C) . , -, .

- , , ? , , DLL, "" .

EDIT: myapp.exe.Manifest "resourceID" "1", :

Activation context generation failed for "myapp.exe.Manifest".
Error in manifest or policy file "myapp.exe.Manifest" on line 103. The value "" of attribute "tlbid" in element "comClass" is invalid.

app.manifest Isolated DLL True, :

Activation context generation failed for "myapp.exe.Manifest".
 Dll redirector contributor unable to add file map entry for file BytescoutScreenCapturing.dll; Two or more components referenced directly or indirectly by the application manifest have files by the same name.
+3

Source: https://habr.com/ru/post/1621514/


All Articles