This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Problem with MoveFiles table - help!
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 17, 2010
04:24 PM
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.
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.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 18, 2010
11:46 AM
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
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 18, 2010
01:16 PM
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).
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 18, 2010
01:27 PM
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?
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?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 22, 2010
02:51 PM
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.
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.