Archive: How to install .net applications


How to install .net applications
Hello,
With the help of the code examples on the wiki pages I've managed to have my installer check if the .NET framework 2.0 is installed, and if not, direct the user to microsoft's .net framework download page.

Now I have a user that managed to install my application, but when trying to run it, he got following error:

System.InvalidOperationException: An error occurred creating the form. 
See Exception.InnerException for details. The error is: Class not registered
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) --->
System.Runtime.InteropServices.COMException (0x80040154): Class not registered
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
at
System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance
(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
...


I think this might be because besides copying the files I also need to do some sort of registering?
The only thing I found on the forum is 'regasm', but when trying that on my .exe, it states that there are no types to register.

Does anyone know what else I should do to get a .NET application working on another pc?

Thanks

If I understand correct, doesn't to be .NET installer fault?
I mean, .NET is responsable of registering its components. I don't use .NET, but maybe that's a good point of start.

Other can be that the .NET framework version installed isn't compatible with the application's


If possible I'd rather use NSIS instead of an Installer created by Visual Studio, so it will only register things if I put them in the installer I guess.

Now that I think of it, there are a few dll's that Visual Studio created that are also used (part of the project is converted from VB6), maybe these dll's need to be registered like other dll's?
( The dll's are AxInterop.MSWinsockLib.dll, Interop.MSWinsockLib.dll and Interop.Win32.dll )


Now that I think of it, there are a few dll's that Visual Studio created that are also used (part of the project is converted from VB6), maybe these dll's need to be registered like other dll's?
Yes, that's why having the .NET framework is secure. Or... are you willing to test EACH dll or component that will make your application runnable? Remember...one DLL or Component calls other ones symbols, and those other ones :igor:

As I said, the installer checks for the .NET framework, and if it's not installed, will lead the user to the correct download site.
So the .NET framework is installed using the redistributable file from Microsoft.

Those 3 dll's are the only dll's that I install from NSIS so I think these are the only ones that may still require registering?


Yes, but I suggest to use Dependecy Walker or such, just to be sure that those are the only components that you app requires.