The CA is set to run after files are installed, 

    <InstallExecuteSequence>
      <Custom Action='SetEfxZlibLibraryAction' After='InstallFiles'/>
    </InstallExecuteSequence>


Mark Freedman
JHU/APL
17-N568
443.778.2647
mark.freed...@jhuapl.edu

-----Original Message-----
From: Hoover, Jacob [mailto:jacob.hoo...@greenheck.com] 
Sent: Monday, May 20, 2013 12:34 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Getting install path from Wix Custom Action

When did you schedule your CA to run?

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

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