Deploy chm file with click-once
I'd like to include a chm file with the application that I am deploying, but no matter what subdirectory of the project I put it in I can't seem to get the file to be included in the deployment. The help file does work correctly from my application on the development machine where I have it located in the project bin directory.
Right now, my deployment is just to a directory from which I burn a CD.
Thanks,
jerryK
[456 byte] By [
Jerryk] at [2007-12-24]
Have you changed the BuildAction property of the file to "Content"? I think that's about all I did to get it to work.
Hi David,
It looks like *.CHM files don't have the 'BuildAction' property. If you have any other suggestions, I'd appreciate it.
Thanks,
jerryK
How did you add the .chm file to your project? I added it as an Existing item to my project, and it has the Build Action property.
Hi David,
I didn't add it properly, but now I've added it as an 'Existing Item' and set the 'buildAction' to 'content' and the chm file is deployed properly.
Thanks for your help.
jerryk
I want to do similar thing.
If i set it as "Content" for Build action. What should i set for the Copy to the output directory?
Besides, how can i reference the help file?
e.g. ? Help.ShowHelp(Me, "Help.chm")
Yu,
Copy to output is set to: Do not copy.
I have a menu item for Help. In the click event for that menu item is:
SendKeys.send("{F1}")
In order for this to work you need to have the HelpProvider from the toolbox on the form and in its properties, the HelpNamespace has to be set to the path of the help file. For example: .\help.chm
Hope that helps.
/jerry
Hi Jerry,
Sorry to bother you. I tried lots of times based on your method but still can't make it works.
Would u mind send me a very simple sample on this?
Thx in advance
Yu,
On your form -- drag a HelpProvider from the toolbox.
Select the HelpProvider and change the HelpNameSpace in the Properties to the filepath of your help file. For example I placed my help file in the bin directory where the executable of the application is: .\help.chm
On your form -- drag a menuStrip from the toolbox.
Type a Help item to the menu and change its name to mnuHelp.
In design view, create a click event for mnuHelp and then add the following code so that it looks like the following sub for the click event:
Private Sub MnuHelp_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MnuHelp.Click
SendKeys.Send("{F1}")
End Sub
That seem to be what's needed. Of course you need to have a legitimate help file (.chm)
/jerry
the problem is that if i use clickonce to deploy the program. There is no application folder installed and so the chm file will not put into the client's computer. so, I don't know how to reference the chm file. And so i guess it's what it make me don't work. (the help file pop up after I click the help menu -- i guess it can't find the help file)
If you just include the .chm file as a Content file, and leave it in the project directory, and then set the copy property to be "Copy if Newer", then the path to the .chm file will be the same as the .exe, and you can use the Reflection, or My.Application (in VB) to figure out the current path.
David Guyer MS wrote: |
| If you just include the .chm file as a Content file, and leave it in the project directory, and then set the copy property to be "Copy if Newer", then the path to the .chm file will be the same as the .exe, and you can use the Reflection, or My.Application (in VB) to figure out the current path. |
|
From what i know, there should be no directory created for the app deploy with click once. However, if we click the file as data file in the publish option. then it should deploy in the datadirectory and should be able to reference it as Application.LocalUserAppDataPath
If you call it data, then you'll need to use My.Application.Deployment.DataDirectory, or System.Deployment.Application.ApplicationDeployment.CurrentDeployment.DataDirectory
But, Data files really wasn't meant for .chm files. In my app, I've just got it as content. Then, I start it up with System.Process.Start("MyFile.chm") and it works just great.
I have created my chm file and added it to the project. I have it set up as do not copy to output. When I go to the Publish Options and Application Files the chm file does not show up. I select show all files and its still not there. Anyone else have this?
You need to make sure the BuildAction of the .CHM file is set to "Content". Then it should show up and be available.