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

Peterjc 81 Reputation points
2022-07-04T00:43:11.1+00:00

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...

![217156-image.png]1

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 (https://learn.microsoft.com/en-us/windows/msix/psf/run-scripts-with-package-support-framework), 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
    2022-07-04T02:30:51.393+00:00

    Hello,

    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