使用 pascal (innosetup) 获取文件的最后更新时间
在 innosetup 脚本的卸载部分中,我想添加一个检查来查看特定文件的上次更新日期时间是否发生在最近 10 分钟内。
有谁知道 innosetup 兼容的 pascal 代码吗?
In the uninstall portion of an innosetup script, I'd like to add a check to see if a specific file's last update datetime occured within the last 10 mins.
Does anyone know the innosetup compatable pascal code for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用Windows API函数
GetFileAttributesEx
来获取最后修改日期。 将其放入 [CODE] 部分应该可以工作:您可以通过修改安装程序项目的 InitializeWizard 函数来测试它,如下所示:
在我的系统 (XP SP3) 上,消息框显示:
2008-08-04
You can use the Windows API function
GetFileAttributesEx
to get the last modification date. Putting this in your [CODE] section should work:You can test it by modifying the InitializeWizard function of your installer project like this:
On my system (XP SP3), the messagebox says:
2008-08-04
目前支持此功能的唯一方法是使用 DLL 并将其链接到您的卸载。
您必须编写具有您想要的功能的 DLL。
默认的 INNOSetup 安装有示例向您展示如何调用 DLL。 之后应该很简单。
只要会写一个DLL就可以了。
哈特哈,
瑞安.
At the moment the only way to support this would be to use a DLL and link it to your uninstall.
You will have to write the DLL that has the functionality your want.
The default INNOSetup install has examples showing you how to call DLLs. After that it should be simple.
As long as you can write a DLL.
HTH,
Ryan.