Geeks With Blogs
Demystifying Windows Setups Windows Installer and the Technology That Surrounds It
I haven't tested this macro, but it should work:
    Dim oFSO
    Dim tblFile, tblWiseSourcePath
    Dim rowFile, rowWiseSourcePath
    Dim fileVersion
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Set tblFile = WTables("File")
    Set tblWiseSourcePath = WTables("WiseSourcePath")
    On Error Resume Next
    For Each rowFile In tblFile.WRows
        rowWiseSourcePath = tblWiseSourcePath.WRows(rowFile("File"))
        fileVersion = oFSO.GetFileVersion(rowWiseSourcePath("SourcePath"))
        If fileVersion <> "" Then
            rowFile("Version") = CStr(fileVersion)
        End If

The macro is triggered by the Save event.  If your SourcePath uses a path variable, you will need to resolve the path variable in the WisePathVariable table and use a string replacement on the value obtained from the SourcePath column in the WiseSourcePath table.  If you don't do this, the GetFileVersion method will fail because it is not a valid path. Posted on Friday, March 7, 2008 12:21 PM Windows Installer , Wise Installation | Back to top

Comments on this post: Got bit by a bug... Part 2

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Aaron Shurts | Powered by: