How to run a _BAT file in InstallShield

 
 
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().

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用和引用的信息,InstallShield教程有三个文档,一个是chm格式的,一个是pdf的,还有一个是从网上摘抄的。对于软件开发人员来说,InstallShield是一个非常优秀的工具,用来打包自己的应用程序,可以用来创建安装程序和升级程序。所以,如果你想学习InstallShield的使用方法,可以参考这些教程文档来了解基本的使用方法和步骤。你可以根据自己的需要选择合适的教程文档格式来学习。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [installshield 教程](https://download.csdn.net/download/zhhf123/2674945)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [【教程】InstallShield使用完全教程](https://blog.csdn.net/weixin_33736649/article/details/85570270)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [InstallShield 2020 基本使用教程](https://blog.csdn.net/weixin_43203889/article/details/119056273)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值