使用 nsis 安装程序复制文件夹,仅显示一个复制多个文件夹的状态窗口,同时复制多个文件夹
NSIS安装程序的CopyFiles在复制不同的文件夹时显示不同的“复制操作的Windows状态窗口”,但我希望只显示一个状态窗口,无论我复制一个还是两个或五个文件夹,就像在Windows中,当我们选择两个文件夹时,则仅显示一个复制状态窗口,其中显示两个文件夹的复制操作进度。
这可能吗?我想复制多个文件夹,但只显示一个复制操作的状态窗口。
CopyFiles of NSIS installer displays different "Windows Status windows of the copy operation" when copying different folders, but i want that only one status window is shown ,whether i copy one or two or five folders, like in Windows, when we select two folders , then only a single COPY STATUS Window is shown in which the progress of copy operation for both the folders is displayed.
Is this possible? I want to copy multiple folders, but show only one status window of the copy operation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能使用仅允许单个“来自”路径的
CopyFiles
来做到这一点。这里有三个替代方案:您可以执行第一个操作,检查错误标志以查看用户是否取消了它,如果未设置,则在第二个操作上使用
/SILENT
。您可以在两者上使用
/SILENT
(就个人而言,我从不使用CopyFiles没有 /SILENT,因为我不希望用户 取消它。如果你真的愿意,你可以通过直接 DLL 调用来完成 - 我不知道该函数是什么,我希望你需要构造一个以 null 分隔的双 null 终止字符串,所有这些这对 NSIS 来说很麻烦。我怀疑你会认为这是值得的。如果您确实想这样做,则对于以空分隔的字符串,请使用 NullByte.nsh,我们在 PortableApps.com 为 PortableApps.com 启动器编写(用于处理 kernel32::GetPrivateProfileSection - 我们已经切换到解析 INI 文件纯 NSIS,因为它更快且没有错误;我们还将用于处理服务)。
You can't do it with
CopyFiles
which only allows a single "from" path. Here are three alternatives:You could do the first, check the error flag to see if the user cancelled it and if it's not set use
/SILENT
on the second.You could use
/SILENT
on both (personally I never use CopyFiles without /SILENT as I don't want the user to be able to cancel it).If you really want to, you could do it with a direct DLL call - I don't know what the function would be and I expect you would need to construct a null-separated double-null-terminated string, all of which is fiddly with NSIS. I doubt that you'll think it's worth it. If you really want to do it this way, for a null-separated string use NullByte.nsh which we at PortableApps.com wrote for the PortableApps.com Launcher (for dealing with kernel32::GetPrivateProfileSection - we've since switched to parsing the INI file in pure NSIS as it's faster and not buggy; we will also use for dealing with services).