如何在installshield安装程序中运行/包含批处理文件 [英] How to run/include batch file in installshield setup

查看:111
本文介绍了如何在installshield安装程序中运行/包含批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用installshield创建了设置,一切都是工作文件。现在我有一个批处理文件,想要使用安装程序运行。我知道我们可以创建自定义操作,我已经为运行PowerShell脚本创建了自定义操作,它运行正常。



任何人都可以帮助/指导我使用哪个自定义动作我可以执行批处理文件。



另外我想从installshield安装程序运行MySQL脚本,所以请帮我解决这个问题。



谢谢

Rajesh



我尝试了什么:



我试图创建不同的自定义操作,但我不确切知道哪个自定义操作用于执行批处理文件。

解决方案

必须在新的命令shell中启动批处理文件。所以自定义操作是 cmd.exe 可执行文件,批处理文件作为参数:

 [SystemFolder] \ cmd.exe / c full_path_of_batch_file 



类似可以用于MySQL脚本,其中 mysql.exe 也必须通过 cmd启动.exe 允许输入重定向:

 [SystemFolder] \cmd.exe / cfull_path_of_mysql.exe< full_path_of_sql_script 


可以通过网络研究找到:

在installshield中执行.BAT文件 - Stack Overflow [ ^ ]

InstallShield 2014,自定义操作和执行sql文件到MySQL - Stack Overflow [ ^ ]


I have created setup using installshield and everything is work file. Now I have one batch file and want to run with setup. I know we can create custom action and I have already created custom action for run powershell script and it is working fine.

Can anyone help/guide me for using which custom action I can execute the batch file.

Also I want to run MySQL script from installshield setup, so Please help me regarding that.

Thanks
Rajesh

What I have tried:

I have tried to create different custom action but I don't know exactly which custom action is used for execute the batch file.

解决方案

The batch file has to be started in a new command shell. So the custom action is the cmd.exe executable with the batch file as argument:

[SystemFolder]\cmd.exe /c full_path_of_batch_file


Similar can be used for MySQL scripts where mysql.exe must be also started via cmd.exe to allow input redirection:

[SystemFolder]\cmd.exe /c "full_path_of_mysql.exe < full_path_of_sql_script"

Or just put the script execution into another batch file if you know the pathes in advance.

Can be all found by web research:
execute .BAT file in installshield - Stack Overflow[^]
InstallShield 2014, Custom Actions and executing sql files into MySQL - Stack Overflow[^]


这篇关于如何在installshield安装程序中运行/包含批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆