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. 【转载】HBase 数据库检索性能优化策略

    转自:http://www.ibm.com/developerworks/cn/java/j-lo-HBase/index.html 高性能 HBase 数据库 本文首先介绍了 HBase 数据库基本 ...

  2. Linux的read命令

    对于写bash脚本的朋友,read命令是不可或缺的,需要实践一下就可以了解read命令的大致用途: 编写一个脚本: #!/bin/bash # hao32 test read echo -e &quo ...

  3. jenkins持续集成配置备忘

    配过好几次,但是老忘记.记录备忘. 安装下列插件: ssh和git插件用来下载源码 publish over ssh 插件用来发布代码到测试环境. email插件用来更强大的email配置. file ...

  4. java使用xheditor Ajax异步上传错误

    java使用xheditor Ajax异步上传时候错误如下:the request doesn't contain a multipart/form-data or multipart/mixed s ...

  5. psd via fft and pwelch

    %fft and pwelch方法求取功率谱load x.mat Fs = 1; t = (0:1/Fs:1-1/Fs).'; Nx = length(x); % Window data w = ha ...

  6. 树莓派通过 HDMI - VGA 转接后分辨率始终为640*480无法修改的问题

    一开始装的Raspbian,感觉系统不错,就是分辨率调不了,网上找了很多解决方法,捣鼓了差不多一天,仍然没有解决. 期间尝试换了好几个系统,比如说 raspbmc .XBian等,最后试了下Pidor ...

  7. 【Android - 进阶】之事件分发机制

    参考资料: View事件分发:http://blog.csdn.net/pi9nc/article/details/9281829 ViewGroup事件分发:http://blog.csdn.net ...

  8. Android动态加载技术初探

    一.前言: 现在,已经有实力强大的公司用这个技术开发应用了,比如淘宝,大众点评,百度地图等,之所以采用这个技术,实际上,就是方便更新功能,当然,前提是新旧功能的接口一致,不然会报Not Found等错 ...

  9. 为 vsftpd 启动 vsftpd:500 OOPS: bad bool value in config file for: pasv_enable

    每行的值都不要有空格,否则启动时会出现错误,举个例子,假如我在listen=YES后多了个空格,那我启动时就出现.. 为 vsftpd 启动 vsftpd:500 OOPS: bad bool val ...

  10. MFC TreeCtrl 控件(一):简单使用

    本文描写叙述了 MFC 中的树形控件 TreeCtrl 的简单使用,内容包含数据项的加入.图标设置.提示信息设置等. 新建基于对话框的应用程序,加入一个 TreeCtrl ,为其定义一个控件变量 m_ ...