Personally, If this file may or may not be there, I would use a "Semi-Custom" Action to inject a temporary record into the MoveFile table. You may be able to get the same action done without a custom action, but then I would question if this file should be considered user modified and thus not removed on uninstall.
-----Original Message----- From: Phil Wilson [mailto:phildgwil...@gmail.com] Sent: Wednesday, August 28, 2013 7:03 PM To: General discussion for Windows Installer XML toolset. Subject: Re: [WiX-users] Detecting & copying existing file during install To copy files from the same location as the MSI file, you should look at using SourceDir as the location. INSTALLLOCATION isn't a standard property, it may be intended to be the directory that the MSI was installed from, but it has no value unless you have already initialized it. Phil Wilson On Wed, Aug 28, 2013 at 3:54 PM, K Peters <kpet...@otaksoft.com> wrote: > I have a configuration file that exists right next to the MSI about to > be executed. > I need to copy this file during install to a specified location. > > What am I doing wrong? > > As always, thanks for any pointers in the right direction.... > > > <Property Id="MASTERINIFILE_EXISTS"> > <DirectorySearch Id="MI_DirSearch" Path="[INSTALLLOCATION]" Depth="0"> > <FileSearch Id="MI_FileSearch" Name="Kai.ini"/> </DirectorySearch> > </Property> > > <DirectoryRef Id="CommonAppDataFolder" > <Component > Id="COMP_CopyMasterIni" Guid="<valid GUID here>" KeyPath="yes"> > <CopyFile Id="CopyMasterIni" SourceProperty="MASTERINIFILE_EXISTS" > DestinationDirectory="AppDataManufacturerFolder"/> > </Component > > </DirectoryRef> > > ---------------------------------------------------------------------- > -------- Learn the latest--Visual Studio 2012, SharePoint 2013, SQL > 2012, more! > Discover the easy way to master current and previous Microsoft > technologies and advance your career. Get an incredible 1,500+ hours > of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! > http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.c > lktrk _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users