This is probably because your CA is scheduled as immediate, rather than
deferred. You need to set Execute=deferred, and Impersonate=no on your
CustomAction element.

However, this presents a problem - deferred CAs do not get access to
properties. Instead, you need to use the CustomActionData special property.
You set a property with the same name as your action (in this case,
SetEfxZlibLibraryAction) to the data that you want to make available to the
custom action. The DTF method (session.CustomActionData) for this in C# has
some special parsing rules which can be used to pass in multiple elements
of data.


On 20 May 2013 17:55, Freedman, Mark P. <mark.freed...@jhuapl.edu> wrote:

> Turns out the attribute I was trying to use was INSTALLFOLDER, not
> INSTALLDIR, as specified in my Product.wxs. So now, that resolves to the
> path I expect.
>
> However, I'm having a new issue. The custom action is trying to work on a
> file that's expeted to be present in my INSTALLFOLDER. I put some
> MessageBoxes in the CA for debugging purposes. When the CA is firing, the
> files havne't been copied over to the install directory yet. I'd think that
> my files would be there at the time since the action isn't firing until
> after InstallFiles. What other options do I have?
>
> Also, my custom action appears to be firing when I uninstall the program.
> Again, this is confusing to me given that the action isn't firing until
> after InstallFiles.
>
> Thanks.
>
> Mark Freedman
>
>
> -----Original Message-----
> From: John Cooper [mailto:jocoo...@jackhenry.com]
> Sent: Monday, May 20, 2013 12:49 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Getting install path from Wix Custom Action
>
> First off, scheduling.  The values of Directory properties (including one
> like INSTALLDIR), aren't going to be meaningful until after CostFinalize.
>  Since you're running in the InstallExecSequence after InstallFiles, that's
> not it.
>
> However, you should be able to resolve INSTALLDIR like any other public
> property.  If session["INSTALLDIR"] resolves to nothing, I'm thinking you
> haven't saved/restored this property.  Is this running in a "Repair" or
> "Upgrade"?
>
> --
> John Merryweather Cooper
> Build & Install Engineer - ESA
> Jack Henry & Associates, Inc.®
> Shawnee Mission, KS  66227
> Office:  913-341-3434 x791011
> jocoo...@jackhenry.com
> www.jackhenry.com
>
>
>
>
> -----Original Message-----
> From: Freedman, Mark P. [mailto:mark.freed...@jhuapl.edu]
> Sent: Monday, May 20, 2013 11:30 AM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Getting install path from Wix Custom Action
>
> I have a custom action and am trying to access the Install Directory, or
> Target path (the base folder that the user chooses to install to).
>
> Within my Action, I tried pulling it from Session. TARGETDIR maps to
> "C:\", despite installing it to program files, and INSTALLDIR yields empty
> stirng. What am I missing? I also tried passing the INSTALLDIR in the
> CustomAction tag with the Directory attribute, but it comes back saying
> that it can't be something in brackets.
>
>
> [CustomAction]
> public static ActionResult SetEfxZlibLibrary(Session session) {
>                 session.Log("Begin CA");
>
>                 string installDirectory = session["INSTALLDIR"];
>
>                 // ....
> }
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
>   <?include Includes.wxi ?>
>                 <Fragment>
>     <CustomAction Id='SetEfxZlibLibraryAction'
> BinaryKey='CustomActionBinary' DllEntry='SetEfxZlibLibrary'
> Execute='immediate'
>                   Return='check'/>
>
>     <Binary Id="CustomActionBinary"
> SourceFile="$(var.CustomInstallActionsFile)"/>
>                 </Fragment>
> </Wix>
>
>
>
> Thanks,
>
> Mark Freedman
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
> NOTICE: This electronic mail message and any files transmitted with it are
> intended exclusively for the individual or entity to which it is addressed.
> The message, together with any attachment, may contain confidential and/or
> privileged information.
> Any unauthorized review, use, printing, saving, copying, disclosure or
> distribution is strictly prohibited. If you have received this message in
> error, please immediately advise the sender by reply email and delete all
> copies.
>
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to