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

  1. 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)
  2. Launch the Custom Action Wizard. For more information, see the "Additional Information" section of this article.
  3. On the "Basic Information" dialog, enter a name (i.e., test) for the custom action in the Name field.
  4. Click the Next button.
  5. On the "Action Type" dialog, set the "Type" to "Launch an executable" and the "Location" to "Stored in the Directory Table".
  6. Click the Next button.
  7. 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.

  1. Click the Next button.
  2. On the "Additional Options" dialog, keep the default values selected.
  3. Click the Next button.
  4. On the "Respond Options" dialog, keep the default values selected.
  5. 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的更多相关文章

  1. 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 ...

  2. 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. ...

  3. 解决ArcGIS安装之后出现的Windows installer configures问题

    ----Please wait while Windows installer configures ArcGIS Desktop Error Message错误信息 When launching A ...

  4. 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 ...

  5. 【转】转移Package Cache文件夹,转移Windows Installer文件夹

    详见http://blogs.msdn.com/b/heaths/archive/2014/02/11/how-to-relocate-the-package-cache.aspx (注意:若Wind ...

  6. Wix学习整理(3)——关于Windows Installer和MSI

    原文:Wix学习整理(3)--关于Windows Installer和MSI 关于Windows Installer Windows Installer是微软Windows操作系统自带的一个软件安装和 ...

  7. 安装Windows Installer服务

    Windows Installer 5.0.810.500 下载地址: 电信:http://mdl1.mydown.yesky.com/soft/201303/WindowsInstaller.rar ...

  8. .net平台 通过Windows installer 打包和部署实例操作

    Windows installer 打包和部署 1.新建项目. 打开VS,新建项目->其他项目类型->安装和部署(Visual Studio Installer). 注:若VS2013 或 ...

  9. Windows Installer 服务启动错误 14007 的解决办法

    问题: 在 本地计算机 无法启动 Windows Installer 服务. 错误代码 14007: 在活动的激活上下文中没有找到任何查找密钥. 这个问题似乎涉及到 Windows Installer ...

随机推荐

  1. java 小结2 多态问题和容器介绍

    面向对象这个东西,其实我们一直是不是都没有感觉到自己在用,以后我一定要用用.以前学c#时候认真的看过一次,最近一直研究java.随便再看看. 多态问题: 在java中多态分为(1)编译时多态和(2)运 ...

  2. HDU-1814 Peaceful Commission 2sat

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1814 简单的2sat题. //STATUS:C++_AC_390MS_996KB #include & ...

  3. 详细讲解Hadoop源码阅读工程(以hadoop-2.6.0-src.tar.gz和hadoop-2.6.0-cdh5.4.5-src.tar.gz为代表)

    首先,说的是,本人到现在为止,已经玩过.                   对于,这样的软件,博友,可以去看我博客的相关博文.在此,不一一赘述! Eclipse *版本 Eclipse *下载 Jd ...

  4. 东芝超级本从win8到win7

    东芝超级本从win8到win7 2014年2月20日 11:08:46   1. 进入BIOS     调出关机选项,按住shift不松手,然后点选关机,彻底关机后,按住f2不松手,按下电源开机,就进 ...

  5. C++或者C#中如何拿到一个窗口的标题

    博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:C++或者C#中如何拿到一个窗口的标题.

  6. 如何用C#检查硬盘是否是固态硬盘SSD

    博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:如何用C#检查硬盘是否是固态硬盘SSD.

  7. UVa 497 - Strategic Defense Initiative

    题目:最大上升子序列.输出一组解. 分析:dp,LIS.数据较小 O(n^2)算法就可以. 设以第i个数字作为最大上升子序列中的最后一个数的长度为 f(i),则有转移方程: f(i)= max(f(j ...

  8. Apache Mina 2.x 框架+源码分析

    源码下载 http://www.apache.org/dyn/closer.cgi/mina/mina/2.0.9/apache-mina-2.0.9-src.tar.gz 整体架构 核心过程(IoA ...

  9. MySQL协议分析

    MySQL协议分析 标签: mysql 2015-02-27 10:22 1807人阅读 评论(1) 收藏 举报  分类: 数据库(19)    目录(?)[+]   1 交互过程 MySQL客户端与 ...

  10. 解决 子进程已安装的 post-removal脚本返回了错误号 100 的方法

    打开终端: $gksudo nautilus 进入目录: /var/lib/dpkg 删除: info info.bak (文件夹) 重建文件夹: info 之后重新安装 或删除就可以了.