0

I have a wpf/c# application where I have a .chm file that I would like to display. I have put this .chm file in the bin/debug and bin/release directory of my project. I call this file with the following code.

System.Windows.Forms.Help.ShowHelp(null, "ConversionData.chm");  

When I run my application from visual studio everything works as desired. However, when I create a msi with InstallShield or just create a clickOnce application it does not work. I know that I am missing something but not sure what. Any advice would be appreciated.

4
  • I just use Process.Start to open my help file. Also, when creating your installer, make sure you're also including the help file. If it's not in the installer, when attempting to run it, the application cannot find it.
    – Pazuzu156
    Sep 13, 2015 at 21:20
  • What do you mean by it doesn't work. Please show us the Exception message and stack trace. Sep 13, 2015 at 21:46
  • I click on the button that opens the file and nothing happens in the executable that is installed on the machine. There is no exception or stack trace. That is why I think I am not including the file in the correct place. Just not sure where that is right now.
    – mrsargent
    Sep 13, 2015 at 22:05
  • Does the .chm file exist? Have you tried calling ShowHelp with the full path to the file, possibly including the file:// prefix (like the MSDN example suggests)?
    – vesan
    Sep 14, 2015 at 0:36

2 Answers 2

1
        string fbPath = Application.StartupPath;
        string fname = "help.chm";
        string filename = fbPath + @"\" + fname;
        FileInfo fi = new FileInfo(filename);
        if (fi.Exists)
        {
            Help.ShowHelp(this, filename, HelpNavigator.Find, "");
        }

Be sure you have the file at the location where the application is located

While creating setup file be sure u have included the help file

enter image description here

2
  • where is the screen pic taken from? What were you using to the setup file?
    – mrsargent
    Sep 14, 2015 at 13:45
  • This screenshot is taken from application folder of the setup and deployment project. I am using setup and deployment project in vs 2013
    – Bunzitop
    Sep 14, 2015 at 13:51
1

Add the chm file to your application in Visual Studio. Set the content type to "copy always". This will ensure it copies it to the \bin\ folder, and gets included in your deployment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.