Type t = Type.GetType(outer_type);
if (t == null)
{
srt.LogClient.Log(Tools.LogLevel.Error, "Failed to instantiate type {0}", outer_type);
return;
}
if (t.IsGenericType == true)
{
Type[] innerTArr = t.GetGenericArguments();
if (innerTArr == null || innerTArr.Length == 0)
{
Log("inner Type was not found. Cannot instantiate a generic class");
return;
}

Type innerT = innerTArr[0];
Type genericType = t.GetGenericTypeDefinition();

Type[] typeArgs = { innerT };
Type constructed = genericType.MakeGenericType(typeArgs);
object o = Activator.CreateInstance(constructed);
mac = o as IMac;
}

Personal notes for performing this to install Windows 7 on a Toshiba R100, which has no DVD drive nor the ability to boot from USB.¬† These notes apply ONLY to Server 2008 R2, I believe some extra steps are required for 2008 R1 (which I haven’t tried, sorry)

  1. Install WDS on a machine that is NOT hosting  DHCP server.  I used the DHCP on my router, which worked fine.
  2. Download and install Windows Automated Install Toolkit (Windows AIK) ISO
  3. Create a WinPE image using “copype x86 <dir>” for 32-bit, or “copype x64 <dir>” for 64-bit
  4. Install the resulting boot image in the WDS install.
  5. Boot your target machine, ensuring that it’s set to boot from PXE
  6. Should now boot in to Windows PE – from here you can map a drive to a copy of the Windows 7 ISO/DVD, shared on another machine:
    net use Y: \\machine\share
  7. CD to the Y: drive and run setup.exe