Reputation: 1189
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?
Upvotes: 0
Views: 90
Reputation: 35410
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.
Upvotes: 3