Tuesday, October 27, 2009

How to pass TARGETDIR with CustomActionData and not get an Error

Maybe it is just me, but it seems like everything I need to do with an MSI setup is never as easy as it should be. Here is just an other example.

I need to pass the Target Directory for the installation to the InstallClass that I am using in the MSI Custom Actions (I have to do this because of other things in the MSI that don't work like they should). However, when I define the CustomActionData as:




I get the following error:

Error 1001. Exception occurred while initializing the Installation:System.IO.FileNotFoundException

The solution I have found is to say this:


I found this info from the following post:


I later found the Microsoft documentation on solving the problem:



Denys Wessels said...

Thanks, you rock!

Moazzam said...

Although its a very old post, But its really save me to hit my head to the wall.