none
ClickOnce Publishing - How do I include (and then access) a .chm help file? RRS feed

  • Question

  • I'm trying to publish an application which has a .chm help file, using ClickOnce.  I've added the .chm file to the project (using "Add as Link") and the application tries to access the help file by saying:
    Help.ShowHelp(Me, Application.StartupPath & "\Myhelpfile.chm")

    But when I publish the application and run setup.exe, the app runs, but cannot find the help file.  I've tried searching for the file on my C drive, but can only find the copy that was created within the project.

    Have I succeeded in deploying the help file, and if so, how do I access it from within the application?  (Sorry if this is obvious - but I've spent a long time looking for an answer to this, and can't find one anywhere...)


    If it can't be done in Fortran 77 it's not worth doing, IMO

    Sunday, February 26, 2017 2:51 PM

Answers

  • Yes, I've done all that - still nothing!

    If it can't be done in Fortran 77 it's not worth doing, IMO


    Yes its frustrating. I got it to work but did try some things so...

    Make a new project as my example. Add the .chm file just like a form but choose add existing...  Then set the things in the image (see previous post for image). Click publish.

    (Edit add image:)

    The example should run and show the folder at least. Mine starts the chm file.

    (Here is what the) bin files look like.

    Make sure you are getting the right setup.exe after you build, not an old one, check time stamps. (Here is the default output setup.exe location.)

    Uninstall early versions from control panel.

    You maybe can delete the whole folder in the app data folder click once make for your app to start over. See I have 4 versions there now only the latest install is there.




    • Marked as answer by Aylmer51 Sunday, February 26, 2017 10:13 PM
    • Edited by tommytwotrain Sunday, February 26, 2017 11:28 PM
    Sunday, February 26, 2017 10:02 PM
  • "Then in the users desktop folder you make shortcuts to icons etc by right mouse button click menu etc."

    That's the bit I don't get!  If I right-click on "User's Desktop" I get things like "Create shortcut to user's desktop" - and if I choose that, a shortcut to the desktop (but not to the app) does indeed appear on the desktop when the msi installs.  Or do I add a file?  And if so, how do I create the shortcut in advance, given that I don't know where the user will choose to install the app?

    There is no problem with including the help file - it's just the shortcut that has defeated me...

    If it can't be done in Fortran 77 it's not worth doing, IMO

    After selecting the desktop folder in the left treeview window, click the rmb in the right window, select make shortcut, you will get a dialog. Double click application folder, select primary output to make a desktop shortcut to your app .exe.

    https://msdn.microsoft.com/en-us/library/seykw6dt(v=vs.100).aspx

    https://msdn.microsoft.com/en-us/library/2kt85ked(v=vs.100).aspx



    • Edited by tommytwotrain Tuesday, February 28, 2017 2:56 AM
    • Marked as answer by Aylmer51 Tuesday, February 28, 2017 9:23 AM
    Tuesday, February 28, 2017 2:55 AM

All replies

  • Have I succeeded in deploying the help file, and if so, how do I access it from within the application?

    How have you configured the help file within the clickonce deployment?  If it is configured as data, then it will be in the data directory.  If it's not there then you may need to look at things like file and folder permissions.

    Sunday, February 26, 2017 8:24 PM
  • https://msdn.microsoft.com/en-us/library/kzy0fky2.aspx?f=255&MSPPError=-2147217396

    To add files to the Application Files Dialog Box

    1. Select a data file in Solution Explorer.

    2. In the Properties window, change the Build Action property to the Content value.



    ' - how/where is help file installed?
    Option Strict On
    
    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Label1.Text = Application.StartupPath & "\cr10help1a.chm"
    
            Help.ShowHelp(Me, Label1.Text, HelpNavigator.Topic)
        End Sub
    End Class
    

    Sunday, February 26, 2017 9:40 PM
  • Yes, I've done all that - still nothing!

    If it can't be done in Fortran 77 it's not worth doing, IMO

    Sunday, February 26, 2017 9:45 PM
  • Yes, I've done all that - still nothing!

    If it can't be done in Fortran 77 it's not worth doing, IMO


    Yes its frustrating. I got it to work but did try some things so...

    Make a new project as my example. Add the .chm file just like a form but choose add existing...  Then set the things in the image (see previous post for image). Click publish.

    (Edit add image:)

    The example should run and show the folder at least. Mine starts the chm file.

    (Here is what the) bin files look like.

    Make sure you are getting the right setup.exe after you build, not an old one, check time stamps. (Here is the default output setup.exe location.)

    Uninstall early versions from control panel.

    You maybe can delete the whole folder in the app data folder click once make for your app to start over. See I have 4 versions there now only the latest install is there.




    • Marked as answer by Aylmer51 Sunday, February 26, 2017 10:13 PM
    • Edited by tommytwotrain Sunday, February 26, 2017 11:28 PM
    Sunday, February 26, 2017 10:02 PM
  • Yikes!  Thanks, I'll keep hacking away...

    If it can't be done in Fortran 77 it's not worth doing, IMO

    Sunday, February 26, 2017 10:05 PM
  • Got it, at last - I removed the file from the project then added it again using 'add' rather than 'add as link'.  And now it works,

    Phew!  Thanks for your help, as always


    If it can't be done in Fortran 77 it's not worth doing, IMO

    Sunday, February 26, 2017 10:13 PM
  • Got it, at last - I removed the file from the project then added it again using 'add' rather than 'add as link'.  And now it works,

    Phew!  Thanks for your help, as always


    If it can't be done in Fortran 77 it's not worth doing, IMO

    That's good to hear.

    So I don't know what your app is but you may or may not like the folder you are in and may want a desktop icon and all that. Not sure how or if Click once does that. However the MSI project installer does and I don't think is any harder to learn. It is older I guess but well used.  You can add much more things to it. And its free! Or Installshield etc for $$.

    PS You might get more info in the Project Setup and Deployment forum.

    Sunday, February 26, 2017 10:31 PM
  • Turns out you *can* make a desktop icon, by dragging it off the Start menu - but you'r right, the app gets stored in a ridiculous place, and not in C:\Program Files (x86) where it belongs.  So I probably will switch to MSI at some point, but at least things are working for now.  Many thanks for all your help over the past 2 weeks, and I hope not to bother you again!

    If it can't be done in Fortran 77 it's not worth doing, IMO

    Monday, February 27, 2017 8:16 AM
  • Ok - I've installed the MSI installer, and have managed to create a working .msi file without too much difficulty, using 'Setup Project'.  Thank you for that suggestion - my app now installs into a sensible place.

    My only question is - how do I put a shortcut to the app onto the user's desktop, when they install the package?

    If it can't be done in Fortran 77 it's not worth doing, IMO

    Tuesday, February 28, 2017 1:03 AM
  • Ok - I've installed the MSI installer, and have managed to create a working .msi file without too much difficulty, using 'Setup Project'.  Thank you for that suggestion - my app now installs into a sensible place.

    My only question is - how do I put a shortcut to the app onto the user's desktop, when they install the package?

    If it can't be done in Fortran 77 it's not worth doing, IMO

    In the solution explorer, right mouse button click on the setup project name. Select View - File System from the menu. File System page will be shown in the editor window for the installation. Shows what goes in the app folder etc. You would put your help file there in the app folder say, and the app of course (labeled primary output). Then in the users desktop folder you make shortcuts to icons etc by right mouse button click menu etc.

    So you should look at every Folder and each of the other items back on the View menu like User Interface etc. Add your own titles and bitmaps.

    You have to be careful of the global naming like the name,  {primary output} is the .exe etc. The variable name may be used on several screens etc. Best to leave the defaults as is more or less. Just enter your name etc.


    Tuesday, February 28, 2017 2:10 AM
  • "Then in the users desktop folder you make shortcuts to icons etc by right mouse button click menu etc."

    That's the bit I don't get!  If I right-click on "User's Desktop" I get things like "Create shortcut to user's desktop" - and if I choose that, a shortcut to the desktop (but not to the app) does indeed appear on the desktop when the msi installs.  Or do I add a file?  And if so, how do I create the shortcut in advance, given that I don't know where the user will choose to install the app?

    There is no problem with including the help file - it's just the shortcut that has defeated me...

    If it can't be done in Fortran 77 it's not worth doing, IMO

    Tuesday, February 28, 2017 2:25 AM
  • "Then in the users desktop folder you make shortcuts to icons etc by right mouse button click menu etc."

    That's the bit I don't get!  If I right-click on "User's Desktop" I get things like "Create shortcut to user's desktop" - and if I choose that, a shortcut to the desktop (but not to the app) does indeed appear on the desktop when the msi installs.  Or do I add a file?  And if so, how do I create the shortcut in advance, given that I don't know where the user will choose to install the app?

    There is no problem with including the help file - it's just the shortcut that has defeated me...

    If it can't be done in Fortran 77 it's not worth doing, IMO

    After selecting the desktop folder in the left treeview window, click the rmb in the right window, select make shortcut, you will get a dialog. Double click application folder, select primary output to make a desktop shortcut to your app .exe.

    https://msdn.microsoft.com/en-us/library/seykw6dt(v=vs.100).aspx

    https://msdn.microsoft.com/en-us/library/2kt85ked(v=vs.100).aspx



    • Edited by tommytwotrain Tuesday, February 28, 2017 2:56 AM
    • Marked as answer by Aylmer51 Tuesday, February 28, 2017 9:23 AM
    Tuesday, February 28, 2017 2:55 AM
  • Sorry, had to stop for sleep (I'm in the UK)

    Ah... these things are so simple once you know how, aren't they?  The shortcut now appears on the desktop just fine.  The only difference between it and a shortcut that you make yourself by right-clicking on the exe is that the latter allows the passing of a filename via 'drag and drop' while the one from the MSI installer does not.  But that's a detail I'll live with, unless you happen to know the answer....?  (I think you might need to put something in 'Arguments' in the shortcut's properties, but I don't know what).

    Anyway, huge thanks for all your help - you have spent hours of your time helping me!

    If it can't be done in Fortran 77 it's not worth doing, IMO

    Tuesday, February 28, 2017 9:23 AM
  • Sorry, had to stop for sleep (I'm in the UK)

    Ah... these things are so simple once you know how, aren't they?  The shortcut now appears on the desktop just fine.  The only difference between it and a shortcut that you make yourself by right-clicking on the exe is that the latter allows the passing of a filename via 'drag and drop' while the one from the MSI installer does not.  But that's a detail I'll live with, unless you happen to know the answer....?  (I think you might need to put something in 'Arguments' in the shortcut's properties, but I don't know what).

    Anyway, huge thanks for all your help - you have spent hours of your time helping me!

    If it can't be done in Fortran 77 it's not worth doing, IMO

    That is one I don't know already. I never noticed before.

    But that's why I gave you the link to the good docs.

    And technically one should be asking these questions in the Setup and Deploy forum I suppose although we answer them if we know here in the vb forum.

    https://social.msdn.microsoft.com/Forums/windows/en-US/home?forum=winformssetup

    :)

    Tuesday, February 28, 2017 12:09 PM
  • Thank you - as a measure of my ignorance, I didn't even know there *was* a Setup and Deploy forum!  But I'll work though the docs you quoted, and then use that forum if I still have problems.

    I'm so grateful that there are people like you who are willing to help people like me!

    If it can't be done in Fortran 77 it's not worth doing, IMO

    Tuesday, February 28, 2017 12:31 PM