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 ...
随机推荐
- 问题-[致命错误] Project1.dpr(1): Unit not found: 'System.pas' or binary equivalents (DCU,DPU)
问题现象:[致命错误] Project1.dpr(1): Unit not found: 'System.pas' or binary equivalents (DCU,DPU) 问题原因:由于删除D ...
- mysql 不支持innodb的问题解决
在新的机器上安装了mysql后,发现里面新创建的数据表的存储引擎都是myisam,于是 执行下面语句,把mysiam改为innodb. alter table tbl_test engine=inno ...
- sdk 命令行
1.关闭服务命令:adb kill-server 2. 启动服务命令:adb start-server 3.查询当前设备命令:adb devices 4.安装应用程序命令:adb install [a ...
- 在SCVMM2012R2中删除失去联系的VM GateWay
当VM Gateway失去联系,无法使用,直接删除GW,或者在VM Network中删除GW连接,均会出现如下错误提示: 错误(21426)对配置提供程序 4ee559f1-f479-480c-945 ...
- 【Android UI设计与开发】之具体解释ActionBar的使用
具体解释Android中的ActionBar的使用 请尊重他人的劳动成果,转载请注明出处:具体解释Android中的ActionBar的使用 http://blog.csdn.net/fengyuzh ...
- TransactionScope 对该事务的状态无效 和一些注意事项
使用TransactionScope 的时候要操作同一种数据库操作方式,不能一个方法用ado.net ,另外一个方法用EF,那样会报 "该事务管理器已经禁止了它对远程/网络事务的支持&quo ...
- 选择排序、插入排序、冒泡排序python实现
选择排序的时间复杂度为O(n^2),是不稳定的排序 冒泡排序的时间复杂度最好情况下为O(n),最坏情况下为O(n^2),平均情况下为O(n^2),是稳定的排序 插入排序的时间复杂度最好情况下为O(n) ...
- QT软键盘
如何实现鼠标单击弹出软键盘 默认情况下,如果当前编辑框无焦点,则需要鼠标点击两次才弹出软键盘,其中第一次是让该编辑框获得焦点,第二次点击才弹出软键盘: 如果当前编辑框已经获得焦点,则点击一次就会弹出软 ...
- 文件处理-Directory类 (C#)
转http://skybirdzw.blog.163.com/blog/static/7257062620099751329403/ 文件处理-Directory类 (C#) Directory.Cr ...
- VS2010常用插件介绍之Javascript插件(一)
引自:http://blog.csdn.net/cyxlzzs/article/details/6583577 今天在写JS时,写到500多行时,感觉代码已经很难看了.想到C#代码都有折叠功能,是不是 ...