How to run a .BAT file in InstallShield?
来源:互联网 发布:看图纸dwg软件 编辑:程序博客网 时间:2024/06/14 01:26
InstallShield做的安装包可以执行exe、vbs脚本、js脚本,就是不能执行bat??找这个答案半天。
终于在官方论坛找到了比较perfect的答案。cmd.exe /c batfilename.bat ,
咋就没想到呢。
![](/Editor/FCKeditor/editor/images/smiley/msn/whatchutalkingabout_smile.gif)
老外的说明很详细了,不多说了,Ctrl+C,Ctrl+V。
1. In the "Custom Actions" view, right click "Custom Actions" and select "Custom Action Wizard."
2. Set a name for the CA.
Click "Next."
3. Type: Launch an executable
Location: Stored in Directory Table
Click "Next."
4 Source: Select SystemFolder
Target: [SystemFolder]cmd.exe
you'll modify this in just a bit...
Click "Next."
5. Check "Wait..."
Click "Next."
6. In-Script Execution: try Deferred, but you may need to make that "Deferred In System Context" if you get permissions-related errors.
Click "Next."
7. Install UI Interface (<Absent..>)
Install Execute Sequence: sometime after "InstallFiles"
8. Okay, now take the directory table entry pointing to the install location of your batch file, let's say it's [MY_BIN], and let's say your batch file is called "MyBatch.bat". In the "Filename and Commandline" property of your new custom action (which currently says "[Systemfolder]cmd.exe") append the following: /c "[MY_BIN]MyBatch.bat"
That's just one solution. It's probably not recommended, but then again, neither is the use of batch files.
Alternatively, you could script a CA which essentially does the same thing using LaunchAppAndWait().
2. Set a name for the CA.
Click "Next."
3. Type: Launch an executable
Location: Stored in Directory Table
Click "Next."
4 Source: Select SystemFolder
Target: [SystemFolder]cmd.exe
you'll modify this in just a bit...
Click "Next."
5. Check "Wait..."
Click "Next."
6. In-Script Execution: try Deferred, but you may need to make that "Deferred In System Context" if you get permissions-related errors.
Click "Next."
7. Install UI Interface (<Absent..>)
Install Execute Sequence: sometime after "InstallFiles"
8. Okay, now take the directory table entry pointing to the install location of your batch file, let's say it's [MY_BIN], and let's say your batch file is called "MyBatch.bat". In the "Filename and Commandline" property of your new custom action (which currently says "[Systemfolder]cmd.exe") append the following: /c "[MY_BIN]MyBatch.bat"
That's just one solution. It's probably not recommended, but then again, neither is the use of batch files.
Alternatively, you could script a CA which essentially does the same thing using LaunchAppAndWait().
- How to run a .BAT file in InstallShield?
- How to run a _BAT file in InstallShield
- How to run test cases in a specified file?
- How to do sleep in bat file
- How to Run a .Jar Java File
- How to run a script in ubuntu?
- How to compile and run a simple java file in jenkins on Windows
- QT24&25 how to run exe file by clicking a button in Qt
- A example to run the Java APP in bat
- How to write mutiple graphs in a run in tensorflow
- How to: Run Partially Trusted Code in a Sandbox
- How to: Run Partially Trusted Code in a Sandbox
- How to run a Runnable thread in Android?
- How to Run a Program in Compatibility Mode
- How to remove a line from a file in java?
- how to unzip a file in a system directory
- How to build a product with InstallShield
- How to run a jar
- 在 HTML中显示XML数据的策略
- asp.net2.0 treeview控件用数据表做为数据源实现n级动态菜单
- asp.net session丢失 网上收集
- YMU技术架构及数据库系统设计原则
- JAVASCRIPT命令大全
- How to run a .BAT file in InstallShield?
- 基金分析和推荐
- 孙鑫《vc ++深入详解》第九章定制应用程序外观
- 设计模式学习笔记(十七)——Command命令模式
- JSP编程之编写Servlet类注意事项
- IsPostBack
- 踏踏实实学技术
- Script学习
- 我的VC之路--struct多种声明定义写法的小结