Commit 46aae81
committed
Fix installer deleting nsclient.ini on upgrade
The PurgeConfig component carried a `<RemoveFile Name="*.ini"
On="uninstall"/>` rule whose glob also matches the user's nsclient.ini.
Because RemoveFile entries are name-based and bypass MSI component
reference counting, that rule deletes nsclient.ini whenever the
component is removed - including when RemoveExistingProducts uninstalls
the previous version during a major upgrade. With RemoveExistingProducts
scheduled After InstallExecute (late), this fires after BackupConfig /
ExecWriteConfig have already restored the configuration, so the
just-restored nsclient.ini is deleted and NeverOverwrite on the config
component prevents a fresh copy from being laid down.
The `NOT OLDERVERSIONBEINGUPGRADED` guard on the component does not help:
a component whose <Condition> evaluates false is set to absent, and an
On="uninstall" RemoveFile fires exactly when the component goes absent -
so gating the purge off during upgrade actually triggers it.
There is no purely declarative way for an On="uninstall" RemoveFile to
distinguish a real uninstall from the upgrade-time removal of the old
product, and NSClient++ already goes to some length (BackupConfig /
ExecWriteConfig) to preserve configuration across upgrades. Removing the
component keeps nsclient.ini intact on upgrade. If purge-on-real-uninstall
is wanted later it should be a deferred custom action gated on
REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE.
Signed-off-by: Michael Medin <michael@medin.name>1 parent aeeccfa commit 46aae81
1 file changed
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 73 | | |
80 | 74 | | |
81 | 75 | | |
| |||
216 | 210 | | |
217 | 211 | | |
218 | 212 | | |
219 | | - | |
220 | 213 | | |
221 | 214 | | |
222 | 215 | | |
| |||
0 commit comments