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