How to add COM component to MSIX installer?

%3CLINGO-SUB%20id%3D%22lingo-sub-1893606%22%20slang%3D%22en-US%22%3EHow%20to%20add%20COM%20component%20to%20MSIX%20installer%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1893606%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20WinForms%20app%20is%20using%20COM%20component%20and%20I%20am%20trying%20to%20make%20an%20installer%20for%20it.%3C%2FP%3E%3CP%3EIt%20would%20provide%20a%20great%20benefit%2C%20because%20external%20library%20is%20using%20registry%20for%20settings%20and%20giving%20each%20app%20that%20using%20external%20SDK%20would%20be%20very%20nice.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20way%20I%20use%20the%20library%20is%20called%20Registration-Free%20COM%20Interop.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20it%20works%3A%3C%2FP%3E%3CP%3E1.%20I%20copy%20external%20DLL%20to%20my%20exe%20folder%20(usually%20in%20ExternalLib%20folder)%3C%2FP%3E%3CP%3E2.%20Copy%20.manifest%20for%20some%20of%20those%20files.%3C%2FP%3E%3CP%3E3.%20Create%20WinForms%20app%20without%20manifest%20(my%20real%20app)%3C%2FP%3E%3CP%3E4.%20Add%20custom%20manifest%20file%20from%20DLL%20manufacturer%20and%20rename%20it%20to%20MyApp.manifest.%3C%2FP%3E%3CP%3E5.%20Add%20dll%20to%20my%20project.%20VisualStudio%20will%20then%20create%20Interop.ExternalLib.dll%20and%20add%20it%20as%20reference%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20it%20works%20with%20WiX%20installer%20etc.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EProblem%3A%3C%2FP%3E%3CP%3EI've%20created%20and%20MSIX%20installer%20and%20it%20doesn't%20copy%20required%20files.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can%20see%20using%20%22files%20in%20package%22%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fpackaging-tool%2Fpackage-editor%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fpackaging-tool%2Fpackage-editor%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethat%20manifests%20are%20not%20copied%20and%20nor%20the%20DLL%20folder.%3C%2FP%3E%3CP%3EThe%20only%20file%20is%20copied%20is%20Interop%20file%2C%20and%20probably%20because%20it%20is%20referenced%20by%20the%20studio.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20to%20tell%20to%20MSIX%3A%20that%20folder%20and%20those%20files%20should%20always%20by%20included%3F%3C%2FP%3E%3CP%3ELib%20will%20be%20updated%20etc%2C%20and%20there%20is%20literally%20no%20point%20to%20add%20lib%20files%20to%20the%20project%20because%20i%20never%20reference%20those%20directly%2C%20only%20via%20interop.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20regards%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2054341%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20add%20COM%20component%20to%20MSIX%20installer%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2054341%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F871323%22%20target%3D%22_blank%22%3E%40Dmitri1285%3C%2FA%3E%2C%20have%20you%20taken%20a%20look%20at%20the%20following%20documentation%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fdesktop%2Fdesktop-to-uwp-prepare%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPrepare%20to%20package%20a%20desktop%20application%20(MSIX)%20-%20MSIX%20%7C%20Microsoft%20Docs%3C%2FA%3E%26nbsp%3BThere%20is%20a%20section%20called%20%22%3CSTRONG%3EYour%20application%20exposes%20COM%20objects%3C%2FSTRONG%3E%3CSPAN%3E....%22%20Let%20us%20know%20if%20that%20is%20helpful.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hello,

 

My WinForms app is using COM component and I am trying to make an installer for it.

It would provide a great benefit, because external library is using registry for settings and giving each app that using external SDK would be very nice.

 

The way I use the library is called Registration-Free COM Interop.

 

How it works:

1. I copy external DLL to my exe folder (usually in ExternalLib folder)

2. Copy .manifest for some of those files.

3. Create WinForms app without manifest (my real app)

4. Add custom manifest file from DLL manufacturer and rename it to MyApp.manifest.

5. Add dll to my project. VisualStudio will then create Interop.ExternalLib.dll and add it as reference,

 

And it works with WiX installer etc.

 

Problem:

I've created and MSIX installer and it doesn't copy required files.

 

I can see using "files in package":

https://docs.microsoft.com/en-us/windows/msix/packaging-tool/package-editor

 

that manifests are not copied and nor the DLL folder.

The only file is copied is Interop file, and probably because it is referenced by the studio.

 

Is there any way to tell to MSIX: that folder and those files should always by included?

Lib will be updated etc, and there is literally no point to add lib files to the project because i never reference those directly, only via interop.

 

Best regards

 

 

 

1 Reply

Hi @Dmitri1285, have you taken a look at the following documentation: Prepare to package a desktop application (MSIX) - MSIX | Microsoft Docs There is a section called "Your application exposes COM objects...." Let us know if that is helpful.