代码之家  ›  专栏  ›  技术社区  ›  Sijith

如何使用wixquietexec64cmdline在后台静默运行命令

  •  0
  • Sijith  · 技术社区  · 5 年前

    嗨,我正在运行一个基本的bat文件,使用wix将一些字符串写入一个文件。我想在安装应用程序时在后台运行bat。

    我从网上尝试了很多可能性,但不能在后台运行。

    代码

        <!-- WixQuietExecCmdLine specify the cmd to be executed -->
    <Property Id="WixQuietExec64CmdLine" Value='"[WindowsFolder]System32\cmd.exe" /F /T /IM C:\SampleWix\myBat.BAT'/>
    
    <!-- From WiX v3.10, use WixQuietExec -->
    <CustomAction Id="MyAppTaskKill" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="immediate" Return="ignore"/>
    
    <!-- trigger the custom action -->
    <InstallExecuteSequence>
        <Custom Action='MyAppTaskKill' Before='InstallValidate'></Custom>  
    </InstallExecuteSequence>
    

    Wix Light命令

     %WIX_LIGHT% %INSTALLER_BUILD_DIR%\*.wixobj -o %OUTPUT_DIR%\%MSI_OUTPUT_FILE_NAME% -ext WixUIExtension -ext WixUtilExtension.dll
    

    这里我添加了-ext WixUtilExtension.dll来执行WixCA

    蝙蝠文件

    这根线的任何光线都会很有帮助

    下面的代码我也尝试了,但没有工作

    <Property Id="QtExec64CmdLine"  Value='"[WindowsFolder]System32\cmd.exe" /F /T /IM C:\SampleWix\myBat.BAT'/>
    <CustomAction Id="SilentLaunch" BinaryKey="WixCA" DllEntry="CAQuietExec64" Execute="immediate" Return="check" />
    
    <InstallExecuteSequence>
      <Custom Action="SilentLaunch" Before='InstallValidate' />
    </InstallExecuteSequence>
    
    0 回复  |  直到 5 年前
    推荐文章