<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Installation Developer &#187; Using XCopyFile in a Basic MSI Project</title>
	<atom:link href="http://www.installationdeveloper.com/280/using-xcopyfile-in-a-basic-msi-project/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.installationdeveloper.com</link>
	<description>InstallShield Training - InstallShield Tutorials</description>
	<lastBuildDate>Sat, 04 Sep 2010 14:49:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using XCopyFile in a Basic MSI Project</title>
		<link>http://www.installationdeveloper.com/280/using-xcopyfile-in-a-basic-msi-project/</link>
		<comments>http://www.installationdeveloper.com/280/using-xcopyfile-in-a-basic-msi-project/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 14:35:02 +0000</pubDate>
		<dc:creator>Rod_Maupin</dc:creator>
				<category><![CDATA[InstallShield Training]]></category>
		<category><![CDATA[installshield class]]></category>
		<category><![CDATA[installshield classes]]></category>
		<category><![CDATA[installshield course]]></category>
		<category><![CDATA[installshield courses]]></category>
		<category><![CDATA[installshield programmer]]></category>
		<category><![CDATA[Installshield Tutorial]]></category>
		<category><![CDATA[installshield tutorials]]></category>

		<guid isPermaLink="false">http://www.installationdeveloper.com/?p=280</guid>
		<description><![CDATA[A common scenario is where you have a Basic MSI project and you want to copy files during the installation from one folder to another.&#160; For whatever reason you don&#39;t want to do this by adding the files to a component and letting the installer do it.&#160; So, you decide to do it manually using [...]]]></description>
			<content:encoded><![CDATA[<p>
A common scenario is where you have a <strong>Basic MSI</strong> project and you want to copy files during the installation from one folder to another.&nbsp; For whatever reason you don&#39;t want to do this by adding the files to a component and letting the installer do it.&nbsp; So, you decide to do it manually using <strong>XCopyFile </strong>in a custom action.&nbsp; Sounds great, right?
</p>
<p>
I have had mixed results using <strong>XCopyFile</strong> in a custom action.&nbsp; A recent example is where I needed to copy a folder from a <strong>DVD</strong>.&nbsp; This folder had thousands of file and lots of subdirectories.&nbsp; I tried using <strong>XCopyFile</strong> in a custom action, but most of the time it would just copy the top level folder and files.&nbsp; Through research I found that one way to get around this might be to create the folders first on the target machine and then copy the files, but who wants to do that?&nbsp; Especially if you have a few thousand files to copy like I did.
</p>
<p>
The approach I settled on was to create a <strong>Managed Code Custom Action</strong>.&nbsp; I passed the source&nbsp;and&nbsp;destination paths to a method in a <strong>C# class library</strong>, the files were copied and no more problems were had.
</p>
<p>
I am not sure why <strong>XCopyFile</strong> didn&#39;t work the way I expected.&nbsp; I just got to the point where I had spent enough trying to use it, and when I went to the <strong>Managed Code Custom Action</strong>, the problem was solved and I could move on with my life.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;title=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project&amp;bodytext=%0D%0AA%20common%20scenario%20is%20where%20you%20have%20a%20Basic%20MSI%20project%20and%20you%20want%20to%20copy%20files%20during%20the%20installation%20from%20one%20folder%20to%20another.%26nbsp%3B%20For%20whatever%20reason%20you%20don%26%2339%3Bt%20want%20to%20do%20this%20by%20adding%20the%20files%20to%20a%20component%20and%20letting%20the%20instal" title="Digg"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;title=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project&amp;notes=%0D%0AA%20common%20scenario%20is%20where%20you%20have%20a%20Basic%20MSI%20project%20and%20you%20want%20to%20copy%20files%20during%20the%20installation%20from%20one%20folder%20to%20another.%26nbsp%3B%20For%20whatever%20reason%20you%20don%26%2339%3Bt%20want%20to%20do%20this%20by%20adding%20the%20files%20to%20a%20component%20and%20letting%20the%20instal" title="del.icio.us"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;t=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project" title="Facebook"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;h=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project" title="NewsVine"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;title=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project" title="Reddit"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;title=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project" title="StumbleUpon"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;title=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project&amp;annotation=%0D%0AA%20common%20scenario%20is%20where%20you%20have%20a%20Basic%20MSI%20project%20and%20you%20want%20to%20copy%20files%20during%20the%20installation%20from%20one%20folder%20to%20another.%26nbsp%3B%20For%20whatever%20reason%20you%20don%26%2339%3Bt%20want%20to%20do%20this%20by%20adding%20the%20files%20to%20a%20component%20and%20letting%20the%20instal" title="Google Bookmarks"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;submitHeadline=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project&amp;submitSummary=%0D%0AA%20common%20scenario%20is%20where%20you%20have%20a%20Basic%20MSI%20project%20and%20you%20want%20to%20copy%20files%20during%20the%20installation%20from%20one%20folder%20to%20another.%26nbsp%3B%20For%20whatever%20reason%20you%20don%26%2339%3Bt%20want%20to%20do%20this%20by%20adding%20the%20files%20to%20a%20component%20and%20letting%20the%20instal&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project%20-%20http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F" title="Twitter"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F" title="Technorati"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;title=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project" title="Live"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;title=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project&amp;source=Installation+Developer+InstallShield+Training+-+InstallShield+Tutorials&amp;summary=%0D%0AA%20common%20scenario%20is%20where%20you%20have%20a%20Basic%20MSI%20project%20and%20you%20want%20to%20copy%20files%20during%20the%20installation%20from%20one%20folder%20to%20another.%26nbsp%3B%20For%20whatever%20reason%20you%20don%26%2339%3Bt%20want%20to%20do%20this%20by%20adding%20the%20files%20to%20a%20component%20and%20letting%20the%20instal" title="LinkedIn"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.installationdeveloper.com%2F280%2Fusing-xcopyfile-in-a-basic-msi-project%2F&amp;t=Using%20XCopyFile%20in%20a%20Basic%20MSI%20Project" title="MySpace"><img src="http://www.installationdeveloper.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.installationdeveloper.com/280/using-xcopyfile-in-a-basic-msi-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
