CHM file version? 
Author Message
 CHM file version?

Okay, I'm not sure whether this is a subject concerning helpauthoring or the
VB6 P&D wizard. I've seen this question in google, but couldn't find any
answer.

I made a setup with the VB6 P&D wizard. It's a setup for letting users
upgrade my application. At the stage that the new helpfile is installed a
message will appear, saying "A file being copied is not newer than the file
currently on your system". And asking the user to copy or not to copy the
new file. The file for the upgrade is certainly newer than the other one.
It's completely built new. I wasn't aware that a CHM file had a
versionnumber.

How can I avoid that message?

Regards, Bas Prins.



Tue, 28 Sep 2004 04:21:52 GMT  
 CHM file version?
It doesn't. Setup must be checking the file's date stamp and/or file size.

--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.

*BASIC: Briskly Achieved Solutions Impossible in C*


Quote:
> Okay, I'm not sure whether this is a subject concerning helpauthoring or
the
> VB6 P&D wizard. I've seen this question in google, but couldn't find any
> answer.

> I made a setup with the VB6 P&D wizard. It's a setup for letting users
> upgrade my application. At the stage that the new helpfile is installed a
> message will appear, saying "A file being copied is not newer than the
file
> currently on your system". And asking the user to copy or not to copy the
> new file. The file for the upgrade is certainly newer than the other one.
> It's completely built new. I wasn't aware that a CHM file had a
> versionnumber.

> How can I avoid that message?

> Regards, Bas Prins.



Wed, 29 Sep 2004 00:19:29 GMT  
 CHM file version?



Quote:
> It doesn't. Setup must be checking the file's date stamp and/or file size.

> --

I found the Function in Setup1 which seems to be responsible. It checks for
file version, but if non it'll check for date stamp. But I'm sure the file I
was installing had a later date stamp than the one already existing. The
dialog was showing not a version number, but just double quotes (") for both
files. So I think this function evaluated that there was version
information, but that this information was the same on both files. Not very
intelligent, as also the file sizes are significantly different.

Here's the function from the module (basSetup1).

'-----------------------------------------------------------
' FUNCTION: SourceFileIsNewer
'
' Determines whether a file to be installed is newer than an
' existing file already on the system.
'
' IN: [sFile] - structure containing information about the source file
'     [strSrcName] - name of source file
'     [strSrcDir] - location of source file
'     [strDestName] - name of destination file
'     [strDestDir] - destination directory for file
' OUT: [strDestVer] - a string representing the version of the destination
file
'
' Returns: True if there is no existing (destination) file.
'          True if the destination file does exist and the
'          source file has a newer version.
'          True if the destination file does exist but one
'          or both files does not have version information
'          and the source file has a newer timestamp.
'          False otherwise
'-----------------------------------------------------------
'
Private Function SourceFileIsNewer(sFile As FILEINFO, strSrcName As String,
strSrcDir As String, strDestName As String, strDestDir As String, ByRef
strDestVer As String) As FileComparison
    Dim fSrcVer As Boolean
    Dim sSrcVerInfo As VERINFO
    Dim fRemoteReg As Boolean
    Dim sDestVerInfo As VERINFO
    Dim datDest As Date
    '
    'The stuff below tries to save some time by pre-checking whether a file
    'should be installed before VerInstallFile does its thing.
    'Basically, if both files have version numbers, they are compared.
    'Otherwise, we compare date.
    '
    On Error Resume Next
    strDestVer = vbNullString
    '
    'Always attempt to get the source file version number.  If the setup
    'info file did not contain a version number (sSrcVerInfo.nMSHi =
    'gintNOVERINFO), we attempt to read the version number from the source
    'file.
    '
    fSrcVer = True
    sSrcVerInfo = sFile.sVerInfo
    If sSrcVerInfo.FileVerPart1 = gintNOVERINFO Then
        fSrcVer = GetFileVerStruct(strSrcDir & strSrcName, sSrcVerInfo)
    End If
    '
    'If there is an existing destination file with version information, then
    'compare its version number to the source file version number.
    '
    If fSrcVer Then
        fRemoteReg = (UCase$(sFile.strRegister) = mstrREMOTEREGISTER)
'mstrREMOTEREGISTER is uppercase
        If GetFileVerStruct(strDestDir & strDestName, sDestVerInfo,
fRemoteReg) Then
            With sDestVerInfo
                strDestVer = CStr(.FileVerPart1) & "." & _
                             CStr(.FileVerPart2) & "." & _
                             CStr(.FileVerPart3) & "." & _
                             CStr(.FileVerPart4)
            End With
            'Both source and destinations have versions. Compare them.
            SourceFileIsNewer = IsNewerVer(sSrcVerInfo, sDestVerInfo)
            Err.Clear
            Exit Function
        End If
    End If
    '
    'Since neither file has a version, the best we can do is compare dates.
    '
    Err.Clear
    datDest = FileDateTime(strDestDir & strDestName)
    If Err.Number = 0 Then
        If sFile.varDate < datDest Then
            SourceFileIsNewer = fcNewer
        ElseIf sFile.varDate = datDest Then
            SourceFileIsNewer = fcEquivalent
        Else
            SourceFileIsNewer = fcOlder
        End If
    Else
        'Evidently the destination file does not exist. Therefore the source
        '   file should be copied and can be considered newer.
        SourceFileIsNewer = fcNewer
    End If
    Err.Clear
End Function



Wed, 29 Sep 2004 02:32:33 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to access .chm file using html href tag

2. Accessing chm Help files

3. Help with code to pull up .chm help file

4. HTML help file (.chm) not recognized by VBA in excel

5. How to open .chm file?

6. Help Visual Basic .chm or .hlp files

7. Interact with a .CHM file?

8. .CHM file

9. Shell function with .chm file

10. Missing *.CHM files when accessing VB5-help...

11. Help: Lauch HTML Help (.chm) file

12. Calling .chm help file?

 

 
Powered by phpBB® Forum Software