Hi Sebastian Thank you for your quick reply.
Yes, I'm sure that INSTALLDIR was set before called. I added extract custom action before execute CA_RunEXE to display the property INSTALLDIR to the log file and I can see the value is correct. I copy that value and replaced Path="[INSTALLDIR]" to Path="C:\Program Files\Company\Product\" and it works. Function LogMsg Dim rec Set rec = Session.Installer.CreateRecord(1) rec.StringData(0) = Session.Property("INSTALLDIR") LogInfo = Session.Message(&H04000000, rec) End function I also tried your suggestion to remove @Id from FileSearch but still doesn't works. <FileSearch Name="APP.exe" /> Thanks Jeff --- On Thu, 10/9/09, Sebastian Brand (Instyler Software) <wix+us...@instyler.com> wrote: From: Sebastian Brand (Instyler Software) <wix+us...@instyler.com> Subject: Re: [WiX-users] Wix 3.0 FileSearch To: "'General discussion for Windows Installer XML toolset.'" <wix-users@lists.sourceforge.net> Received: Thursday, 10 September, 2009, 6:33 PM Hello, Are you sure the INSTALLDIR property is set already when the FileSearch begins? Also try removing the @Id from the FileSearch, I remember there was an issue with that when trying to get sub-directories. Best regards, Sebastian Brand Instyler Setup - Creating WiX-based MSI installations, elegantly. http://www.instyler.com -----Original Message----- From: puyo puy [mailto:puyo...@yahoo.com] Sent: Thursday, September 10, 2009 10:31 To: wix users Subject: [WiX-users] Wix 3.0 FileSearch Hi there, I'm trying to create msi installer using wix and this installer will search for old application for current install location. When the old application found, a custom action will execute the old application. I used the following script to search for the old application. <Property Id="EXE_EXISTS"> <DirectorySearch Id="CheckInstallDir" Path="[INSTALLDIR]" Depth="0" > <FileSearch Id="CheckExeFile" Name="APP.exe" /> </DirectorySearch> </Property> When the old application found, custom action "CA_RunEXE" will execute. <InstallExecuteSequence> <Custom Action="CA_RunEXE" After="InstallInitialize">EXE_EXISTS</Custom> </InstallExecuteSequence> But according to the msi log, action CA_RunEXE never execute because condition is false even the old application exist. From the log file I see INSTALLDIR already set and pointed to correct location("C:\Program Files\Company\Product\"). If I replace <DirectorySearch Id="CheckInstallDir" Path="[INSTALLDIR]" Depth="0" > to <DirectorySearch Id="CheckInstallDir" Path="C:\Program Files\Company\Product\" Depth="0" >, the action CA_RunEXE executed as expected. I cannot hardcode the Path as user may install in different locations. Can anyone of you can see what's wrong in my script? Thanks in advance Jeff ____________________________________________________________________________ ______ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.com/ ---------------------------------------------------------------------------- -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users __________________________________________________________________________________ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.com/ ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users