curt.blunt
Posts: 22
Joined: Tue Oct 18, 2022 11:05 am
Location: Remote

Call method from .Net assembly without NET 8 installed locally

Hi,

I am following this guide
https://www.advancedinstaller.com/user- ... et-ca.html

As a business requirement, we are writing our new custom actions with NET 8.0 as the target framework

Let's take into account that some of our customers might not have .NET 8 installed on the destination machine, how can I ensure the custom action runs no matter what?

I tried Self-Contained DLL thinking if I host all the required DotNet files in TempFolder\ProductCode\customActions I have my main DLL file and the depencies that Visual Studio gave me when I setup my publisher profile

Image

Image

Image

Image

Image

So question is how can I run this DLL self contained ensuring the customers might not have DotNet 8 installed on their machines?

The answer can't be "install dotnet 8 as prerequisite" because we face issue with msiexec /i setup.msi /qn and prerequisites are not installed under after main package on the machine, which means custom action would fail.

As soon as I install Microsoft .NET Runtime - 8.0.11 (x64) the custom action works

Image

Thanks
Curt
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: Call method from .Net assembly without NET 8 installed locally

Hello Curt,

I'm sorry to hear of the issue you are experiencing with the installation of the prerequisites.

Do you have a ticket open or did one of my colleagues create this bug in our tracking tool?

If so, then we might need to wait for it to be fixed as that is the only solution to your problem.

Another solution that does not fix this 100% would be to have a launch condition where you tell the customer to install the .NET 8 manually on his machine, if not already present.

How does this sound?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
curt.blunt
Posts: 22
Joined: Tue Oct 18, 2022 11:05 am
Location: Remote

Re: Call method from .Net assembly without NET 8 installed locally

I think we will need a ticket opening.

We can't expect customers to install .net 8 manually - if our software is the only thing on their machine that requires net 8 then we should be making sure our DLL's can run self-contained without the need of dotnet 8 runtime on the machine.

The CallDotNetAction probably needs support to allow self-contained published DLL's to run. I think the CallDotNetAction is looking for the dotnet 8 runtime installed and automatically failing when it doesn't find it on the machine.

If we can compile an Native AOT DLL then can Advanced Installer not support us running that dotnet 8 DLL without Dotnet 8 runtime being installed?

How does the dotnetmethodcaller.dll work from your side?
Catalin
Posts: 7513
Joined: Wed Jun 13, 2018 7:49 am

Re: Call method from .Net assembly without NET 8 installed locally

Hello Curt,

Let's continue this thread with my colleague Daniel over the email for now as he will keep me and my colleagues updated on this as well.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”