473,385 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Manually extracting MSI files

Hi,

Introduction:
***************************
I am using the MSI API to extract MSI embedded files, I do this by iterating
through all of the records in the ‘_Streams’ table and dumping each to a
local directory on the disk, the following illustrate this:
01)MsiDatabaseOpenView(m_hMSI,
L"SELECT `Name`,`Data` FROM `_Streams`",
&hStreamsView)
02)MsiViewExecute(hStreamsView, NULL);
for each record in the _Streams table
03)MsiViewFetch(hStreamsView, &hStreamRecord)
04) MsiRecordGetString(hStreamRecord, 1,
pPackedFileName, &dwBufSize)
05)CreateFile
While there is still data in the stream
06)MsiRecordReadStream(hStreamRecord, 2,
(char*)pbtStream, &dwBufSize);
07)WriteFile

The problem:
****************************
Some MSI installation has the files embedded in a CAB file named as a GUIDs,
this CAB contain the installation files, the files are named as GUIDs
resembling the data held in the ‘File’ field of the ‘File’ table…

My Question:
****************************
Is it possible to use the MSI API to extract the ‘real’ file directly from
the MSI? Is there a method for extracting embedded files according to the
‘FileName’ column of the ‘File’ table?
My alternative is to manually dump the ‘_Streams’ table ( as I do today ),
then to identify the CAB file according to it’s signature ( I have to
identify the file according to it’s signature as the name of the CAB is a
GUID… ), extract it and to rename the extracted files according to the
File->FileName mapping provided by the ‘File’ table.
I AM SURE THERE IS AN ELEGANTH WAY TO DO THAT… What it is?
--
Nadav
http://www.ddevel.com

Nov 17 '05 #1
0 1007

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Nazgul | last post by:
Hi! I want to implement a small tool in Python for distributing "patches" and I need Your advice. This application should be able to package all files chosen by a user into a self-extracting.exe...
2
by: Avi | last post by:
hi, Can anyone tell me what the problem is and how to solve it The following piece of code resides on an asp page on the server and is used to download files from the server to the machine...
0
by: Nadav | last post by:
Hi, Introduction: *************************** I am using the MSI API to extract MSI embedded files, I do this by iterating through all of the records in the ‘_Streams’ table and dumping...
3
by: wenz | last post by:
Hi I have an exe which is actually a self-extracting zip file that i would like to run to extract all the files. I have the code showing how to use the j# classes and library to extract zip files...
2
by: Dickyb | last post by:
Extracting an Icon and Placing It On The Desktop (C# Language) I constructed a suite of programs in C++ several years ago that handle my financial portfolio, and now I have converted them to...
0
by: k_nil | last post by:
I have a link on my web page for a self extracting executable file placed on the server. When the link is clicked, 1) i could see dialog box with open or save options 2) when open clicked, self...
1
by: Hari Sekhon | last post by:
Hi, I've written a script to run on windows to extract all zips under a given directory path to another directory path as such: python extractzips.py <fetch all zips under this dir> <put all...
2
by: Robert McEuen | last post by:
Sorry if this double-posts...Google doesn't do a very good job of communicating whether something has posted or not. Using Access 97, WindowsXP Is there a way to pass command line parameters...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
4
by: Ant | last post by:
Hi all, My kids have a bunch of games that have to be run from CD (on Windows XP). Now they're not very careful with them, and so I have a plan. I've downloaded a utility (Daemon Tools) which...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.