[Incident]: Some users report they are unable to access the case portal. Please see this community notice for more information.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
user1234
Level 3

Using Custom Action DLL

Hi,I'm trying to switch from wix to Installshield and I'm trying to do the following custom actions:

<CustomAction Id="Install" Return="check" Execute="deferred" BinaryKey="CustomCA.dll" DllEntry="InstallPlugins" Impersonate="no" />
<CustomAction Id="CustomActionDataInstall" Property="Install" Value="customParameters=[PROPERTY1]|[PROPERTY2]|[PROPERTY3]|[PROPERTY4]|[PROPERTY4]"/>

I had tried adding a custom action MSI dll called InstallTest that references CustomCA.dll in a Merge Modul. Within the Installshield MSI Project, I added a custom action to set the property InstallTest with the value customParameters=[PROPERTY1]|[PROPERTY2]|[PROPERTY3]|[PROPERTY4]|[PROPERTY4].

I then added that property set and dll run after InstallInitialize. When I run the installer, I see the InstallTest property having the correct values but when it runs the dll, it shows the error below.

Am I missing anything with using custom action DLLs? Is there a better way to call a custom action dll and pass parameters?

Thanks in advance!

-------------

CustomActionSchedule(Action=InstallTest.A87E0E3E_D6E7_4917_A3B2_7D74637AC4D4,ActionType=1025,Source=BinaryData,Target=InstallPlugins,)
MSI (s) (C0:3C) [11:55:58:004]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSIB93C.tmp, Entrypoint: InstallPlugins
MSI (s) (C0:18) [11:55:58:004]: Generating random cookie.
MSI (s) (C0:18) [11:55:58:004]: Created Custom Action Server with PID 8564 (0x2174).
MSI (s) (C0:D0) [11:55:58:066]: Running as a service.
MSI (s) (C0:08) [11:55:58:082]: Hello, I'm your 32bit Impersonated custom action server.
SFXCA: Extracting custom action to temporary directory: C:\Users\visqa\AppData\Local\Temp\MSIB93C.tmp-\
SFXCA: Binding to CLR version v4.0.30319
Calling custom action CustomCA!CustomCA.CustomActions.InstallPlugins
Begin InstallPlugins
Exception thrown by custom action:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at CustomCA.CustomActions.Install(Session session, Boolean isSafeMode)
at CustomCA.CustomActions.InstallPlugins(Session session)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32 sessionHandle, String entryPoint, IntPtr remotingDelegatePtr)
CustomAction InstallTest.A87E0E3E_D6E7_4917_A3B2_7D74637AC4D4 returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)

Labels (1)
0 Kudos
0 Replies