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

Problem with MoveFiles table - help!

In my Basic MSI project, I'm including in Support Files a zip filed containing all the resources that need to be installed (easier to maintain things this way). One of the first things I need to do is unzip the resources.zip file into the SUPPORTDIR. I do this successfully right after InstallInitialize by calling a custom action.

Now the problem I'm having is that there are files I want to move from the unzipped archive over to the install destination. In the MoveFiles table I've added entries for a couple of config text files that simply need to be copied from SUPPORTDIR. This works fine if I add the files directly in Support Files (or if I unzip the archive at the beginning of the User Interface phase), but they don't get copied over when I unzip the archive after InstallInitialize in the Execute phase, even though the MoveFiles action doesn't happen until later.

Do the source files specified in the MoveFiles table need to be present before the Execute phase in order to get moved correctly? I'm having some difficulty figuring out how to best solve this.
Labels (1)
0 Kudos
(4) Replies
Ajay_Ladsaria
Level 7

It isn't clear why your strategy is not working. You should not need to have the directories and files already created in advanced of InstallInitialize to get MoveFiles action to work.

I suggest you create a MSI log file and attach it here with a clear indication of the name of your custom action responsible for unzipping the contents in the SupportFiles view and the contents of your MoveFile table. It may become clearer what the problem is.

-Ajay
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Is your custom action running immediate or deferred in the execute sequence? If it is running deferred, the files are likely being extracted after the MoveFiles action has generated the operations it will perform during the deferred phase of the execute sequence. Since the files wouldn't have been present yet, it didn't have any files to generate install operations for (this pattern is followed by most standard MSI actions). You could try running your action as immediate to see if this resolves this behavior (there shouldn't be any permissions issues since SUPPORTDIR points to a temp folder usually in the current user's profile).
0 Kudos
anom217
Level 8

Josh, it is a deferred action. I assumed the problem is what you were saying. I originally had it as an Immediate action and it worked fine.

However, the issue I had with that is the SUPPORTDIR does not get deleted automatically, since I altered its contents with a custom action. So I made a custom action to delete SUPPORTDIR at the end of the installation. What I'm worried about is during rollback, or other times when that delete SUPPORTDIR action may not get executed, and the directory is left on the target system.

Do you know of a safe way for me to make the extraction an immediate custom action and ensure SUPPORTDIR will always get deleted?
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

There isn't going to be any easy way to clean up files created by an immediate custom action if a setup errors out, since there could be a number of points of failure that would need to be accounted for.

Since your custom action is already extracting files from a zip file, you could just extend the custom action itself to copy the files to the appropriate destination folder instead of relying on MoveFiles. If the files need to be copied to some directory created by the MSI, you can resequence your action after InstallFiles (again as a deferred action). You can then use a rollback action to remove any files that were copied if an error occurs.
0 Kudos