public void install(string args, string logfile, InstallerState installstate, bool driverupgrade) { //addcerts(installdir); workaroundSystemStartOptions(); if (driverupgrade) { XenPrepSupport.DontBootStartPVDrivers(); XenPrepSupport.RemovePVDriversFromFilters(); XenPrepSupport.WinVersion version = new XenPrepSupport.WinVersion(); if (version.GetVersionValue() <= 0x600) { Trace.WriteLine("VISTA / 2K8"); XenPrepSupport.CleanUpPVDrivers(true); } else { Trace.WriteLine("NOT VISTA / 2K8 " + version.GetVersionValue().ToString() ); XenPrepSupport.CleanUpPVDrivers(); } } Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\partmgr\Parameters", true).SetValue("SanPolicy", 0x00000001); base.install(args, logfile, installstate); enumerateBus(); try { Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase", true).DeleteSubKeyTree(@"root#xenevtchn"); } catch { } finally { Trace.WriteLine("root#xenevtchn key not present in CDDB"); } if (driverupgrade) { try { Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\xenfilt\unplug", true).DeleteValue("DISKS"); } catch (Exception e) { Trace.WriteLine("Disks still scheduled to be unplugged " + e.ToString()); } try { Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\xenfilt\unplug", true).DeleteValue("NICS"); Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\xenvif", true).SetValue("Start", 3, RegistryValueKind.DWord); } catch (Exception e) { Trace.WriteLine("NICs still scheduled to be unplugged " + e.ToString()); } XenPrepSupport.RemoveXenVifNetworkClassKeys(); } }
public void install(string args, string logfile, InstallerState installstate) { uint err=0; log.Clear(); IntPtr a = IntPtr.Zero; MsiSetInternalUI(INSTALLUILEVEL.INSTALLUILEVEL_FULL, ref a); //MsiSetExternalUI(uiHandler, INSTALLLOGMODE.INSTALLLOGMODE_PROGRESS | INSTALLLOGMODE.INSTALLLOGMODE_ACTIONDATA, UIntPtr.Zero); Trace.WriteLine("Installing " + this.pathname); bool retry; int retrycount=0; do { retry = false; MsiEnableLog(INSTALLLOGMODE.INSTALLLOGMODE_VERBOSE, Application.CommonAppDataPath + "\\" + logfile, INSTALLLOGATTRIBUTES.INSTALLLOGATTRIBUTES_FLUSHEACHLINE); try { // Wait to be allowed to install. If any of this fails, give up, and try the install anyway EnsureMsiMutexAvailable(new TimeSpan(0,1,0)); err = MsiInstallProduct(this.pathname, "REBOOT=ReallySuppress ALLUSERS=1 ARPSYSTEMCOMPONENT=0" + " " + args); } catch (Exception e) { Trace.WriteLine("Unable to handle " + e.ToString()); throw; } switch (err) { case 0: break; case 1603: Trace.WriteLine("Detected another installer running, sleeping"); retry = true; retrycount += 10; Thread.Sleep(1000 * 10); break; case 1618: Trace.WriteLine("Detected another installer running, sleeping"); retry = true; retrycount += 10; Thread.Sleep(1000 * 10); break; case 3010: break; case 3011: break; default: Trace.WriteLine("MSI Install failed " + err.ToString()); throw new InstallerException("Installation of\n" + this.pathname + "\nfailed with error code " + err.ToString()); } if (retry && retrycount > 60) { throw new InstallerException("Installation failed, too many retries, last error :" + err.ToString()); } } while (retry); try { Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + ProductGuid, true).DeleteValue("SystemComponent"); } catch { Trace.WriteLine("Unable to delete SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\SystemComponent" + ProductGuid); } return; }
public CitrixXenServerInstallStatus(InstallerState InstallState) { this.InstallState = InstallState; }
protected override void OnStart(string[] args) { // Start thread - so we can do everything in the background TextWriterTraceListener tlog = new TimeDateTraceListener(Application.CommonAppDataPath + "\\Install.log", "Install"); Trace.Listeners.Add(tlog); Trace.AutoFlush = true; Trace.WriteLine("OnStart"); InstallState = new InstallerState(); installthread = new Thread(InstallThreadHandler); installthread.Start(); }
public new void install(string args, string logfile, InstallerState installstate) { //addcerts(installdir); Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\partmgr\Parameters", true).SetValue("SanPolicy", 0x00000001); base.install(args, logfile, installstate); }
public void install(string args, string logfile, InstallerState installstate, bool driverupgrade) { //addcerts(installdir); workaroundSystemStartOptions(); Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\partmgr\Parameters", true).SetValue("SanPolicy", 0x00000001); base.install(args, logfile, installstate); enumerateBus(); try { Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase", true).DeleteSubKeyTree(@"root#xenevtchn"); } catch { } finally { Trace.WriteLine("root#xenevtchn key not present in CDDB"); } if (driverupgrade) { try { Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\xenfilt\unplug", true).DeleteValue("DISKS"); } catch (Exception e) { Trace.WriteLine("Disks still scheduled to be unplugged " + e.ToString()); } try { Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\xenfilt\unplug", true).DeleteValue("NICS"); Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\xenvif", true).SetValue("Start", 3, RegistryValueKind.DWord); } catch (Exception e) { Trace.WriteLine("NICs still scheduled to be unplugged " + e.ToString()); } } }