如何让Inno Setup在搜索文件时忽略隐藏属性?

发布于 2024-09-01 04:03:23 字数 302 浏览 1 评论 0原文

我必须复制到包含隐藏文件的安装程序文件夹(在我的例子中为 Desktop.ini)。

我在 [Files] 部分中使用了与此类似的一行:

Source: "folder\*desktop.ini"; DestDir: "{app}\folder"; Flags: recursesubdirs uninsneveruninstall; Attribs: hidden

此行仅在我删除隐藏属性时才有效。如果所有文件都被隐藏,它会抱怨找不到任何文件。

如何配置 Inno 使用模式搜索隐藏文件?

I have to copy into the installer folders containing hidden files (in my case Desktop.ini).

I use a line similar to this one in the [Files] section:

Source: "folder\*desktop.ini"; DestDir: "{app}\folder"; Flags: recursesubdirs uninsneveruninstall; Attribs: hidden

This line only works if I remove the hidden attributes. If all are hidden, it complains that it could not find any files.

How can I configure Inno to search for hidden files using patterns?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伤痕我心 2024-09-08 04:03:24

目前还不能。如果您查看编译的源代码。 pas 并搜索 BuildFileList() 过程,您会发现对于通配符源目录,构建文件列表时会忽略隐藏文件:

if SourceIsWildcard then begin
  if FindData.dwFileAttributes and FILE_ATTRIBUTE_HIDDEN <> 0 then
    Continue;
  FileName := FindData.cFileName;
end

如果您有 Delphi,您可以当然只需删除此检查并重建编译器即可。

You can't, at present. If you have a look at the source of Compile.pas and search for the BuildFileList() procedure you will find that for wildcard source directories hidden files are ignored when the file list is built:

if SourceIsWildcard then begin
  if FindData.dwFileAttributes and FILE_ATTRIBUTE_HIDDEN <> 0 then
    Continue;
  FileName := FindData.cFileName;
end

If you have Delphi you could of course simply remove this check and rebuild the compiler.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文