mwa
Posts: 3
Joined: Thu Mar 22, 2012 7:59 pm

How do I copy a folder with subfolders external to the MSI?

I can't figure out how to copy a folder recursively from a location besides the MSI at install time to the application folder.

I don't want to include those files in the MSI since the size of those is close to 2 GB.

Surely there is a way to do this.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How do I copy a folder with subfolders external to the M

Hi and welcome to Advanced Installer forums,

This can be done by using xcopy.exe as a custom action (this file is in the "C:\Windows\system32" folder).
Another method would be to use "File Copy Operations" with wildcards. My colleague Gabriel describes the process in this thread.

Please keep in mind each file requies a component, a GUID, etc and this is not recommended. You may want to reconsider including the resources in your package (perhaps using archiving options).

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mwa
Posts: 3
Joined: Thu Mar 22, 2012 7:59 pm

Re: How do I copy a folder with subfolders external to the M

Thanks for replying.

Why do each file needs a GUID?
I thought that since the files are not "included" in the MSI I would simply create a custom action with wildcards (xcopy seems fine).
The only drawback I could see from this is that from an uninstall/repair standpoint it would not work?

Thanks.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How do I copy a folder with subfolders external to the M

Hello,
Why do each file needs a GUID? The only drawback I could see from this is that from an uninstall/repair standpoint it would not work?
This is true. But aside those an installer built with Windows Installer best practices has all its resources accounted for in its database.
If you're going with a custom action be sure to create a rollback custom action that reverts that copy operation.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”