.NET Access

37 views
Skip to first unread message

Peter Simard

unread,
Sep 9, 2022, 3:30:00 PM9/9/22
to innosetup
Hi;

I put together a C++/CLR project and using it as the access point for Inno Setup. I can access the library - but in the library I am accessing .NET assemblies we created - but Inno Setup crashes. No indentifcation of the failire. Accessing .NET framework classes works fine. Unclear why custom assemblies do not work. I validated that the assembly is in the innosetup unpack location - so assume it can find it. Has anyone tried this - and have they run into this - and know what is causing the failure?

Gavin Lambert

unread,
Sep 11, 2022, 6:56:38 PM9/11/22
to inno...@googlegroups.com
What do you mean by "access point for Inno Setup"?

Gavin Lambert

unread,
Sep 11, 2022, 8:28:32 PM9/11/22
to inno...@googlegroups.com
Mere moments ago, quoth I:
If you mean calling .NET methods in a custom assembly (which was not at
all clear), note that you can call directly into a C# assembly if you
like; you don't need to go through an intermediate C++/CLI assembly.
(But you do need to annotate the method in that assembly to make it
callable.)

See https://jrsoftware.org/ishelp/index.php?topic=scriptdll for more
info, along with the CodeDll and MyDll\C# examples.

In particular, note that you must specify multiple DLLs in the external
if they are dependencies of the entry assembly, and use the
corresponding flag.

Also be careful with strings; the examples show ANSI strings only, which
is probably not what you actually want. Returning strings is also
trickier that it may first appear.


Finally, note that you should verify that the intended minimum version
of .NET is actually installed before trying to call any .NET methods.
While most current versions of Windows do include some version of .NET
by default, it could be an older version than you expect, or it could
have been uninstalled.
Reply all
Reply to author
Forward
0 new messages