OSDN Git Service

na-get-lib,レポジトリのUninstallKeyが不正に空だったときエラーが発生するのを修正
[applistation/AppliStation.git] / archive-inst / Program.cs
index 1a44c1c..75ac08c 100644 (file)
@@ -128,19 +128,13 @@ namespace ArchiveInstall
                                                //lnk.SetIconLocation(path, 0);\r
                                                \r
                                                // .lnk ファイル名\r
-                                               string lnkFileName;\r
-                                               System.Diagnostics.FileVersionInfo vInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(exeFile);\r
-                                               if (vInfo.ProductName != null && vInfo.ProductName != string.Empty\r
-                                                   && (!File.Exists(Path.Combine(progGrpPath, vInfo.ProductName+".lnk")))) {\r
-                                                       // 原則、lnkファイル名に製品名を採用\r
-                                                       lnkFileName = vInfo.ProductName;\r
-                                               } else {\r
-                                                       // そのほかの場合は、*.exeファイルの名前をそのまま使用\r
-                                                       lnkFileName = Path.GetFileNameWithoutExtension(exeFile);\r
+                                               string lnkFilePath = Path.Combine(progGrpPath, lnk.GetSuitableShellLinkNameFor() + ".lnk");\r
+                                               if (File.Exists(lnkFilePath)) { // ファイル名がかぶってしまったとき\r
+                                                       lnkFilePath = Path.Combine(progGrpPath, Path.GetFileNameWithoutExtension(exeFile) + ".lnk");\r
                                                }\r
                                                \r
                                                // 保存\r
-                                               lnk.ToPersistFile().Save(Path.Combine(progGrpPath, lnkFileName+".lnk"), true);\r
+                                               lnk.ToPersistFile().Save(lnkFilePath, true);\r
                                        }\r
                                }\r
                        }\r