private static void AddMsiMspPackageFromSQLBootstrapCache() { Logger.LogMsg("Add msi/msp packages from Bootstrap cache..."); UpdateUI("Add msi/msp packages from Bootstrap cache,may take minutes..."); int i = 0; int j = 0; List <string> cacheFolders = GetSQLBootStrapCacheFolder(); foreach (string folder in cacheFolders) { try { List <MsiMspPackage> cachePkgs = new List <MsiMspPackage>(); cachePkgs = MsiMspPackage.ScanSetupMedia(folder); foreach (MsiMspPackage m in cachePkgs) { sourcePkgs.Add(m); } } catch (Exception ex) { Logger.LogError("AddMsiMspPackageFromLastUsedSource:" + ex.ToString()); } } Logger.LogMsg("Total " + i + " packages from LastUsedSource added."); UpdateUI("Total " + i + " packages from LastUsedSource added."); }
public static void ScanSetupMedia() { String setupSource = myData.setupSource; sourcePkgs.Clear(); sourcePkgs = MsiMspPackage.ScanSetupMedia(setupSource); }
private static void AddMsiMspPackageFromLastUsedSource() { Logger.LogMsg("Add msi/msp packages from LastUsedSource..."); UpdateUI("Add msi/msp packages from LastUsedSource,may take minutes..."); int i = 0; int j = 0; foreach (myRow r in rows) { try { if (string.IsNullOrEmpty(r.LastUsedSource)) { continue; } j++; string path = Path.Combine(r.LastUsedSource, r.PackageName); UpdateUI("Checking (" + j + ") " + path); if (File.Exists(path)) { Logger.LogMsg(j + " [Found]" + path); MsiMspPackage pkg = new MsiMspPackage(path); if (!pkg.failedPackage) { sourcePkgs.Add(new MsiMspPackage(path)); } i++; } else { Logger.LogMsg(j + " [Not Found]" + path); } }catch (Exception ex) { Logger.LogError("AddMsiMspPackageFromLastUsedSource:" + ex.ToString()); } } Logger.LogMsg("Total " + i + " packages from LastUsedSource added."); UpdateUI("Total " + i + " packages from LastUsedSource added."); }
public static List <MsiMspPackage> ScanSetupMedia(string folder) { List <string> msiFiles = Utility.GetFilesFromFolder(folder, new string[] { "*.msi", "*.msp" }); List <MsiMspPackage> tmp_Packages = new List <MsiMspPackage>(); //now for each msi file, get its product code foreach (string f in msiFiles) { if (f.ToUpper().Contains("IA64")) { continue; } MsiMspPackage pkg = new MsiMspPackage(f); if (!pkg.failedPackage) { tmp_Packages.Add(pkg); } } return(tmp_Packages); }