Launch a Batch File With Windows Installer
Quote from: http://flexerasoftware.force.com/articles/en_US/HOWTO/Q111515
Synopsis
This article describes how to launch a batch file from a Windows Installer (MSI-based) setup.
Discussion
The following steps describe how to create a custom action that launches a batch file targeted to be installed to the main installation directory location (i.e., the location stored in the INSTALLDIR MSI property).
- Make sure that the installer is configured to install the batch file to the main installation directory location (i.e., the location stored in the INSTALLDIR MSI property)
- Launch the Custom Action Wizard. For more information, see the "Additional Information" section of this article.
- On the "Basic Information" dialog, enter a name (i.e., test) for the custom action in the Name field.
- Click the Next button.
- On the "Action Type" dialog, set the "Type" to "Launch an executable" and the "Location" to "Stored in the Directory Table".
- Click the Next button.
- On the "Action Parameters" dialog, set the "Source" to "SystemFolder" and the "Target" to the following:
"[SystemFolder]cmd.exe" /c "[INSTALLDIR]NameOfBatchFile.bat"
This command calls cmd.exe (the executable for the Windows command prompt) from the location stored in the SystemFolder MSI property and passes cmd.exe the path to the batch file. Cmd.exe accepts various parameters. For example, to have the command prompt window close after launching the batch file, use the /c parameter, as in the example above. To have the command prompt window remain open after launching the batch file, use the /k parameter instead. For more information regarding the parameters accepted by cmd.exe, see the "Additional Information" section of this article.
- Click the Next button.
- On the "Additional Options" dialog, keep the default values selected.
- Click the Next button.
- On the "Respond Options" dialog, keep the default values selected.
- Click the Next button.
On the "Insert into Sequence" dialog, set the "Install Execute Sequence" to "After InstallFinalize" and the "Install Execute Condition" to the following: Not Installed and VersionNT. This condition instructs the install to only execute the custom action during a first-time install on an NT-based target system.
Additional Information
This method is restricted to NT systems.
For more information about the Microsoft cmd.exe command interpreter, please refer to Microsoft TechNet article Cmd
For more information on the VersionNT property, please refer to MSDN article VersionNT Property
Launch a Batch File With Windows Installer的更多相关文章
- run commands in linux shell using batch file
adb shell as root after device rooted once device rooted, we must perform "su" before we g ...
- How to run a batch file each time the computer loads Windows
https://www.computerhope.com/issues/ch000322.htm#:~:text=Press Start%2C type Run%2C and press Enter. ...
- 解决ArcGIS安装之后出现的Windows installer configures问题
----Please wait while Windows installer configures ArcGIS Desktop Error Message错误信息 When launching A ...
- I Take It All Back: Using Windows Installer (MSI) Rollback Actions
Original Link: http://blogs.flexerasoftware.com/installtalk/2011/10/i-take-it-all-back-using-windows ...
- 【转】转移Package Cache文件夹,转移Windows Installer文件夹
详见http://blogs.msdn.com/b/heaths/archive/2014/02/11/how-to-relocate-the-package-cache.aspx (注意:若Wind ...
- Wix学习整理(3)——关于Windows Installer和MSI
原文:Wix学习整理(3)--关于Windows Installer和MSI 关于Windows Installer Windows Installer是微软Windows操作系统自带的一个软件安装和 ...
- 安装Windows Installer服务
Windows Installer 5.0.810.500 下载地址: 电信:http://mdl1.mydown.yesky.com/soft/201303/WindowsInstaller.rar ...
- .net平台 通过Windows installer 打包和部署实例操作
Windows installer 打包和部署 1.新建项目. 打开VS,新建项目->其他项目类型->安装和部署(Visual Studio Installer). 注:若VS2013 或 ...
- Windows Installer 服务启动错误 14007 的解决办法
问题: 在 本地计算机 无法启动 Windows Installer 服务. 错误代码 14007: 在活动的激活上下文中没有找到任何查找密钥. 这个问题似乎涉及到 Windows Installer ...
随机推荐
- 问题-Fastreport4 Memo打印时中文显示不全
问题现象:在使用Fastreport4制作打印工具时,发现Memo显示中文老是显不不全. 问题原因:可能是因为字符编码的原因,希望高人指点. 问题处理:将属性font-charset设置为DEFAUL ...
- javascript中的function对象
function对象都是Function的实例: > Object.getOwnPropertyNames(Function) [ 'length', 'name', 'arguments', ...
- poj 1149 PIGS【最大流经典建图】
PIGS Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18727 Accepted: 8508 Description ...
- CoreLocation框架的使用
CoreLocation框架使用 一.地图和定位的简介 1.应用场景 周边:找餐馆/找KTV/找电影院(团购APP) 导航:根据用户设定的起点和终点,进行路线规划,并指引用户如何到达(地图APP) 2 ...
- dubbo与spring mvc
安装 一.本地服务 1.定义服务接口: (该接口需单独打包,在服务提供方和消费方共享) public interface CustomerService { public String get ...
- POJ 3670 , 3671 LIS
题意:两题意思差不多,都是给你一个序列,然后求最少需要改变多少个数字,使得成为一个最长不升,或者最长不降子序列. 当然3671是只能升序,所以更简单一点. 然后就没有什么了,用二分的方法求LIS即可. ...
- QT 事件过滤器 eventFilter
在监测的代码里执行需要的行为. 这可以用event Filter来达到. 设置一个event filter有两个步骤: 1. 在目标对象上调用installEventFilter(),将监测对象注册到 ...
- Mac OS X 如何设置默认浏览器
有时候我们不希望在 Mac 中点击任何连接都打开的是 Safari,这需要修改默认浏览器设置,在 Mac OS X 中如何设置默认浏览器呢? 打开 Safari 的偏好设置,在「通用」选项卡中有「默认 ...
- linux上安装memcached
我的版本为Centos Release 5.3 (Final)使用这个命令可以知道你的Linux版本1.cat /etc/redhat-release首先要安装libevent库.cd /usr/lo ...
- css :after和:before
:before是css中的一种伪元素,可用于在某个元素之前插入某些内容.:after是css中的一种伪元素,可用于在某个元素之后插入某些内容. 举例: 1.结合border写个对话框的样式. < ...