cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gridman
Level 8

Using XCopyFile in Basic MSI

I have a Basic MSI installation in IS Pro where I have two large folders (2.0 GB total) on a DVD that I need copied to the user's machine. If I create two components, one for each of the large folders, then it takes forever to build the installer, because it has to incorporate the large folders into the build.

What I did was not include the folders in the project, but rather just place them onto the DVD during the burning process. In the installer, after ExecuteAction in the UI sequence, I placed two InstallScript CAs. Each CA copies a folder using XCopyFile with the Include SubDirectory flag turned on.

What happens is that one folder is copied just fine. The second folder has 12 main folders under it, and a lot of subdirectories. So, when it's CA is run, only two of the subfolders are copied to the user's machine, but not the rest.

I know that if I go the CA route that I have to have a CA that uninstalls these folder's files. That's okay.

What I don't know is if I am using the best method for this. Must not be since it is not working properly.
Labels (1)
0 Kudos
(4) Replies
jchristman
Level 8

I have found it helps if you create the folders prior to doing the XCopyFile.

CreateFolder("C:\\MyFolder1");
XCopyFile("D:\\MyFolder1\\*.*", "C:\\MyFolder1",INCLUDE_SUBDIRECTORIES");

I also mainly use VBscript CAs with BasicMSI projects to handle things with directories and files. I use Session.Property[INSTALLDIR] in the vbScript to get the installation path to move files there.
0 Kudos
gridman
Level 8

Creating the folders first for one of the folders would be easy as there are no subdirectories. However, the other folder probably has a hundred or more subdirectories.

I'll try creating the initial folders and see what happens.
0 Kudos
jchristman
Level 8

Sorry, this was to create the Top level only all subdirs should go with out problems, if the top folder exists.
0 Kudos
gridman
Level 8

I tried creating the two top level folders, but after the XCopyFile, the result was the same. Only a couple of the subfolders in the second folder are copied to the target dir.

This is a little puzzling. It may be failing because there are so many subdirectories.

The installation works fine outside of this. Perhaps I should drop the CAs, add these files to components, and just put up with the long build times.

Another option would be to create my own cabinet files for these, but in reading the Help, that is quite a bit more work.
0 Kudos