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 ...
随机推荐
- BZOJ1901 - Dynamic Rankings(树状数组套主席树)
题目大意 给定一个有N个数字的序列,然后又m个指令,指令种类只有两种,形式如下: Q l r k 要求你查询区间[l,r]第k小的数是哪个 C i t 要求你把第i个数修改为t 题解 动态的区间第k ...
- glance image cache
The Glance Image Cache The Glance API server may be configured to have an optional local image cache ...
- MySQL 数据库中用户表中口令登陆设置
工具:MyEclipse8.5.apache-tomcat-6.0.43.MySQL5.6 问题:项目是同事发给我,正常运行之后,使用MySQL表里的管理员数据登陆时,提示“仅限于非总部工号登录!” ...
- iframe与include的区别
iframe与include区别和使用问题 1.iframe可以用在静态和动态页面,include只能用在动态页面. 2.iframe是视图级组合,include是代码级组合. 3.iframe独立成 ...
- PowerDesigner实用方法小结(1)
PowerDesigner使用方法小结 PowerDesigner多用来进行数据库模型设计,具有SQL语句自动生成等功能.当然,也有不少缺点,比如团队分享. 一.设置PowerDesigner模型视图 ...
- C# FileStream复制大文件
即每次复制文件的一小段,以节省总内存开销.当然,本机复制也可以采用.NET内部的System.IO.File.Copy方法. 本文转载:http://www.cnblogs.com/wolf-sun/ ...
- 如何更改 RSA 的语言设置
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- Win8启用便签
启动或显示 Sticky Notes : Win+R--->StikyNot.exe 备份Sticky Notes保存位置 : %AppData%\Microsoft\Sticky Notes\ ...
- 【转】C++中多重继承的二义性及解决办法
转自:http://www.cnblogs.com/lintong/archive/2012/07/28/2613002.html 1. 什么是多重继承的二义性 class A{ public: vo ...
- 【转】C++中了类继承和调用父类的构造函数方法
构造方法用来初始化类的对象,与父类的其它成员不同,它不能被子类继承(子类可以继承父类所有的成员变量和成员方法,但不继承父类的构造方法).因此,在创建子类对象时,为了初始化从父类继承来的数据成员,系统需 ...