PDA

View Full Version : Extract support files during UI sequence?



gkriggs
06-13-2008, 11:22 AM
Hello,

I want to create a single file setup.exe install, and I want to run a .NET method (via DotNetCoCreateObject in an InstallScript custom action) when a user clicks on a button during the UI sequence.

I added my .NET assembly file to "Behavior and Logic/Support Files/Language Independent", and in my InstallScript custom action function, I'm looking for my file in SUPPORTDIR, but I'm not finding it there. How can I extract a support file, and where should I expect it to find it?

Thanks,
Greg

Christopher Painter
06-13-2008, 11:29 AM
Use MsiGetProperty( hMSI, "SUPPORTDIR" .... ) instead of SUPPORTDIR. Examples can be found on my blog.

BTW, DTF is a much better solution now and I don't really reccommend DotNetCoCreateObject() anymore. DTF will automatically consume your project dependencies that are marked CopyLocal true and package them into a neat MSI dll exposing a Type 1 function call. Eliminates the need for SUPPORTDIR all together and gives you better reliability and communications with the msi handle ( um, session class ).

gkriggs
06-13-2008, 12:21 PM
I didn't realize that new feature was available; it works great. Thanks!

Christopher Painter
06-13-2008, 12:25 PM
MsiGetProperty or DTF?