none
How do I include an additional file in package RRS feed

  • Question

  • I am trying to package my C++ MFC app for submission using Visual Studio.

    My app implements F1-style help, and for this the exe has to access the chm file. (This actually used to have built-in support in the VS project wizard for MFC projects a few years back, and I've kept it going in my app.)

    How do I include the chm file in the package so that it gets installed in the same directory as the exe? I have it working fine with a standard MSI file (built with Wix) which installs my exe and the chm in the same folder in Program Files (x86), but I don't know how to do this using the VS packaging process.

    Any help would be much appreciated.

    kind regards,

    Bill



    Thursday, September 12, 2019 6:25 PM

Answers

  • Hi Bill,
    >The problem is that my application exe file needs another file (MyProject.chm) containing the compiled help text, and this needs to be installed beside the exe. 
    There is a method to add the chm file for a publishing project. Could you mind to follow the below steps to try?
    1.Right click your C++/MFC project and click "add existing item" in the VS
    2.Add the MyProject.chm file to your project
    3.Right the MyProject.chm file and click "Properties" and set the Build Action to "Content"
    4.Right click the project  and  switch to the publish tab , click "Application Files" button and include the MyProject.chm file
    5.Add your project to the Applications for the Windows Application Packaging Project and package the app. 

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by William Heitler Wednesday, September 25, 2019 7:56 PM
    Monday, September 16, 2019 2:58 AM
    Moderator

All replies

  • Visual Studio does not submit C++ MFC (desktop) applications. It can (with an extension) create a deployment project for you and you say you are using Wix. You say it works.

    What do you mean by VS packaging process? If everything works then don't try to break it. If it does not work then try to explain what is not working.



    Sam Hobbs
    SimpleSamples.Info

    Friday, September 13, 2019 1:53 AM
  • Thank you for taking the time to reply.

    By "VS packaging process" I mean using a Visual Studio Windows Appliction Packaging Project (https://docs.microsoft.com/en-gb/windows/msix/desktop/desktop-to-uwp-packaging-dot-net) to prepare a standard desktop app for submission to the Microsoft Store, which only accepts apps that conform to the UWP protocols.

    You are correct that this project type does not appear in the VS New Project type list if you filter by C++, but it does appear if you filter by C#. You can then include the packaging project in your solution and refer to the main C++/MFC project as the target that you wish to package. This has worked OK for me in terms of packaging the exe file. I was able to generate the file "MyProject.appxbundle" and sideload it successfully on my development computer. I have not yet sent it to the store for testing.

    The problem is that my application exe file needs another file (MyProject.chm) containing the compiled help text, and this needs to be installed beside the exe.  I am generating the chm file from within my main project, but  I have not been able to find anything in the VS documentation for the Packaging Project that tells me how to include this additional file, hence my question.

    Regarding Wix, this builds a standard MSI installer. It is well documented, and I had no problem incorporating both my exe and chm (and a bunch of sample files) into MyProject.msi. That works fine for a stand-alone installation, but it CANNOT be used for submission to the Microsoft Store, which only accepts apps that conform to the UWP protocols.

    Hope that clarifies my question and what I am trying to achieve.

    regards,

    Bill

    Friday, September 13, 2019 10:03 AM
  • Hi Bill,
    >The problem is that my application exe file needs another file (MyProject.chm) containing the compiled help text, and this needs to be installed beside the exe. 
    There is a method to add the chm file for a publishing project. Could you mind to follow the below steps to try?
    1.Right click your C++/MFC project and click "add existing item" in the VS
    2.Add the MyProject.chm file to your project
    3.Right the MyProject.chm file and click "Properties" and set the Build Action to "Content"
    4.Right click the project  and  switch to the publish tab , click "Application Files" button and include the MyProject.chm file
    5.Add your project to the Applications for the Windows Application Packaging Project and package the app. 

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by William Heitler Wednesday, September 25, 2019 7:56 PM
    Monday, September 16, 2019 2:58 AM
    Moderator
  • Thank you for this help. I got a bit stuck with the step 4 (right-clicking the project just gave a standard context menu, I couldn't find any Publish tab or Application Files button), but it gave me a push in the right direction. At step 4 in your list I just added the .chm file to the project, and that seemed to work.

    I have now successfully sideloaded the package on my development computer and called up the on-line help from within the program. Now I'll have to submit it to the store and see if it still works on beta testing.

    thanks again.

    Bill

    Wednesday, September 25, 2019 7:56 PM