简体   繁体   中英

Create setup package in Visual studio 2010

First time I am creating a setup file in visual studio 2010.

I have 2 files in the project file 1 and file 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 . Then in the setup project, make sure you have include Contents of the Primary Project Output in the File System tab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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