如何复制一个文件,该文件在同一目录下安装 [英] How to copy a file that's in the same directory as the installer

查看:213
本文介绍了如何复制一个文件,该文件在同一目录下安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要复制一个文件,该文件在同一目录下安装程序文件到应用程序目录。我不能包括在安装程序中的文件。

I want to copy a file that's in the same directory as the installer file to the application directory. I can't include the file in the installer.

情景: 我创建一个安装程序为我的客户。 客户端将安装程序分配给数目不详的第三方, 这些第三方将需要改变应用程序的结构的一个方面。 他们将用自己编辑过的配置安装程序随后分发到一个未知的最终用户。 最终用户需要能够只需双击安装程序,对他们来说不知道可以假设。 我不能/不想创建每个第三方将分发应用程序的独立安装程序。

the scenario: I create an installer for my client. the client will distribute the installer to an unknown number of third parties, these third parties will need to change an aspect of the configuration for the application. they will subsequently distribute the installer with their edited config to an unknown number of end users. The end users need to be able to just double click the installer, no knowledge on their part can be assumed. I can't/don't want to create a separate installer for every third party that will distribute the application.

我已经出来是让这些第三方添加一个配置文件的解决方案,连同安装程序分发。该文件将被复制到安装的应用程序目录。我创建了一个自定义安装程序类用于此目的。

The solution I've come up with is letting these third parties add a config file to be distributed together with the installer. This file will be copied to the application dir on installation. I created a custom installer class for this purpose.

我在哪里卡住的部分是如何找到该文件。所有提供的方法来找到安装程序类中激活部件等似乎指向,而不是在那里安装程序从启动原来的目录里面窗口\ SYSTEM32目录。

The part where I am stuck is how to find the file. All the provided methods to find the active assembly etc inside the installer class seem to point to a directory inside Window\system32, instead of the original directory where the installer was launched from.

任何帮助非常AP preciated。

Any help greatly appreciated.

推荐答案

这是你所追求的是什么?您通过自定义数据的自定义操作,使用一个内置的,但很难找到可用的参数,当你设计安装项目在Visual Studio。

Is this what you are after? You pass custom data to the custom action, using one of the built-in, but hard to find parameters available when you design setup projects in Visual Studio.

http://adamhouldsworth.blogspot.com/2010/01/get-msi-location-during-setup.html

这篇关于如何复制一个文件,该文件在同一目录下安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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