label2.Text = string.Format("{0}({1})", uninstallPackage.Name, uninstallPackage.Version);\r
label2.Font = new Font(SystemFonts.DefaultFont.FontFamily, SystemFonts.DefaultFont.Size*1.5f);\r
\r
- Icon icon = getIconForPackage(uninstallPackage);\r
+ Icon icon = AppliStation.Util.PackageUtils.GetIconForPackage(uninstallPackage);\r
if (icon != null) {\r
iconLabel.Image = icon.ToBitmap();\r
iconLabel.Size = icon.Size;\r
}\r
}\r
}\r
- \r
- private static Icon getIconForPackage(InstalledPackage pkg)\r
- {\r
- string iconPath = pkg.UninstallInfo.IconPath;\r
- if (! string.IsNullOrEmpty(iconPath)) {\r
- if (iconPath.EndsWith(",0") || iconPath.EndsWith(",-0")) {\r
- iconPath = iconPath.Substring(0, iconPath.LastIndexOf(','));\r
- }\r
- if (File.Exists(iconPath)) {\r
- return Icon.ExtractAssociatedIcon(iconPath);\r
- }\r
- } else if (pkg.Type == InstallerType.ARCHIVE) {\r
- string progGrp = Path.Combine(NaGet.Env.ArchiveProgramGroup, pkg.Name);\r
- if (Directory.Exists(progGrp)) {\r
- string[] lnkFiles = Directory.GetFiles(progGrp, "*.lnk");\r
- \r
- if (lnkFiles.Length >= 1) {\r
- using (NaGet.InteropServices.ShellLink link = new NaGet.InteropServices.ShellLink(lnkFiles[0])) {\r
- if (File.Exists(link.GetPath(0))) {\r
- return Icon.ExtractAssociatedIcon(link.GetPath(0));\r
- }\r
- }\r
- }\r
- }\r
- }\r
- return null;\r
- }\r
- \r
+\r
public PackageUninstallConfirmForm()\r
{\r
//\r