添加并获取CHM文件版本 [英] Add and get CHM file version
问题描述
我需要添加版本信息并从CHM文件中检索它,以便有可能向用户发出有关新的 CHM文件版本可用和下载的警报消息.
I need to add version info and retrieve it from the CHM file to make it possible to make an alert message to a user about a new CHM-file version available and downloaded.
这意味着,我应该在不同机器(服务器和客户端)上比较 CHM 的版本.
It means, that I should compare versions of CHM on different machines (Server and clients).
另一种方法是日期和时间检查,但是我应该记住时区,所以这很复杂,因为根据Windows SDK关于SetFileTime
函数和FILETIME
结构的帮助,还应该记住不同的文件系统. .
The other way is date and time checking, but I should remember about time zones, so this is complicated, because also one should remember about different file systems, according to Windows SDK help about SetFileTime
function and FILETIME
structure.
如果有人知道窍门-请分享.
If someone knows the trick - please share.
推荐答案
.chm文件没有版本信息.您将需要找到一些其他方法来标记文件版本.
.chm files don't have version information. You will need to find some alternative way to mark the file version.
我想到的一种方法是在包含该版本的帮助文件中包含一个主题.我想这个主题将被隐藏,没有任何其他主题链接,不在目录等中.
One way that occurs to me is to include a topic in the help file that contains the version. I imagine that this topic would be hidden, that is not linked by any other topic, not in the table of contents, etc.
剩下的就是让您的应用程序能够从帮助文件中读取该主题.我敢肯定,如果您可以使用.chm文件解析器,则可以完成该操作.也许更容易获得平台浏览器为您阅读的主题.您可以使用IHTMLDocument2
读取URI,如下所示:
All that remains is for your application to be able to read that topic from the help file. I'm sure that can be done with a .chm file parser, if you can obtain one. Perhaps more easily you can get the platform browser to read the topic for you. You can use IHTMLDocument2
to read a URI like this:
mk:@MSITStore:C:\somedir\somefile.chm::/html/SomeTopic.html
这篇关于添加并获取CHM文件版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!