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 get a file version from the installer db?


2 replies to this topic

mat

mat
  • Members
  • 5 posts

Posted 27 February 2003 - 16:23

Hello!

I want to implement one function which checks if one file (e.g. 'test.exe';) will be overwritten during a installation if the file version of the installed file is older than the file version in the install package.
To check the file version of the installed file 'test.exe' is not the problem, but how can I get the file version from the file to be installed ('test.exe';) from the installer database?
My idea is to open the installer database with this code:

hDatabase=MsiGetActiveDatabase(hMSI);
strQuery="SELECT Version FROM File WHERE FileName='test.exe'";
nResult = MsiDatabaseOpenView(hDatabase,strQuery,hView);

So I get a database view called "hView", but I can't get the "version" from this view because I don't know how to extract information from a view and I couldn't also find any information about that.
Maybe my way is wrong and anyone knows another solution for my problem, this would be really great.
Otherwise if anybody could help me with the extraction from a view...

Thanks for everything and for your help.

mat

thomaz

thomaz
  • Members
  • 15 posts

Posted 06 March 2003 - 19:33

You are on the right track.
Now you call MsiViewExecute, MsiViewFetch and then MsiRecordGetString
Regards,Thomaz

mat

mat
  • Members
  • 5 posts

Posted 25 April 2003 - 13:44

Sorry, but after a long time I tried to solve my problem, but I had no luck.
Is anyone here able to help me again with some more details?

Thank you very much.

mat