views:

275

answers:

3

Hi, 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 couldnt find any template in VS2005 with WIX 2.0.

Can anyone plz 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.

+1  A: 

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

On Freund
A: 

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
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
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
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
Our installer is going to be integrated with client's installer (on WIX 2.0)..so we should use 2.0 only :(
Venkat
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
It will be a separate installer, but the build machine has wix 2.0 only and client is specific about the version.
Venkat
A: 

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..

DllEntry='InstallItem2' Impersonate='yes' Execute='immediate' Return='check' />

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?

Venkat
You didn't add the relevant excerpt from the MSI log, but you probably aren't packing the needed dependencies along with your DLL. Check out the DTF manual in the WiX 3.0 package.
On Freund