How to run a .BAT file in InstallShield?

原创 2007年09月18日 18:13:00
InstallShield做的安装包可以执行exe、vbs脚本、js脚本,就是不能执行bat??找这个答案半天。
 
终于在官方论坛找到了比较perfect的答案。cmd.exe /c batfilename.bat ,咋就没想到呢。
 
老外的说明很详细了,不多说了,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().
 

相关文章推荐

How to Run Hadoop in the Cloud

In this excerpt from the O'Reilly publication Hadoop: The Definitive Guide, Second Edition, we look ...

How to Run a Program in Compatibility Mode

因为应用程序跑在兼容模式下的时候,通过读取注册表RegQueryValueEx和GetVersionEx得到的系统名称和版本号是兼容模式下的操作系统名称和版本号,所以不得不加以区分和设定,一下是三种设...

How to Build and Run Android L 64-bit ARM in QEMU

As many others, I can't wait to put my hands on Android running on aarch64 (arm-v8) and as many othe...

how to compile and run cocos2dx in linux

I believe for android development, linux is much better than windows. Originally development in visu...

How To Generate An XML File As A Target Datastore Using ODI In An Integration Interface ? [ID 454268

How To Generate An XML File As A Target Datastore Using ODI In An Integration Interface ? [ID 454268...

How To Install 11.2 / 12.1 Database/Client Software In Silent Mode Without Using Response File

Applies to: Oracle Universal Installer - Version 11.2.0.1 and later Oracle Database - Enterprise ...

how to reslove java.lang.UnsupportedClassVersionError: Bad version number in .class file

how to reslove java.lang.UnsupportedClassVersionError: Bad version number in .class file
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:How to run a .BAT file in InstallShield?
举报原因:
原因补充:

(最多只允许输入30个字)