如何动态计算 InnoSetup 中文件的目标路径?

发布于 2024-10-08 07:37:15 字数 110 浏览 0 评论 0原文

我需要在复制之前计算文件的目标路径。如果该路径不存在,我将不会在安装过程中复制该文件。

这可能吗?

例如,我可以调用某个computepath.exe并将结果存储到变量中吗?

I need to compute destination path for a file before copying. If the path does not exist I won't copy the file during installation.

Is this possible?

For example, can I call some computepath.exe an store the result into a variable?

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

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

发布评论

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

评论(1

黎夕旧梦 2024-10-15 07:37:15

您不需要为此调用外部程序。几乎任何计算都可以使用 pascal 脚本完成,然后您可以使用 FileOrDirExists() 函数来确定路径是否存在。

如果这还不够,您可以采取不同的方法:将文件提取到临时目录并调用computepathandcopy.exe,将临时文件名作为参数传递。 exe 将计算路径,检查它是否存在并执行文件复制。

You do not need to call a external program for that. Almost any computation can be done using pascal script, and you can then use the FileOrDirExists() function to determine if the path exists.

If that is not enough, you can take a different approach: extract the file to a temporary directory and call a computepathandcopy.exe passing the temp file name as a parameter. The exe will compute the path, check if it exists and perform the file copy.

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