From b8e400b8da904773f280ecac60196b2e477642dd Mon Sep 17 00:00:00 2001 From: superkid200 Date: Sun, 30 Sep 2018 00:39:43 +0700 Subject: [PATCH 1/3] Update MainWindow.cs --- Samples/DesktopAppTransition/PhotoStoreDemo/MainWindow.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +} From ac7e7bb4d1b8b2b3822bdc09913bbd23d5528e7b Mon Sep 17 00:00:00 2001 From: superkid200 Date: Sun, 30 Sep 2018 00:44:00 +0700 Subject: [PATCH 2/3] Update PhotosFolder.cs --- Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs b/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs index 089e4153..0a9b4e33 100644 --- a/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs +++ b/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs @@ -21,6 +21,10 @@ public static string Current } if (path==null) { + if(Directory.Exists(Path.Combine(Enviroment.GetFolderPath(Enviroment.SpecialFolders.LocalApplicationFolder), "PreviousPhotoStore")) + { + path = Path.Combine(Enviroment.GetFolderPath(Enviroment.SpecialFolders.LocalApplicationFolder), "PreviousPhotoStore"); + } path = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName; path = Path.Combine(path, "Photos"); var di = new DirectoryInfo(path); From 00c97bbdbe9812c6fb6fe80c5bfc6d3c13f63102 Mon Sep 17 00:00:00 2001 From: superkid200 Date: Fri, 31 May 2019 11:18:38 +0700 Subject: [PATCH 3/3] Update PhotosFolder.cs --- Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs b/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs index 0a9b4e33..86d47936 100644 --- a/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs +++ b/Samples/DesktopAppTransition/PhotoStoreDemo/PhotosFolder.cs @@ -25,8 +25,7 @@ public static string Current { path = Path.Combine(Enviroment.GetFolderPath(Enviroment.SpecialFolders.LocalApplicationFolder), "PreviousPhotoStore"); } - path = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName; - path = Path.Combine(path, "Photos"); + path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\PreviousPhotoStore" var di = new DirectoryInfo(path); if (!di.Exists) {