ClickOnce issue - a file cannot be found

A

avanti

Hi,

I use ClickOnce to publish and install an application in the company. I
have a help file for the same in .chm format. It is part of the C#
project as a 'content' file. I also tried as 'embedded resource'. It
opens when the help link is clicked. The code looks like:

string exeFileName = Application.ExecutablePath;
string exeFileNameStub =
exeFileName.ToUpper().Replace(@"\Path", @"\");
exeFileNameStub =
exeFileNameStub.Remove(exeFileNameStub.LastIndexOf('\\'));
exeFileNameStub =
exeFileNameStub.Remove(exeFileNameStub.LastIndexOf('\\'));
exeFileNameStub =
exeFileNameStub.Remove(exeFileNameStub.LastIndexOf('\\')+1);
string helpFileNameAsPublished = exeFileNameStub +
@"Help-TCM.chm.txt";
string helpFileName = exeFileNameStub + @"Help-TCM.chm";
FileInfo helpFileAsPublished = new
FileInfo(helpFileNameAsPublished);
FileInfo helpFile = new System.IO.FileInfo(helpFileName);
if (!helpFile.Exists)
{
if (!helpFileAsPublished.Exists)
{
MessageBox.Show("Help request cannot be actioned
because help file is missing - contact support!", "Help file is
missing");
return;
}
helpFileAsPublished.MoveTo(helpFileName);
Help.ShowHelp(c, helpFileName);
}
Help.ShowHelp(c, helpFileName);

It works fine locally. However when someone installs it from the
publishing link, I get the error "Help request cannot be actioned
because help file is missing - contact support!"

How can I make sure the .chm file is availabel when someone installs my
app?

Thanks,
Avanti
 
A

avanti

Thats true. I saw this post at various places. I have already tried the
solutions given there. They did not work. I tried doing it through the
txt file. I also made it an existing file - content type - didn't work.

Do you know another solution?

Thanks,
Avanti
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top