Thanks for the response.
I tried running those actions in the initializer but without success:
Microsoft.Deployment.WindowsInstaller.InvalidHandleException
What I've done in the end, was to initialize the property to a default value
(the same as in the wix file):
session["INSTALLLOCATION"] = string.Format("{0}\\SampleWix",
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)));
As long as the same person creates the wix file and the embeddedUI code, it
should be fine.
Jason Ginchereau wrote:
>
> According to http://msdn.microsoft.com/en-us/library/aa370303.aspx,
> "Before calling this function [MsiGetTargetPath], the installer must first
> run the CostInitialize action, FileCost action, and CostFinalize action."
>
> Those things definitely haven't happened before embedded UI is
> initialized. I don't know if you would be able to invoke those actions
> from the embedded UI initializer yourself... try and see.
>
> -Jason-
>
> -----Original Message-----
> From: CristianG [mailto:[email protected]]
> Sent: Thursday, April 23, 2009 2:00 AM
> To: [email protected]
> Subject: [WiX-devs] DTF GetTargetPath()
>
>
> Hi,
>
> In the Initialize method from IEmbeddedUI I try to use
> session.GetTargetPath("INSTALLLOCATION") but:
>
> session.GetTargetPath("INSTALLLOCATION")' threw an exception of type
> 'System.ArgumentException'
> base {System.SystemException}: {"The directory name is invalid.
> INSTALLLOCATION"}
> Message: "The directory name is invalid. INSTALLLOCATION"
> ParamName: null
>
> However, when querying the Directory table the INSTALLLOCATION is there:
>
> Session.Database.ExecuteQuery("select * from Directory")
> Count = 9
> [0]: "INSTALLLOCATION"
> [1]: "ProgramFilesFolder"
> [2]: "ycaro0uj|SampleWix"
> [3]: "ProgramFilesFolder"
> [4]: "TARGETDIR"
> [5]: "."
> [6]: "TARGETDIR"
> [7]: ""
> [8]: "SourceDir"
>
> Have anyone else tried this method ?
>
> Thanks
>
> P.S. The examples are from an Immediate Window and a breakpoint in the
> Initialize method
> --
> View this message in context:
> http://n2.nabble.com/DTF-GetTargetPath%28%29-tp2681812p2681812.html
> Sent from the wix-devs mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> WiX-devs mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-devs
>
>
--
View this message in context:
http://n2.nabble.com/DTF-GetTargetPath%28%29-tp2681812p2690549.html
Sent from the wix-devs mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs