To set a Directory you have to use either a Type 51 ( Set Property ) CA 
scheduled before CostInitialize or a Type 35 ( Set Directory ) scheduled after 
Cost Finalize.  I generally prefer the former over the latter and also schedule 
it with conditions to prevent execution if the property already has data ( in 
case someone passed a value a the command line )  and to only fire if Not 
Installed as once a product is installed the directory is immutable save a 
major 
upgrade in which case the new ProductCode is not yet installed.

Christopher Painter, Author of Deployment Engineering Blog
Have a hot tip, know a secret or read a really good thread that deserves 
attention? E-Mail Me



----- Original Message ----
From: Andrew Hammond <[email protected]>
To: General discussion for Windows Installer XML toolset. 
<[email protected]>
Sent: Fri, August 13, 2010 10:00:15 PM
Subject: Re: [WiX-users] setting INSTALLDIR using a CustomAction

Setting Before=ValidateProductID appears to have worked. Strange, but I'll
take a working solution any day.

A

On Fri, Aug 13, 2010 at 7:57 PM, Andrew Hammond <
[email protected]> wrote:

> Ok, that works for setting INSTALLDIR, however it appears to be getting set
> after the files have alread installed. I have the following in my wxs, but
> it doesn't seem to be causing the CA to happen before it actually installs
> files.
>
>
> <
> Binary Id="CustomAction.dll" SourceFile="
> $(var.CustomAction.TargetDir)$(var.CustomAction.TargetName).CA.dll" />
>
> <
> CustomAction Id="SetMirInstallDir" BinaryKey="CustomAction.dll" DllEntry="
> SetMirInstallDir" Execute="immediate"/>
>
> <
> InstallExecuteSequence>
>
> <
> Custom Action="SetMirInstallDir" Before="InstallFiles" />
>
> </
> InstallExecuteSequence>
> I'll try a couple of other Before targets, but if anyone has done this
> before it'd be a big help.
>
> A
>
>  On Fri, Aug 13, 2010 at 6:23 PM, Andrew Hammond <
> [email protected]> wrote:
>
>> I have the following CustomAction and would like to it to set the
>> INSTALLDIR property used in the WXS that calls it. I seem to be trying to
>> set the property incorrectly.
>>
>> session["INSTALLDIR"] = "Some Location"
>>
>> What is the correct way to set properties from within a CustomAction?
>>
>> A
>>
>
>
------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users



      

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to