简体   繁体   English

使用安装程序部署C#COM dll

[英]Deploying a C# COM dll using an installer

I have made a C# class library, which uses other dll's made by others in the company, for COM interop. 我制作了一个C#类库,该库将公司中其他人使用的其他dll用于COM互操作。 It is being used with MS Excel 2013 and works fine on my development machine. 它已与MS Excel 2013一起使用,并且可以在我的开发计算机上正常工作。

To test it on other machines, i have copied the output (dll's and .tlb file) to my system 32 folder. 为了在其他机器上进行测试,我将输出(dll和.tlb文件)复制到了我的system 32文件夹中。 I have then registered the dll's using regasm (using the /codebase argument). 然后,我使用regasm(使用/ codebase参数)注册了dll。 Finally, i added the reference to the .tlb in the Excel VBA editor. 最后,我在Excel VBA编辑器中将引用添加到.tlb。 Allthough it is a little tedious with 6 dll's, the regasm works fine. 尽管使用6个dll有点乏味,但重新加油效果很好。

The next step is to distribute the Excel sheet to relevant users in the company, where most are located in different parts of the world in different deparments. 下一步是将Excel工作表分发给公司中的相关用户,其中大多数人位于世界不同地区的不同部门。 This means i do not know what programs that are installed that are needed(for example .net 4.5). 这意味着我不知道需要安装哪些程序(例如.net 4.5)。 Also, since most people in the company know little about the command line, using the above procedure is not only a little tedious, but scares people. 另外,由于公司中的大多数人对命令行知之甚少,因此使用上述过程不仅有点乏味,而且会使人们感到恐惧。 I therefore would like to make an installer. 因此,我想制作一个安装程序。

Since i use VS2013, i have installed a plug in that allows me to make a setup file. 由于我使用VS2013,因此我安装了一个插件 ,使我可以制作安装文件。

I have found this question, which is almost the same as mine, but i don't need the GAC part. 我发现了这个问题,与我的问题几乎相同,但是我不需要GAC部分。 How do i modify the procedure to my needs? 我如何根据自己的需要修改程序? - i have tried to follow the procedure given, but i get an error stating one of the dll's i use in my own, does not have a strong name and cannot be in the GAC. -我尝试按照给定的步骤进行操作,但是出现错误,指出我自己使用的dll之一,没有强名,也不能出现在GAC中。 Build therefore fails. 因此构建失败。 How do i rectify the above? 我该如何纠正以上问题? - do i need to fix the dll or can i do this without the GAC-part? -我需要修复dll还是可以在没有GAC部件的情况下执行此操作?

How do i automate the installation process of my dll(s)? 我如何自动执行dll的安装过程? - The alternative right now is to roll out VS2013 to the users and make them run the project and register that way (Does VS express suffice?). -现在的替代方案是向用户推出VS2013,并让他们运行项目并以这种方式注册(VS表达足够吗?)。

Thanks in advance - i started this project with little experience, so learning curve is a bit steep. 在此先感谢您-我是从很少的经验开始这个项目的,所以学习曲线有点陡。

It's not clear to me exactly what you want to do, but that link does tell you how to register Dlls - just look at the properties of each Dll and set the register property. 我不清楚您要做什么,但是该链接确实告诉您如何注册Dll-仅查看每个Dll的属性并设置register属性。 You can also add your tlb file to your setup, and mark that to be registered too. 您也可以将tlb文件添加到设置中,并标记为也要注册。 If that isn't what you're trying to do then edit the question. 如果那不是您要尝试的操作,请编辑问题。

ps Don't put tham in the system folder - pout them in your company's/app's common files folder. ps请勿将tham放在系统文件夹中-将它们放在公司/应用程序的common files文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM