Winui3, How to include folders to packaged installer?

44 Views Asked by At

I have a WinUI3 application that should supposed to copy a certain folder structure during installation so that this data is available local on each pc.

How do I implement this so that when I create an AppPackage, the folder structure is also copied when I run the installer?

Example folder structure which should be also packaged

  • Folder 1
    • Subfolder 1
      • files
    • Subfolder 2
      • files
    • Subfolder 3
      • files

The above folder structure should be present in the installation path of the app on every PC on which the application is installed.

1

There are 1 best solutions below

2
Andrew KeepCoding On BEST ANSWER

Try this on Visual Studio:

  1. Create the folder/sub-folder in the WinUI 3 project.
  2. Fill the folder with your files.
  3. Right-click a file and select property. The Properties pane should show up.
  4. Set Copy to Output Directory to Copy always or Copy if newer.
  5. Do the same for the other files in the folder.