OSDN Git Service

archive-inst,アーカイブ型のソフトのフォルダでインストール後に削除したファイル(設定ファイルなど)があったときにアップデートに失敗する不具合を修正
authorttp <ttp@users.sourceforge.jp>
Wed, 2 Dec 2009 10:54:50 +0000 (19:54 +0900)
committerttp <ttp@users.sourceforge.jp>
Wed, 2 Dec 2009 10:54:50 +0000 (19:54 +0900)
archive-inst/InstalledFileList.cs
archive-inst/Program.cs

index b991a7c..52a4e2c 100644 (file)
@@ -24,7 +24,9 @@ namespace ArchiveInstall
                public IEnumerable<InstalledFile> Verify(string rootDirectory)\r
                {\r
                        foreach (InstalledFile file in Entries) {\r
                public IEnumerable<InstalledFile> Verify(string rootDirectory)\r
                {\r
                        foreach (InstalledFile file in Entries) {\r
-                               if (! file.Hash.Validate(Path.Combine(rootDirectory, file.Path)) ) {\r
+                               string filepath = Path.Combine(rootDirectory, file.Path);\r
+                               \r
+                               if (File.Exists(filepath) && (! file.Hash.Validate(filepath))) {\r
                                        yield return file;\r
                                }\r
                        }\r
                                        yield return file;\r
                                }\r
                        }\r
index 844404b..fdf1ba4 100644 (file)
@@ -50,11 +50,13 @@ namespace ArchiveInstall
                                                }\r
                                                \r
                                                // 変更済みファイルをinstallSrcの方に反映させる\r
                                                }\r
                                                \r
                                                // 変更済みファイルをinstallSrcの方に反映させる\r
-                                               if (! Directory.Exists(Path.GetDirectoryName(toBeChangedFilePath))) {\r
-                                                       // フォルダーがない場合は作る\r
-                                                       Directory.CreateDirectory(Path.GetDirectoryName(toBeChangedFilePath));\r
+                                               if (File.Exists(changedFilePath)) {\r
+                                                       if (! Directory.Exists(Path.GetDirectoryName(toBeChangedFilePath))) {\r
+                                                               // フォルダーがない場合は作る\r
+                                                               Directory.CreateDirectory(Path.GetDirectoryName(toBeChangedFilePath));\r
+                                                       }\r
+                                                       File.Copy(changedFilePath, toBeChangedFilePath);\r
                                                }\r
                                                }\r
-                                               File.Copy(changedFilePath, toBeChangedFilePath);\r
                                        }\r
                                }\r
                        } else {\r
                                        }\r
                                }\r
                        } else {\r