I have created the following code to open a .pdf file from the root directory of my installed program.
private void HelpButton_Click(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "Help Me.pdf";
proc.Start();
}
The problem is that the program, once installed and started from the desktop icon, will not open the .pdf file. However, when started from the actual file that the desktop shortcut is pointing to, the button opens the file just fine. I have also tried the following with the same effect.
private void HelpButton_Click(object sender, RoutedEventArgs e)
{
ProcessStartInfo helpInfo = new ProcessStartInfo("Help Me.pdf");
helpInfo.WorkingDirectory = Assembly.GetExecutingAssembly().ToString();
Process.Start(helpInfo);
}
private void HelpButton_Click(object sender, RoutedEventArgs e)
{
ProcessStartInfo helpInfo = new ProcessStartInfo("Help Me.pdf");
Process.Start(helpInfo);
}
private void HelpButton_Click(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process.Start("Help Me.pdf");
}
Any help would be greatly appreciated