PC Review


Reply
Thread Tools Rate Thread

ClickOnce issue - a file cannot be found

 
 
avanti
Guest
Posts: n/a
 
      5th Jan 2007
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

 
Reply With Quote
 
 
 
 
avanti
Guest
Posts: n/a
 
      11th Jan 2007
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


Alvin Bruney [MVP] wrote:
> another one...
>
> --
> Regards,
> Alvin Bruney
> ------------------------------------------------------
> Shameless author plug
> Excel Services for .NET is coming...
> OWC Black book on Amazon and
> www.lulu.com/owc
>
> "avanti" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ClickOnce - file cannot be found avanti Microsoft Dot NET Framework 0 5th Jan 2007 09:27 PM
ClickOnce issue with exe.config file Tony Microsoft Dot NET Framework Forms 0 16th May 2006 06:28 PM
ClickOnce issue with exe.config file Tony Microsoft Dot NET Framework 0 16th May 2006 06:28 PM
File sorting issue, XP loss of function that was found in Win98 Shawna Windows XP Customization 74 8th Mar 2004 06:57 AM
File sorting issue, XP loss of function that was found in Win98 Shawna Windows XP Basics 78 8th Mar 2004 06:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:19 PM.