PDA

View Full Version : Order of Feature/Component Installation



gcggcg
11-08-2011, 07:39 PM
Is there a way to control the order that features and/or components are installed?

I'd like to be able to have a component that installs only after several other specific components have installed but I can't seem to find a way to do that.

Any help would be appreciated.

Cary R
11-08-2011, 07:46 PM
Hi There,

What in your install requires a certain order? Is it the self-registration of files?

Generally speaking, there's ways to avoid needing a specific order that you'll want to be making use of. See the section, "Making order from Chaos":

http://blogs.flexerasoftware.com/installtalk/2011/02/i-didnt-know-installshield-could-do-that.html

gcggcg
11-08-2011, 08:21 PM
Hi,

Thanks for the reply!

I don't think the technique you referred to will work for my current issue but it is definitely a good one to know. The situation I have is a bit complicated to explain. We are in the process of updating an InstallScript project (IS 7.1) to IS 2012/ Basic MSI. The project supports about 15 different languages. Each language contains a couple of .ini files that have specific information for that language. The .ini files are all named the same and, at run time, are written to a couple of different directories. So far, so good. For example, if English is specified, the English files are written to 2 different folders. If Spanish was being built then the Spanish files (of the same name but different contents) would be written to the same two folders.

The problem is that the .ini files contain some symbolic information that needs to be replaced with values determined at runtime. The current approach we are taking is to use the Text File Changes feature to do a search and replace. This works well generally.

The easiest way to make this replacement would be to wait until all the components that may write files to these directories have installed and then do the search and replace on whatever files are written to the two directories.

Since the "Replacement Sets" need to be associated with a specific component, it would be very convenient if I could create one Replacement Set with all the appropriate Replacements, and then associate that Replacement Set with a component that I know will install after all the other components that write files to the two folders.

If I can't do this, I will need to create a Replacement Set and Replacements for each and every component that writes the multiple .ini files to the directories, and it turns out to be a large number - so laziness is driving my question! Perhaps there's a better way to do this?

Thanks for any help you can provide. I doubt that my explaination is very clear so if you need more information please post back.

Cary R
11-09-2011, 12:42 PM
After reading through your description, I wonder if maybe you're just a little confused about how events are sequenced in Windows Installer.

The default sequencing for our replacement functionality is after all files have been written to the system by the InstallFiles action. So I think ordering won't be an issue, based on what you're said, since at the time the search-and-replace takes place, all files have been installed. This is how Windows Installer works--doing a batch operation of all component's data all at once, in no particular order. The easiest way to explain it is with the two actions that handle Files and Registry in a Basic MSI project:

InstallFiles - sequence number 4000
WriteRegistryValues - sequence number 5000

Based on the sequence number, all files will get written to the system before any registry data does. Then, during WriteRegistryValues, all the registry data that all components are installing will get written.

So, I don't see why you can't just define all your replacements all at once with one replacement set per target folder. Unless there is something I am missing with what you're trying to replace, which could be the case.

gcggcg
11-09-2011, 04:41 PM
Hi Cary,

Thanks again for the help! If I'm understanding correctly, you have just solved my problem! Education is a powerful thing. I'm brand new to IS and, as you stated, wasn't aware of how the sequencing is handled. So let me repeat what I heard and make sure I got it.

It sounds like all of the files for every installed component will be copied to the target machine in one operation. At some time after that, all of the search and replace actions will take place. If that's the case then, yes, I should be able to choose almost any component, associate all of the Replacement Sets with it and be confident that none of those search and replace actions will not run until after all files from all components have been moved to the target machine. Is that correct? If so, problem solved!

Is there any guarantee of the order the search and replace operations themselves are executed in. For example if there are three of these operations targeted at a particular file, are they executed in the order they show up in the explorer?

I was assuming (and you know what that means) that all operations associated with a component would be handled when that component was installed rather than having all like operations for the entire set of components grouped together.

As one last question, could you point me to the documentation on the sequence numbering and descriptions. It sounds like something I definitely need to understand better.

Thanks again very much - I really appreciate your help.

DebbieL
11-23-2011, 12:15 PM
It sounds like all of the files for every installed component will be copied to the target machine in one operation. At some time after that, all of the search and replace actions will take place
Yes, that is correct.


Is there any guarantee of the order the search and replace operations themselves are executed in. For example if there are three of these operations targeted at a particular file, are they executed in the order they show up in the explorer?
Yes, the installation implements the text file changes in the order in which they are listed in the view. For more info, see Changing the Order in Which Text File Changes Are Made (http://helpnet.flexerasoftware.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield18helplib/TextFileChanges-Order.htm).


As one last question, could you point me to the documentation on the sequence numbering and descriptions.
That's a tough one. It's a pretty big subject, and a lot of documentation is available on this. Here are a few help topics to get you started.


Defining Sequences (http://helpnet.flexerasoftware.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield18helplib/DefiningSequences.htm)
Reordering a Sequence (http://helpnet.flexerasoftware.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield18helplib/IHelpEditSequences.htm)
InstallShield Custom Action Reference (http://helpnet.flexerasoftware.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield18helplib/Ref-ISCustomActions.htm) (Whenever you configure changes in the Text File Changes view, InstallShield is essentially create several custom actions to make the text file changes on target systems. InstallShield also creates many other custom actions for some of the settings that you configure in other views. This help topic lists the names of the "Text File Changes view" custom actions. Their names start with the string ISSearchReplace (e.g., ISSearchReplaceInstall and ISSearchReplaceCosting).)


I recommend looking around at the Sequences node and its subnodes in the Custom Actions and Sequences view, and reading the inline help that's displayed when you click any of the nodes or various settings in this view. This view lists the custom actions and standard actions (and many dialogs, too) in the order in which they are launched in the installation. So reviewing this view may help you get a better understanding of the timing of various activities at run time.

I hope that helps.