Adding New Components to Existing Features Installs the Feature Tree

Adding New Components to Existing Features Installs the Feature Tree

  • Comments 7

As Developer Division starts to ship patches for the Visual Studio 2008, some users are being prompted for installation source media. This is a resulting of Windows Installer needing the original source files if, for example, files are missing from disk when you repair your product or backup files are not available during patch install.

If you are prompted for source media during install or uninstall, put in your source media disk or browse to the local or network path that contains the original source media like vs_setup.msi. Some of our products do not actually contain loose source .msi files like vstor30.exe under WCU\VS Tools for Office found on your VS2008 DVD. If you're being prompted for source for a product such as this, in most cases you can pass /extract to the .exe to extract the sources.

This most recent issue we're seeing occurs when people are adding new components to install new files or other resources. Though adding new components to an existing feature is allowed when installing with Windows Installer 2.0 and newer, this causes the components' parent features to be installed. This in turn forces those features' parent features to be installed, and so on up the feature tree. Any child features that follow their parents' install actions also get installed. If any components in any of these features install files, then Windows Installer needs the source media to install those files to disk.

If you're an installation developer and are running into this problem when adding components to a feature in a patch package, you can workaround this issue by adding new components to new top-level features. You can see an example of this approach written for WiX in the attached sample in the Workaround folder.

Because there are different reasons you might be prompted for source, you can identify this issue as the cause of the prompt by comparing what the command line to install the patch is, what the ADDLOCAL property is set to, and what features are being transitioned from the Absent to the Local state. Notice in the log below that ADDLOCAL gets set to NotInstalled, and the NotInstalled feature is transitioning from Absent to Local.

MSI (s) (BC:90) [19:34:31:704]: Command Line: PATCH=C:\Users\heaths\Documents\Visual Studio 2005\Projects\Adding Components\Patch_Introduced.msp CURRENTDIRECTORY=C:\Users\heaths\Documents\Visual Studio 2005\Projects\Adding Components CLIENTUILEVEL=2 CLIENTPROCESSID=5172

MSI (s) (BC:90) [19:34:32:059]: PROPERTY CHANGE: Adding REINSTALL property. Its value is 'Example'.
MSI (s) (BC:90) [19:34:32:059]: PROPERTY CHANGE: Adding ADDLOCAL property. Its value is 'NotInstalled'.
MSI (s) (BC:90) [19:34:32:059]: PROPERTY CHANGE: Adding INSTALLLEVEL property. Its value is '1'.

MSI (s) (BC:90) [19:34:32:070]: Feature: NotInstalled; Installed: Absent; Request: Local; Action: Local
MSI (s) (BC:90) [19:34:32:070]: Feature: Example; Installed: Local; Request: Reinstall; Action: Reinstall

MSI (s) (BC:90) [19:34:35:056]: Resolving source.

NotInstalled is explicitly referenced in ADDLOCAL, though it wasn't specified on the command line. Since NotInstalled is getting installed and does contain files, source is required to find the files within that feature to be copied.

If we use the workaround of adding a new top-level feature, NotInstalled is only updated if it was already installed locally and the new feature - "Workaround" in the attached example - is added.

MSI (s) (BC:8C) [19:39:46:866]: PROPERTY CHANGE: Adding REINSTALL property. Its value is 'Example'.
MSI (s) (BC:8C) [19:39:46:866]: PROPERTY CHANGE: Adding ADDLOCAL property. Its value is 'Workaround'.
MSI (s) (BC:8C) [19:39:46:866]: PROPERTY CHANGE: Adding INSTALLLEVEL property. Its value is '1'.

MSI (s) (BC:8C) [19:39:46:880]: Feature: NotInstalled; Installed: Absent; Request: Null; Action: Null
MSI (s) (BC:8C) [19:39:46:880]: Feature: Example; Installed: Local; Request: Reinstall; Action: Reinstall
MSI (s) (BC:8C) [19:39:46:880]: Feature: Workaround; Installed: Absent; Request: Local; Action: Local

This new feature contains only new components with all the required file resources in a cabinet embedded in the patch so that they are always available, even during future maintenance installs since patches are cached in whole.

Attachment: Example.zip
Leave a Comment
  • Please add 6 and 2 and type the answer here:
  • Post
Page 1 of 1 (7 items)