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

How to delete a file on install?


4 replies to this topic

Matthias1967

Matthias1967
  • Full Members
  • 92 posts

Posted 10 February 2010 - 07:32

Hello,

In my setup, I have to conditionally delete some files on installation. The conditions are derived from the system configuration and set early in the execute sequence.

When I use the RemoveFile table for deleting the files, I have to create a separate component for each of them, because the conditions are not used elsewhere.

A first-time install with the condition evaluating to FALSE results in the file not being deleted, which is OK. The log file says:

QUOTE

MSI (s) (E4:D8) [06:56:25:265]: Component: DeleteMyFile; Installed: Absent;  Request: Local;  Action: Null


When I start a repair or minor upgrade and the condition evaluates to TRUE (I checked in the log file that the corresponding property is set), I expect the file to be deleted. But it is not deleted, and the log file says:

QUOTE

MSI (s) (70:6C) [07:22:10:593]: Component: DeleteMyFile; Installed: Local;  Request: Null;  Action: Null


So what can I do to get this file reliably deleted if the corresponding condition is true? Can I achieve this using the RemoveFile table, or do I have to use a custom action here?

Regards,

Matthias

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 10 February 2010 - 18:40

Is the component set to "reevaluate condition"=yes ?

Matthias1967

Matthias1967
  • Full Members
  • 92 posts

Posted 11 February 2010 - 07:12

No, I have not done this so far.

As far as I have read Windows Installer documentation before, i have thought that this flag should hardly ever be used. Or, to put it the other way: What is the reason for not marking most components as "transitive"?

Best regards,

Matthias

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 11 February 2010 - 15:36

It depends on your desired behaviour. But I agree that transitive should be used in most cases (for components that do have a condition). Transisitive=yes is the same as reevaluate=yes, but InstallShield's default is no. This could be the cause of your problem.

Matthias1967

Matthias1967
  • Full Members
  • 92 posts

Posted 18 March 2010 - 20:36

Hello Stefan,

this was not exactly my point.

Yes, InstallShield's default is transitive=no.
But Windows Installer documentation for the Component table (not InstallShield documentation) says

QUOTE

This bit should only be set for transitive components. See Using Transitive Components.


And the entry "Using Transitive Components" says

QUOTE
A typical use for transitive components is to prepare a product to gracefully reinstall during an upgrade from Windows 98 to Windows XP.


i.e. something far from what I plan to do. This has sounded to me like Microsoft strongly advising against using the "transitive" Attribute, and this is why I have not dared to use it so far.

Best regards,

Matthias