I have simple WiX (Microsoft.Deployment.WindowsInstaller) custom action:
[CustomAction]
public static ActionResult TestDtf(Session session)
{
MessageBox.Show("Test");
ActionResult result = ActionResult.Success;
return result;
}
I need to have a deferred / system context custom action I created using InstallShield call this, so how do I set up the Method Signature arguments so that it sends the Session? Is 'Session' basically the Msi handle? I have tried using the 'MsiHandle' value, however this results in error:
InstallShield: Deferred action requested property MsiHiddenProperties not provided by CustomActionData
InstallShield: Loading assembly Test.Installation.CustomActions from resource 4098
InstallShield: Loading Assembly Microsoft.Deployment.WindowsInstaller
InstallShield: Unexpected parameter type Microsoft.Deployment.WindowsInstaller.Session encountered; passing string instead
InstallShield: Calling method with parameters [(System.String)294]
InstallShield: Exception: System.ArgumentException: Object of type 'System.String' cannot be converted to type 'Microsoft.Deployment.WindowsInstaller.Session'.
at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at InstallShield.ClrHelper.CustomActionHelper.CallMethod(EntryPointInfo info)
You don't as you don't need to. You are creating the wrong kind of custom action in InstallShield. Pretend your DLL isn't .NET because as far as DTF is concerned, it's not. It has been encapsulated as a native DLL.