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

Can I use MsiViewFetch in a CA deferred Action?


6 replies to this topic

Dave I

Dave I
  • Members
  • 195 posts

Posted 12 February 2001 - 16:48

Is the installation database handle available for a deferred CA?  The function "MsiViewFetch()" in my IS script is returning 6 (INVALID HNADLE??) when deferred.  If I it move after InstallFinalize it works. (I have changes the type of CA.)

If the database is not available in a deferred CA and I have to put it after InstallFinalize is it feasible to Rollback at this point if things go pear shaped?


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 13 February 2001 - 08:10

MsiViewfetch takes the handle to a View, not to the database.

If setup is aborted after InstallFinalize, no rollback occurs.


Dave I

Dave I
  • Members
  • 195 posts

Posted 13 February 2001 - 09:36

Thanks Stefan,
           Can you just confirm that I should be able to query tables in a deferred action without any problems.  Obviously I have to get the properties for the deferred CA.

Having thought about it -  the backup files etc are removed at InstallFinalize so obviously I cannot rollback after this point


Dave I

Dave I
  • Members
  • 195 posts

Posted 13 February 2001 - 16:35

The error in my deferred CA is from the MsiGetActiveDatabase(hMSI) call which is returning 0.  I presumed that the database is not available so I used the command MsiOpenDatabase().  

This works fine apart from I do not know how to close the database after use. MsiCloseHandle is not recognised???

Any help would be much appreciated.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 13 February 2001 - 16:53

Quote
MsiCloseHandle is not recognised

What do you mean with this? Do you get compile time errors or run time errors? What type of custom action is this - a DLL?


Dave I

Dave I
  • Members
  • 195 posts

Posted 13 February 2001 - 17:18

Its OK Stefan I was being dozy,
     I didnt realise that it was a windows API call that I had to declare manually in my Installscript.

          "prototype MSI.MsiCloseHandle(HWND);"

Is it OK  to open and close the DB in this way in a deferred CA or am I going to violate any rules.

I am querying the database to find which components are enabled and getting the associated filenames.