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

Detect which files are to be installed/uninstalled


4 replies to this topic

rvacaru

rvacaru
  • Members
  • 4 posts

Posted 17 January 2005 - 16:40

Hi


I have small problem.

I have a Custom Action that must check which files will be replaced by install/uninstall patches and react before MSI displays the FilesInUSe dialog.

For the moment, I can manage succesfuly installation (reading the info in File table and comparing local version of the file, with the one in File table), but when uninstalling a patch, I do not know because the version to install can be lower for other files, not included in my patch.

So, question is, how can I detect (at runtime without looking in the cab file) which files are to be installed/uninstalled ?

Thank you!

Radu

PS: I tried already to use the _TransformView table, but it seems to be not available at that moment and atch table is empty because I include complete files

Edited by rvacaru, 18 January 2005 - 09:17.


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 18 January 2005 - 10:34

Try enumerating all components and check the state of each component. For every component marked for reinstall, enumerate all files. The component should also state the directory.

The Files In Use dialog is calculated/displayed during InstallInitialize, so schedule your CA just before it.

rvacaru

rvacaru
  • Members
  • 4 posts

Posted 18 January 2005 - 11:53

Thank you for idea!

How can I know that a component is marked for reinstall ?

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 19 January 2005 - 10:28

Try MsiGetComponentState (assuming you use a C-DLL). I would say that the current state, and the action of the component are both INSTALLSTATE_SOURCE. But don't take my word for it, you better do some extra testing on this.
Suggested reading on component states is an article "Conditional Statement Syntax" in Msi.chm.

rvacaru

rvacaru
  • Members
  • 4 posts

Posted 21 January 2005 - 11:47

Thank you for great idea!

Now I have just one small issue...

If I have feature containing 2 DLLs, and the patch contains just one of them, the ComponentState is set to Local for both of them during patch uninstall (all others DLLs have INSTALLSTATE_UNKNOWN, that is perfect).

Now, question is how do I know that _just_ one DLL will be replaced inside the feature ?