Thanks for your suggestions, but I guess I didn't emphasize enough that I
need to read the file in an _immediate_ custom action, that is, I need to
read it from the installation package before the file gets installed. I
guess there's no easy way to do it, so the way I solved it was to
temporarily extract the embedded cab-file and from there extract the file I
need. A bit cumbersome, but it works.

Regards,
Niklas

On Tue, May 4, 2010 at 16:14, dB. <dbl...@dblock.org> wrote:

> There's a Win32_ReadFile immediate native (C++) CA in
> http://msiext.codeplex.com. It was added in 1.2 which hasn't shipped yet,
> but is stable - http://msiext.codeplex.com/releases/view/39468. Note that
> it doesn't support encoding, so only works for ANSI files.
>
> If you're writing a managed CA yourself, well, just read the file with
> StreamReader.ReadToEnd and then set a property with the contents read.
>
> Hope it helps,
>
> -dB.
>
> dB. @ dblock.org
> Moscow|Geneva|Seattle|New York
>
>
> -----Original Message-----
> From: Niklas Söderberg [mailto:niklas.soderb...@gmail.com]
> Sent: Tuesday, May 04, 2010 8:38 AM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Read file content from CA
>
> Is it possible to get the contents of a file from a custom action (managed
> code)? I know I can get the contents of a binary item, but is it possible
> to
> somehow do the same for a regular file included in the installation
> package?
> I want to do this in an immediate custom action executed in the ui
> sequence.
>
> I'm guessing no since I've searched and googled extensively, in vain, but
> I'm still rather new to wix so perhaps I've missed something.
>
> Thanks,
> Niklas
>
> ------------------------------------------------------------------------------
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to