Hi, I was reading the Platform SDK samples, and the examples are in VB.NET. I use C# so I was wondering, how can I replicate this line in C#?
Set Installer = CreateObject("WindowsInstaller.Installer")
Thank you.
Hi, I was reading the Platform SDK samples, and the examples are in VB.NET. I use C# so I was wondering, how can I replicate this line in C#?
Set Installer = CreateObject("WindowsInstaller.Installer")
Thank you.
That looks like VB6/VBScript, not VB.NET :) But I might be wrong.
Options are:
using System.Runtime.InteropServices;
Type InstallerType;
object Installer;
InstallerType= Type.GetTypeFromProgID("WindowsInstaller.Installer");
Installer= Activator.CreateInstance(InstallerType);
That's VBScript I think.
You'd be better off searching for whatever you're trying to do within the .NET framework. It has a rich installer library that should make it easy. Don't just try to use some COM object because that's what you found. Work in the framework you're in.