zoukankan      html  css  js  c++  java
  • 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).

    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

  • 相关阅读:
    Silverlight 4版本升级到4.0.60531.0
    Silverlight实例教程 理解Navigation导航框架Page类
    微软官方在线培训课程汇总2011版
    分享Silverlight/WPF/Windows Phone一周学习导读(07月11日07月17日)
    Linux内核简介
    Brief Summary of IaaS, PaaS, SaaS
    On Amazon EC2's Underlying Architecture
    Linux进程管理(2)
    一个诡异的时间问题追查[转]
    查看一个进程打开了哪些文件的命令
  • 原文地址:https://www.cnblogs.com/cindy-hu-23/p/3596194.html
Copyright © 2011-2022 走看看