自动运行方法

发布于 2024-07-30 12:52:03 字数 234 浏览 8 评论 0原文

我正在使用 NSIS 来制作安装程序。

1.我必须在第一步中执行Mysql安装程序

2.然后在成功执行第1步(即在系统中安装mysql)后,我需要执行我的数据库脚本。

3.现在我需要运行 myproj.exe

这里的问题是安装程序直接并行运行所有步骤。 但我必须一步一步地运行它们,并且只有在成功执行前面的步骤之后才能运行它们。

谢谢, 斯里尼瓦斯。

I am using NSIS for making an installer.

1.I have to just execute Mysql setup in the first step

2.And later on the successful execution of the step1 (that is installing the mysql in the system) I need to execute my database scripts.

3.now i need to run my myproj.exe

Here the problem is installer is directly running all the steps parallelly.
But i have to run them step by step and only after the successful execution of the previous steps.

Thanks,
srinivas.

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

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

发布评论

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

评论(2

我早已燃尽 2024-08-06 12:52:03

我真的不确定你的安装程序是如何并行运行任何东西的。 NSIS 按顺序执行命令。 除非你不遗余力地使用我从未见过的命令来让 NSIS 并行运行,否则它不会并行运行任何东西。 您可以发布一些安装程序的源代码,以便我看看您是如何实现这一目标的吗?

您可以使用 nsExec::ExecToStack 命令启动 MySql 安装程序并从安装程序获取返回代码,如下所示:

!include LogicLib.nsh    
StrCpy $myReturnCode "0"
nsExec::ExecToStack "$TEMP\MySqlSetup.exe"
Pop $myReturnCode
${If} "$myReturnCode" == ""
${OrIf} "$myReturnCode" == "0"
    // Presumably it worked, continue with installation
${Else}
    // Error, don't continue with installation
${EndIf}

请注意,nsExec::ExecToStack 将等待可执行文件返回,然后再运行下一个 NSIS 命令。

I'm really not sure how your installer is running anything in parallel. NSIS executes commands sequentially. Unless you're going to great lengths using commands I've never seen to get NSIS to run in parallel, it's not running anything in parallel. Can you post some of your installer's source code so that I can see how you're accomplishing this?

You can use the nsExec::ExecToStack command to launch your MySql setup and get a return code from the installer like so:

!include LogicLib.nsh    
StrCpy $myReturnCode "0"
nsExec::ExecToStack "$TEMP\MySqlSetup.exe"
Pop $myReturnCode
${If} "$myReturnCode" == ""
${OrIf} "$myReturnCode" == "0"
    // Presumably it worked, continue with installation
${Else}
    // Error, don't continue with installation
${EndIf}

Note that nsExec::ExecToStack will wait for the executable to return before running the next NSIS command.

愚人国度 2024-08-06 12:52:03

我对 NSIS 了解不多,但我们有一个安装脚本,可以使用 ExecWait 调用可执行文件:

ExecWait "msiexec /passive /liare+ ${SETUP_LOG_FILE} -i $TEMP\MyMsi.msi" $R0

也许这就是您应该使用的。 这是NSIS 快速指南

I don't know a lot about NSIS, but we have an install script that calls executables with ExecWait:

ExecWait "msiexec /passive /liare+ ${SETUP_LOG_FILE} -i $TEMP\MyMsi.msi" $R0

Maybe that's what you should be using. Here's a Quick Guide to NSIS.

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