-1

I have few locations on the field for which the initial .msi is same having about 2000 files (of multiple file types). However, I will have to send patches to few of the locations depending on the need so the patch should consist of fewer files (sometimes only 1 file as a fix). I am unable to create a patch (.msp) with just one single file or few files that I want to add/update but have to include all the original set of files as well. Can this be accomplished by any means? Please help !!

Also I do not want to do Major Upgrade as some of the original files are logs and database file which needs to stay intact and cannot be removed.

When I tried this scenario with simple text files where my .msi has 3 text files and the .msp has only 1 text file that I want to update, everything went successful and I could see the changes. But when I tried with my actual folder, I got this error:-

MSI (s) (A0:70) [16:17:59:147]: SELMGR: ComponentId '{B826B564-A3C4-45AB-9623-FB0089831140}' is registered to feature 'ProductFeature', but is not present in the Component table. Removal of components from a feature is not supported! MSI (s) (A0:70) [16:17:59:147]: SELMGR: Removal of a component from a feature is not supported

where the component it is referring to is a dll. Am I missing something when it comes to dlls ?

Sarma
  • 1
  • 3
  • Don't have time to answer properly now, but please see: [minor upgrade limitations](https://stackoverflow.com/a/51444047/129130). [Patching complexity](https://stackoverflow.com/a/23450821/129130). A couple more: [1](https://stackoverflow.com/a/12187180/129130), [2](http://www.installsite.org/pages/en/msi/updates.htm), [3](https://stackoverflow.com/a/52949710/129130), [Heath Stewart](https://devblogs.microsoft.com/setup/how-patching-works/). – Stein Åsmul Jan 16 '20 at 00:07

3 Answers3

0

Trying to completely understand what your requiring but it seems like you're trying to remove a component as part of what's called a minor upgrade. What you'll want to do instead of removing the component is just keep the component but instead remove the file attribute from that component. Essentially creating an empty component until you can next do a major upgrade.

Doc
  • 698
  • 3
  • 16
  • That would be a component rule violation and I don't think it works but not sure without further testing. The way I answer above is the way I've known to do it for a very long time. – Christopher Painter Jan 16 '20 at 20:04
  • Removing the component is a violation of a minor upgrade. Removing the file/resource attached to the component is the work around. Done it plenty of times. – Doc Jan 17 '20 at 00:53
  • I'm pretty sure that would run afoul of "Do not create a version of a component that is incompatible with all previous versions of the component." I also remember the Windows Installer Team used to have a blog (it's barely accessible these days) where they talked about bad things that happened when you changed or removed primary keys. Their example was the Registry table. You may recall the article. It was the one where they coded Installshield as ISHNMET (Industrial Strength Household Name MSI Editing Tool ). – Christopher Painter Jan 17 '20 at 04:35
  • 1
    I found it. https://learn.microsoft.com/en-us/archive/blogs/windows_installer_team/arbitrary-labels-used-as-primary-keys-must-not-be-changed-between-versions Read the last paragraph. By removing a row from the file table you are changing primary keys. You might be getting lucky but it's not endorsed by MSFT. The puncture component pattern is the safest way I know to remove a file in this scenario. That's drawing on 20 years of personal MSI experience. – Christopher Painter Jan 17 '20 at 04:38
0

The only way to remove a file in a patch is to "puncture" the component. You do this by marking the component's Transitive transitive as true and putting a condition on the component that always evaluates to false. You must still keep the component and file in the MSI/MSP but you can provide a zero byte file.

When the minor upgrade / patch is applied the component will reevaluate and uninstall itself since the condition is false.

Whenever you do your next major upgrade you can remove the component entirely.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
0

Thank you David & Chris and all others for your time on this. For now, I have added new components as a new feature so that all existing components can belong to same feature. This has removed the error for me.

Sarma
  • 1
  • 3