diff --git a/Samples/DesktopAppTransition/PhotoStoreDemo/MainWindow.cs b/Samples/DesktopAppTransition/PhotoStoreDemo/MainWindow.cs index 921c9ac8..3f3f6b31 100644 --- a/Samples/DesktopAppTransition/PhotoStoreDemo/MainWindow.cs +++ b/Samples/DesktopAppTransition/PhotoStoreDemo/MainWindow.cs @@ -92,7 +92,7 @@ private void WindowLoaded(object sender, EventArgs e) if (Directory.Exists(sourceDir)) { //Obtain the path (String) to the "packaged" location, where the previous data will be migrated TO. - String destinationDir = Windows.Storage.ApplicationData.Current.LocalFolder.Path + "\\NewPhotoStore"; + String destinationDir = PhotosFolder.Current; //If you are moving data from one of the redirected folders, you need to use robocopy.exe to bypass redirection. This is the only time you should bypass redirection //Redirected folders: https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-behind-the-scenes @@ -346,4 +346,4 @@ private int RunProcess(string appName, string arguments) return process.ExitCode; } } -} \ No newline at end of file +} diff --git a/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs b/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs index 089e4153..86d47936 100644 --- a/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs +++ b/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs @@ -21,8 +21,11 @@ public static string Current } if (path==null) { - path = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName; - path = Path.Combine(path, "Photos"); + if(Directory.Exists(Path.Combine(Enviroment.GetFolderPath(Enviroment.SpecialFolders.LocalApplicationFolder), "PreviousPhotoStore")) + { + path = Path.Combine(Enviroment.GetFolderPath(Enviroment.SpecialFolders.LocalApplicationFolder), "PreviousPhotoStore"); + } + path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\PreviousPhotoStore" var di = new DirectoryInfo(path); if (!di.Exists) {