how to get all filename contain in msi file before install?

I used C++ to create custom action , how to get all filename contain in msi file before install? I only get folder install through "INSTALLDIR". Thanks!

0 Comments   [ + ] Show comments

Answers (3)

Posted by: anonymous_9363 12 years ago
Red Belt
You need to interrogate the File table. The Platform SDK, a free d/l from Microsoft, has a number of VB Scripts which you could use as templates. One which springs to mind is WiExport.VBS.
Posted by: AngelD 12 years ago
Red Belt
If you are going to do this through a custom action you would need to as Ian mentioned enumerate the File table entries.
However you also need to take into account if the component the file is associated with will be installed or not. This is done by the CostFinalize action so you need to add your custom action after this CA and check if the component is set to be installed or not.
Posted by: jmcfadyen 12 years ago
5th Degree Black Belt
this excerpt should do what you need.

Set oView = session.database.openview("Select * FROM File")
Set oRecord = oView.Fetch
if oRecord is nothing then
exit do
end if
sComponent = oRecord.StringData(2)
cComponentState = session.componentRequestState(sComponent)

If session.componentRequestState(sComponent) > 1 Then
sFilePath = "[#" & oRecord.StringData(1) & "]"
sFilePathValue = FormatRecord(sFilePath)

sCompFldr = "[$" & oRecord.StringData(2) & "]"
sCompFldrValue = FormatRecord(sCompFldr)
sFileSize = oRecord.StringData(4)
sFileVersion = oRecord.StringData(5)
oLogFile.Writeline "FilePath: " & sCompFldrValue
oLogFile.Writeline "FileFldr: " & sFilePathValue
oLogFile.Writeline ""

CreateFile oRecord.StringData(2), sFilePathValue, sCompFldrValue, sFileSize, sFileVersion
End If
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ