Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Why file is being removed when condition is not me


2 replies to this topic

TomekR

TomekR
  • Full Members
  • 6 posts

Posted 23 September 2010 - 07:19

I develop a merge module and of on the things to do is to remove log files on uninstall. These logs are not copied by installer but created during application life.
I've created a component to remove a file and also have added a condition based on UPGRADINGPRODUCTCODE property, as I want the log files to be removed only when uninstall, not when upgrading.

The problem I have is that log files are removed always.

I've examined MSM with Orca and everything seems to be OK:
1. in the Component table I found my component with condition:
CLUP.Agent.log.BCAEB422_6D90_4E24_BB9C_6413628A84E1 {0BA40548-261A-430E-B244-474EFC9E6D75} AGENTDIR.BCAEB422_6D90_4E24_BB9C_6413628A84E1 0 (NOT UPGRADINGPRODUCTCODE)
2. in the RemoveFiles table I found relevent entry:
RemoveLogs.BCAEB422_6D90_4E24_BB9C_6413628A84E1 CLUP.Agent.log.BCAEB422_6D90_4E24_BB9C_6413628A84E1 jf6x13ny.*|CLUP.Agent.log.* AGENTDIR.BCAEB422_6D90_4E24_BB9C_6413628A84E1 2


I've examined installation log made during the upgrade and found, that the condition property - UPGRADINGPRODUCTCODE - is set properly:
MSI (s) (B4:14) [08:09:01:448]: PROPERTY CHANGE: Adding UPGRADINGPRODUCTCODE property. Its value is '{A1D231E5-229D-425F-848F-D3A81C445257}'.

Log removal action occurs much later:
Action 8:09:39: RemoveFiles. Removing files
MSI (s) (B4:14) [08:09:39:841]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=175000)
MSI (s) (B4:14) [08:09:39:841]: Executing op: SetTargetFolder(Folder=C:\Program Files\ClUp\Agent)
MSI (s) (B4:14) [08:09:39:841]: Executing op: FileRemove(,FileName=Clup.Agent.log,,)

So why logs are removed?What is wrong?

Edited by TomekR, 23 September 2010 - 07:20.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 23 September 2010 - 07:58

Let me try to understand your logic:

During install (of the old version) UPGRADINGPRODUCTCODE is false, so your CLUP component gets installed.
Then you install a major upgrade which sets UPGRADINGPRODUCTCODE. So the component condition would become FALSE. However the transitive flag for the component is not set, so the condition is not re-evaluated.
But anyway the component gets uninstalled because it's part of the old version which is being uninstalled by the major upgrade.
Your RemoveFile table entry instructs Windows Installer to delete the log files if the component is being removed, which is the case.

Your problem is that you really want to condition the removal of the log file based on UPGRADINGPRODUCTCODE, not the installation of the CLUP component. But the RemoveFile table doesn't have this type of condition.

If this is your only RemoveFile entry, then you could condition the RemoveFiles action with Not UPGRADINGPRODUCTCODE instead.

Or you move the RemoveExistingProducts to the end of the sequence (and don't use a component condition) so that the component will stay installed during a major upgrade.

TomekR

TomekR
  • Full Members
  • 6 posts

Posted 23 September 2010 - 13:09

QUOTE (Stefan Krueger @ 2010-09-23 07:58)

During install (of the old version) UPGRADINGPRODUCTCODE is false, so your CLUP component gets installed.
Then you install a major upgrade which sets UPGRADINGPRODUCTCODE. So the component condition would become FALSE. However the transitive flag for the component is not set, so the condition is not re-evaluated.


Stefan, thx !
Now I understand why it doesn't work as I expected.

Edited by TomekR, 23 September 2010 - 13:10.