如何使用 cscript 和 vbs 参数从 Inno Setup 脚本调用 vbs 脚本?

发布于 2024-08-13 14:36:24 字数 464 浏览 12 评论 0原文

以下是我用来尝试在 IIS 6 中创建虚拟目录的条目:

[Run]
Filename: {tmp}\cscript.exe mkvirtdir.vbs; Parameters: "-c LocalHost -w ""Default Web Site"" -v ""ectUpload_Server""", {app},""ectUpload_Server"""; WorkingDir: {tmp}; Flags: skipifdoesntexist; StatusMsg: Creating IIS Virtual Directory"

运行安装程序时出现以下错误:

Unable to execute file cscript.exe mkvirtdir.vbs ...
CreateProcess failed; code 2.
The system cannot find the file specified.

The following is an entry I'm using to attempt to create a virtual directory in IIS 6:

[Run]
Filename: {tmp}\cscript.exe mkvirtdir.vbs; Parameters: "-c LocalHost -w ""Default Web Site"" -v ""ectUpload_Server""", {app},""ectUpload_Server"""; WorkingDir: {tmp}; Flags: skipifdoesntexist; StatusMsg: Creating IIS Virtual Directory"

I get the following error when I run the setup:

Unable to execute file cscript.exe mkvirtdir.vbs ...
CreateProcess failed; code 2.
The system cannot find the file specified.

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

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

发布评论

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

评论(1

情域 2024-08-20 14:36:24

您收到“系统找不到指定的文件”。因为您提供了 cscript.exe 的绝对路径,该路径不在 {tmp} 目录中。 “cscript”应该已经在您的 PATH 中,因为它通常位于 C:\Windows\System32。来自 INNO 安装程序帮助文件:

安装或卸载使用的临时目录。这不是用户的 TEMP 环境变量的值。它是用户临时目录的子目录,由安装程序或卸载程序在启动时创建(名称类似于“C:\WINDOWS\TEMP\IS-xxxxx.tmp”)。当安装或卸载退出时,该目录中的所有文件和子目录都将被删除。在安装过程中,这主要用于提取要在 [Run] 部分中执行但安装后不需要的文件。

看看从文件名中删除 {tmp}\ 是否有帮助。

You are getting 'The system cannot find the file specified.' because you've provided an absolute path to the cscript.exe which is not located in the {tmp} directory. 'cscript' should already be in your PATH as it is located usually at C:\Windows\System32. From INNO Setup help file:

Temporary directory used by Setup or Uninstall. This is not the value of the user's TEMP environment variable. It is a subdirectory of the user's temporary directory which is created by Setup or Uninstall at startup (with a name like "C:\WINDOWS\TEMP\IS-xxxxx.tmp"). All files and subdirectories in this directory are deleted when Setup or Uninstall exits. During Setup, this is primarily useful for extracting files that are to be executed in the [Run] section but aren't needed after the installation.

See if removing that {tmp}\ from the filename helps.

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