How can i make my Help file(CHM) to be installed in the Folder where the user install my application
I create a CHM file where user can have that when he click on F1. But what i need is how can i make that to be installed in the folder where the user install my application in such a way that when he click F1 i have to read that from the folder he installed and show it. And also how can i call in my application with out calling some thing as c:\sample.chm or some thing i need to call it from the directory where it was
Dorababu MekaPosted May 24, 2011, 4:02 AM
private void Form1_HelpRequested(object sender, HelpEventArgs hlpevent)
{
string dirpath = string.Empty;
string filename = "YourFIleName.chm";
dirpath = System.Environment.CurrentDirectory; //Get the installed direcotry
string[] files = new string[100];
do
{
if (dirpath == string.Empty || dirpath == Directory.GetDirectoryRoot(dirpath))
{
MessageBox.Show("no helpfile found");
break;
}
else
{
files = Directory.GetDirectories(dirpath, "ACH"); // If you placed the file in separate folder you can use this
if (files.Length > 0)
{
//MessageBox.Show(files[0]);
string strHlp = string.Empty;
strHlp = files[0] + "\\ACHWINAPP.chm";
Help.ShowHelp(this, strHlp);
break;
}
else
{
dirpath = Directory.GetParent(dirpath).ToString();
}
}
} while (true);
}
Posted May 24, 2011, 2:35 AM
http://msdn.microsoft.com/en-us/library/system.windows.forms.help.aspx
While creating the set-up project ,, you can add the chm file into Application folder, so that the chm file will
be installed into the application folder.