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

Version of a file compressed in a CAB file


4 replies to this topic

Ajawl

Ajawl
  • Members
  • 54 posts

Posted 17 September 2002 - 08:55

Hello,
I need to identify, while the installation is running, the version of a file which is being installed. Other components will be installed (or not) depending on the version of this file. The problem is that this file is compressed in the CAB file with the other files. If I release a setup with uncompressed files, then I can easily write a script to identify the version of this file. But my release must be compressed. Is there any way to identify the version of a file in a CAB file?

Thank you very much for your help.
Ajawl

Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 17 September 2002 - 14:19

Most build tools fill in the file table when they create a cab. The version of the file is recorded in the file table.  You can get at this value relatively easily.
Ian Blake
(Currently Unemployed)

Ajawl

Ajawl
  • Members
  • 54 posts

Posted 17 September 2002 - 15:58

Hi Ian Blake,
Thank you for your help. But I have never done something like this. How can I access the File Table (or other tables) from my MSI file during the installation? Is there any function that I can use from InstallShield Script?
I have already opened my MSI file with ORCA and the File Table was correct filled with the version of the files.
Thank you again,
Ajawl

Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 18 September 2002 - 10:18

I don't know about InstallScript

// Open The Active Database
hDB = MsiGetActiveDatabase(hMsi);

// use an SQL query to create a view
MsiDatabaseOpenView(hDB, "SELECT * FROM File WHERE File='F1234_MyFile.dll', &hView);

// Exectute The View
MsiViewExectute(hView, 0);

// Get the Record from the View
MsiViewFetch(hView, &hRecord);

// Read a string from the View
BufferLength = 24;
MsiRecordGetString(hRecord, 5, VersionBuffer, &BufferLength);l


This can be done from install script.  I am not sure if I got the field index right in MsiGetRecordString.  You should add code to check all results and release handles when you have finished with them.
Ian Blake
(Currently Unemployed)

Ajawl

Ajawl
  • Members
  • 54 posts

Posted 18 September 2002 - 12:53

I will try that. Thank for your help.
Ajawl  :)