Can I copy an added folder in Windows Application Packaging Project to Local via Package.appxmanifest?

youki 1,021 Reputation points
2023-12-21T19:52:23.7666667+00:00

I'm thinking about saving a folder with HTML files containing the manual locally so that it can be accessed via the app. The folder should be added to the Windows Application Packaging Project and then copied during installation.

Can I define this via Package.appxmanifest?

I've already seen that it should work via code:

https://techcommunity.microsoft.com/t5/modern-work-app-consult-blog/msix-how-to-copy-data-outside-the-installation-folder-during-the/ba-p/1133602

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
845 questions
0 comments No comments
{count} votes

Accepted answer
  1. Junjie Zhu - MSFT 20,921 Reputation points Microsoft External Staff
    2023-12-22T09:59:21.2366667+00:00

    Hi @youki ,

    Welcome to Microsoft Q&A!

    I create a WinUI3 project and refer to "Option 2: copy the files with a PowerShell script" ,it can work.

    You need to use PSF library, you can refer to the documentation Run scripts with the Package Support Framework.

    During the test, I found that in the WinUI3 project, PSF cannot be added in Visual Studio 2022. I need to download the PSF from the project folder using the command line.

    If you face difficulties during testing, please feel free to comment below.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.