winforms中的安装文件问题 [英] setup file problem in winforms

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

问题描述

我创建了一个示例应用程序Winform应用程序。它包含3个项目和一个主要项目。在那个主要项目中,我添加了所有3个项目dll'。现在我创建了安装文件。它工作正常。在我在e文件夹上创建的第二个项目中,我保留了一些文件。当只有我运行它的应用程序采用该路径的正确路径时。当我创建'是一个安装文件时,文件夹路径无法访问。



在我的应用程序编码方面我习惯获取文件夹的路径是application.startup + Folderpath属性。当我创建安装文件时,它只显示dll但不显示确切文件。

如何获取路径?

i crated one sample application Winform application. it contains 3 projects and one main project. in that main project i added all 3 projects dll''s. now i created setup file. it''s working fine. in my second project i created on e folder and i kept some file in it. when only my application running it takes correct path for that path. when i create''s a setup file ,the folder path not accessing.

in my application coding wise i used to get path for folder is application.startup + Folderpath property. when i created setup file it shows only dll but not exact file.
how to get the path ?

推荐答案

在您的应用代码中可以使用相对路径(例如\custom文件夹)引用此文件,并确保在构建应用程序时此文件在输出文件夹中可用。



您需要将您的文件与二进制文件一起包含在您的安装文件中。在设置代码中,您需要包含此文件的目标位置(例如installdir \ custom folder)。在安装过程中,Windows安装程序将确保将此文件复制到所需位置。



安装完成后,由于自定义文件夹可用,您的代码不会抛出任何错误。



希望我很清楚。
In your app code you can refer this file using the relative path such as \custom folder) and ensure that this file is available in the output folder whenever you build your app.

You need to include your file in your setup file along with binaries. In the setup code you need to include the target location of this file (such as installdir\ custom folder). During the installation windows installer will ensure that this file is copied to the required location.

Now after the installation as the custom folder is available your code will not throw any error.

Hope I am clear.


这篇关于winforms中的安装文件问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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