简体   繁体   English

在Visual Studio 2010中创建安装程序包

[英]Create setup package in Visual studio 2010

First time I am creating a setup file in visual studio 2010. 我第一次在Visual Studio 2010中创建安装文件。

I have 2 files in the project file 1 and file 2. 我在项目文件1和文件2中有2个文件。 解决方案经验

When I click on the button I get the file. 当我单击按钮时,我得到文件。

private void button1_Click(object sender, EventArgs e)
{
     string filename = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"FilesOutput\Help\file 1.pdf");
     ProcessStartInfo psi = new ProcessStartInfo(filename, "");
     try
     {
        Process.Start(psi);
     }
     catch (Exception ex)
     { 
     }    
 }

I created the Setup of the project and install it, I see the button, but when I click on the button I cannot see the file. 我创建了项目的安装程序并安装它,我看到了按钮,但是当我单击按钮时,我看不到文件。 Can some one can help how to get the file? 有人可以帮忙获取文件吗?

Mark your files as Content using Solution Explorer and Properties window. 使用解决方案资源管理器和“属性”窗口将文件标记为内容。 Just click on the file in Solution Explorer, go to properties and set Copy to Output to Copy if newer and Build Action to Content . 只需在解决方案资源管理器中单击文件,转到属性,然后将“ Copy to Output设置为Copy if newer然后将“ Build Action为“ Content Then in the setup project, make sure you have include Contents of the Primary Project Output in the File System tab. 然后,在设置项目中,确保已在“文件系统”选项卡中包含“主项目输出”的内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM