locked
Copying files to the app data folder when the app is installed

    Question

  • Is there a way to copy files to the app data folder when the app is installed ? Is there a way to designate this as part of Visual Studio? I havent really looked at installables for Win8, but this could be done through an msi of course on Win7.

    I wanted to know if this could be done as part of development process rather than the final deployment. For eg , like have a resources folder or something as part of the project which automatically copies the files to the apps local folder.

    Tuesday, February 7, 2012 2:08 AM

Answers

  • Each user will have a separate Application Data folders. There is no way to automatically copy data there on install. You can include it in your app package so it is present in the install directory and then copy it to the app data store as needed when the app runs.

    --Rob

    • Marked as answer by Bob_Bao Tuesday, March 6, 2012 4:53 PM
    Wednesday, February 8, 2012 1:15 AM
    Owner

All replies

  • Hi Amshinde,

    Put the files in your AppxPackage.  In your Visual Studio project set the file's properties as Content and to copy to the output directory.

    --Rob

    Tuesday, February 7, 2012 2:23 AM
    Owner
  • Hi Rob,

    I dont know if I am missing something, but I do not see the option of copy to output directory while developing a C++ project. I see this option in C# project. Also, are these files copied to the app data folder?

    Tuesday, February 7, 2012 7:00 PM
  • There are a few C++ samples that do this. Check out the Magazine sample. There are a couple .jpg files distributed in the Appx package.

    Does that help?

    Thanks,

    -David

     
    Tuesday, February 7, 2012 7:35 PM
    Moderator
  • That somewhat made things clearer. Like in the above example , the jpeg images are part of the package and can be accessed using the location Application Model::Package::Current->InstalledLocation. So i can modify files at this location or programmatically copy them to the app data store.

    But as of now, I see no way of having the files already copied to the appdata store when the app is installed.

    Wednesday, February 8, 2012 12:35 AM
  • Each user will have a separate Application Data folders. There is no way to automatically copy data there on install. You can include it in your app package so it is present in the install directory and then copy it to the app data store as needed when the app runs.

    --Rob

    • Marked as answer by Bob_Bao Tuesday, March 6, 2012 4:53 PM
    Wednesday, February 8, 2012 1:15 AM
    Owner