在安装期间运行可执行文件并在安装后将其删除 [英] Run an executable during install and delete it after

查看:32
本文介绍了在安装期间运行可执行文件并在安装后将其删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 WIX 项目,希望在复制所有文件后执行 .exe.但我不希望这个 .exe 被安装".我怎样才能做到这一点?原因是,我的安装程序将文件放置在 IIS 的虚拟文件夹中,并且在安装后让 .exe 存在不是一种选择.

I have a WIX project and would like to execute a .exe when all the files are copied. But I don't want this .exe to be "installed". How can I do that? The reason is, that my installer drops file in a virtual folder in IIS and letting the .exe there after the install is not an option.

推荐答案

我选择将文件放在无法通过 IIS 访问的文件夹中,以便在安装过程中需要运行 .exe 的每个安装程序都指向该文件夹.例如:

I opted to have the file sitting in a folder inaccessible via IIS, so that every installer that needs to run the .exe during the installation process points there. Ex:

<Property Id="EXEAPPLOCATION">
      <DirectorySearch Id="mpfAppFolder" Depth="1" Path="C:\Program Files\mypath\Tools\">
        <FileSearch Id="my.exe" Name="my.exe"  />
      </DirectorySearch>
    </Property>


    <CustomAction Id="RunExecutable" 
                  Property="EXEAPPLOCATION" 
                  ExeCommand='-source="c:\test.txt"'
                  Execute="deferred" 
                  Return="check" 
                  Impersonate="no"/>

这篇关于在安装期间运行可执行文件并在安装后将其删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆