How to copy UWP data files whe updating same application with WinUI3 packed version

Peterjc 81 Reputation points

Hi, I am updating my existing UWP store application with a new version ported to WinUI3. I have associated the new version with the existing store identify.

The existing application uses an SQLite file stored in the application data folder. I would like to copy this file to a new location when updating to the WinUI3 version.

I have added the code in the new version to do this, however, when I start the new packed version, I get the following message...


And if I continue, the old files are deleted, so I don't get a chance to copy the older database file

I see you can run scripts (, but I don't wan the users to have to run the Set-ExecutionPolicy -ExecutionPolicy RemoteSigned command prior to installing (they won't know to do this)

Is there any way I can get this file copied to a new location, before it is deleted?

Thanks in advance

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.
695 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Roy Li - MSFT 31,356 Reputation points Microsoft Vendor


    Welcome to Microsoft Q&A!

    Is there any way I can get this file copied to a new location, before it is deleted?

    I have to say the answer is no. Currently, there is no way to do this. During the installation, there is no way to change the file location. You need to move the data file manually or you might need to do it in the old app via code.

    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 comments No comments