本文介绍了我怎么能叫从Inno Setup的脚本中的.NET的DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从一个Inno Setup的脚本中调用从.NET的DLL(codeD在C#)的函数。
我有:
- 标记中的注册COM互操作的在项目属性选项,
- 改的标记有ComVisible特性的在的AssemblyInfo.cs 的文件, 设置
- 添加了这些行向国际空间站运送脚本:
但我仍然得到以下错误:
我是什么做错了吗?
解决方案
抱歉,是我不好,它已经太长时间,因为我读过帕斯卡!所以,如果你需要得到的值,则有几种可能性:
- 将在C / C ++的功能和导出功能,这是绝对支持的。
- 使用一个托管C ++ DLL来垫片到您的.NET的DLL,并露出呼叫作为C接口点(这应该工作,但它变得杂乱)
- 使用一个.exe来存储你的code结果在.ini文件或注册表或临时文件和读取结果设置code节(这是现在可以正确讨厌)
当我去年曾用InnoSetup它不支持的情况下直接(从调用.NET设置code)。
I want to call a function from a .NET DLL (coded in C#) from an Inno Setup script.
I have:
- marked the Register for COM interop option in the project properties,
- changed the ComVisible setting in the AssemblyInfo.cs file,
- added these lines to the ISS script:
but I still get the following error:
What am I doing wrong?
解决方案
Oops, my bad, it's been too long since I've read pascal! So, if you need to get the value then there are a couple of possibilities:
- Write the functionality in C/C++ and export the function, that's definitely supported.
- Use a Managed C++ dll to shim to your .NET dll, and expose the call as a C interface point (this should work, but it's getting messy)
- Use an .exe to store the result of your code in a .INI file or the registry or in a temp file and read the result in the setup code section (this is now properly nasty)
When I last worked with InnoSetup it didn't support your scenario directly (calling .NET code from setup).
这篇关于我怎么能叫从Inno Setup的脚本中的.NET的DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!