WIX:使用临时文件在安装过程中 [英] WIX: Using a temporary file during install

查看:263
本文介绍了WIX:使用临时文件在安装过程中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个WIX安装程序,我有以下要求:结果
在安装过程中,我需要绝对路径传递到一个文件中(可以称之为A)包括在我的安装到一个COM组件,它已经存在于硬盘上的另一个程序的一部分。我已经写了一个合适的自定义操作而预计到文件答:我不想包含A作为安装在Program Files文件夹,并在卸载过程中删除的文件的路径。相反,我想放一个只是暂时在硬盘上,叫我的自定义操作,这将导致COM组件使用的内容,然后从硬盘中删除。有没有一种简单的方法来实现这一目标?

I am writing a WIX installer and I have a following requirement:
During installation, I need to pass an absolute path to a file (lets call it A) included in my installer to a COM component, which already exists on the hard drive and is a part of another program. I have already written an appropriate Custom Action which expects a path to the file A. I don't want to include A as a file installed in the Program Files folder and removed during the uninstallation process. Instead, I would like to put A only temporary on the hard drive, call my Custom Action which will cause the COM component to use the content of A, and then remove A from disk. Is there an easy way to accomplish this goal?

我试图利用二进制表和存储在那里,但我不知道如何参考使用绝对路径。我知道我可以把MSI文件的外面,但我想保留的所有文件需要安装在一个MSI。

I have tried to utilize the Binary Table and store A there, however I don't know how to reference A using absolute path. I know I could put A outside of MSI file but I would like to keep every file installer needs in a single MSI.

任何帮助将是AP preciated。

Any help would be appreciated.

推荐答案

我会采取这种方法。

文件A安装到任何目录。运行更新COM组件所需的自定义操作。然后再次运行自定义操作或修改当前写了一个删除该文件后,就不再使用。这将留下任何文件A的痕迹,如果您计划自定义操作在安装过程中,你将不必担心它卸载只运行。

Install the file "A" into any directory. Run your custom action needed to update the COM component. Then run another custom action or modify the currently written one to remove the file after it is no longer in use. This would leave no trace of the file "A" and if you schedule the custom action to only run during the install you won't have to worry about it on uninstall.

这篇关于WIX:使用临时文件在安装过程中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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