0

I have installed WIX 2.0 (and Votive). I need to create user defined custom actions using the Custom action project. I found the custom action project template in VS2008 when WIX 3.0 is installed. Now, I couldn't find any template in VS2005 with WIX 2.0.

Can anyone please let me know how can I create a custom action project (class with some custom action).. like this

[CustomAction]
public static ActionResult InstallItem1(Session session)

I think Microsoft.WindowsInstaller and Microsoft.Deployment.WindowsInstaller are the references required (not sure) to create such methods but i couldnt find them in my machine.


I managed to create a Custom Action project (just a Class Library with one class and the Custom Action methods) by referring 'Microsoft.WindowsInstaller' dll. But facing problem in executing that dll..

<Custom Action='_InstallItem2' After='_InstallItem1'/>

<CustomAction Id='_InstallItem2'
  BinaryKey='CustomActionLibrary.dll'   
  DllEntry='InstallItem2'
  Impersonate='yes'
  Execute='immediate'
  Return='check' />

<Binary Id='CustomActionLibrary.dll'
  SourceFile='C:\WIX\CustomActionLibrary.dll' />

There is a method called 'InstallItem2' marked as [CustomAction] in that dll.. But facing the error:

There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run(...)

Any idea why this error is coming?

quetzalcoatl
  • 32,194
  • 8
  • 68
  • 107
Venkat
  • 9
  • 1

1 Answers1

1

What you're looking for is actually a DTF (deployment tools foundation) project, but DTF was first released with WiX 3.0.

On Freund
  • 4,376
  • 2
  • 23
  • 30
  • Thanks for the info Freund, Actually i need to do some action as part of installer which is not present in WIX custom actions (some application specific functions..similar to Custom Actions in WIX 3.0). How can i do this in WIX 2.0. Any idea? – Venkat Mar 19 '10 at 06:42
  • I have no experience with 2.0, but I'm assuming that you can still create C++ custom action projects through the wizard. If that doesn't work, you can always create a custom action DLL yourself and call it from the installer. – On Freund Mar 19 '10 at 06:45
  • Thanks for your time Freund, I've tried creating custom action dll with 'Class library' template, but [CustomAction] public static ActionResult InstallItem1(Session session) is giving errors.. unable to find references for Session, ActionResult etc..i think 'Microsoft.WindowsInstaller' and 'Microsoft.Deployment.WindowsInstaller' dlls are required for that. – Venkat Mar 19 '10 at 07:16
  • These namespaces are part of DTF, which you need if you want to use C#. For what I'm suggesting, you need to create an unmanaged C++ class library. But why not simply use WiX 3.0? – On Freund Mar 19 '10 at 07:20
  • Our installer is going to be integrated with client's installer (on WIX 2.0)..so we should use 2.0 only :( – Venkat Mar 19 '10 at 09:48
  • How will the integration be performed? If you're creating a merge module, there's no problem creating it with 3.0 and integrating it into a 2.0 MSI (in fact, you can replace it with any other MSI/MSM authoring tool on both sides) – On Freund Mar 19 '10 at 10:02
  • It will be a separate installer, but the build machine has wix 2.0 only and client is specific about the version. – Venkat Mar 19 '10 at 10:11