Inno Setup 安装后隐藏文件夹

发布于 2024-12-14 02:09:15 字数 162 浏览 0 评论 0原文

我的应用程序有一个文件文件夹,所有文件都标记为“隐藏”(包括文件夹本身)。但是,除非我先删除“隐藏”属性,否则 Inno Setup 不会复制它们进行安装。

很公平,但是有没有办法让 Inno Setup 在我的最终用户计算机上完成安装后将已安装的文件夹标记为“隐藏”?

谢谢。

My application has a folder of files that are all marked as "hidden" (including the folder itself). However, Inno Setup won't copy them for installation unless I remove the "hidden" attribute first.

Fair enough, but is there a way to make Inno Setup mark the installed folder as "hidden" after it finishes setup on my end-user's machine?

Thanks.

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

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

发布评论

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

评论(2

嗼ふ静 2024-12-21 02:09:15

请参阅 Attribs 参数了解 [Dirs] 部分中的条目。

[Dirs]
Name: "{app}\blah"; Attribs: hidden;

请注意,这并不会真正阻止人们看到它,只是让它看起来像是您有什么东西要隐藏。

See the Attribs parameter for entries in the [Dirs] section.

[Dirs]
Name: "{app}\blah"; Attribs: hidden;

Note that this won't really stop people from seeing it, just make it look like you have something to hide.

非要怀念 2024-12-21 02:09:15

首先,确保仅隐藏目录,而不隐藏子目录。假设它的名称是srcHiddenDir
现在,创建另一个目录dstHiddenDir,但现在不要将其隐藏。但它应该是空的。

然后,打开 settings.json,并将所有出现的 srcHiddenDir 替换为 dstHiddenDir

现在,准备像平常一样复制文件。在代码的一部分中,您将得到:

[Files]

Source: "wherethewholecodeis\phpdesktop\phpdesktop-chrome.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "wherethewholecodeis\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "wherethewholecodeis\*srcHiddenDir*\*"; DestDir: "{app}\*dstHiddenDir*"; Attribs:hidden; Flags: ignoreversion recursesubdirs createallsubdirs

然后,您需要编写:

[Dirs]
Name: {app}\dstHiddenDir; Attribs:hidden;
Name: {app}\dstHiddenDir\application; Attribs:hidden;
Name: {app}\dstHiddenDir\database; Attribs:hidden;
Name: {app}\dstHiddenDir\css; Attribs:hidden;
....

...以及您想要隐藏的所有子目录,只是为了更安全。但注意这些子目录应该是真实的,并且位于源/目标中。否则,当您运行安装程序时,错误将显示这些目录不存在。

现在,编译程序。
希望这有帮助。

First of all, ensure that ONLY the directory is hidden, and not the subdirectory. Say its name is srcHiddenDir.
Now, create another directory dstHiddenDir, but dont make it hidden now. But it should be empty.

Then, open the settings.json, and replace all the occurrences of srcHiddenDir with dstHiddenDir.

Now, Make it ready to copy files as usual. In one part of the code, you will get:

[Files]

Source: "wherethewholecodeis\phpdesktop\phpdesktop-chrome.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "wherethewholecodeis\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "wherethewholecodeis\*srcHiddenDir*\*"; DestDir: "{app}\*dstHiddenDir*"; Attribs:hidden; Flags: ignoreversion recursesubdirs createallsubdirs

Then, you need to write:

[Dirs]
Name: {app}\dstHiddenDir; Attribs:hidden;
Name: {app}\dstHiddenDir\application; Attribs:hidden;
Name: {app}\dstHiddenDir\database; Attribs:hidden;
Name: {app}\dstHiddenDir\css; Attribs:hidden;
....

...and all the subdirectories you want to hide, just for more safety. But Note those subdirectories should be genuine, and there in the source/destination. Else, when you run the setup, error will show that these directories dont exist.

Now, compile the program.
Hope this helps.

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