/// <summary> /// Initializes a new instance of the <see cref="FeatureItem"/> class. /// </summary> /// <param name="session">The session.</param> /// <param name="name">The name.</param> public FeatureItem(Session session, string name) { // Debug.Assert(false); var data = session.OpenView("select * from Feature where Feature = '" + name + "'"); Dictionary <string, object> row = data.FirstOrDefault(); if (row != null) { Name = name; ParentName = (string)row["Feature_Parent"]; Title = (string)row["Title"]; Description = (string)row["Description"]; RawDisplay = (int)row["Display"]; Display = RawDisplay.MapToFeatureDisplay(); var defaultState = (InstallState)row["Level"]; CurrentState = DetectFeatureState(session, name); RequestedState = session.IsInstalled() ? CurrentState : defaultState; Attributes = (FeatureAttributes)row["Attributes"]; } }
protected void DetectPackageComplete(object sender, DetectPackageCompleteEventArgs e) { if (e.PackageId.Equals("MyInstaller.msi", StringComparison.Ordinal)) { this.State = e.State == PackageState.Present ? InstallState.Present : InstallState.NotPresent; } }
public override DataTemplate SelectTemplate(object item, DependencyObject container) { GameViewModel viewModel = item as GameViewModel; if (viewModel != null) { InstallState installState = viewModel.InstallState; Window win = Application.Current.MainWindow; // Select one of the DataTemplate objects, based on the // value of the selected item in the ComboBox. if (installState == InstallState.NotInstalled) { return(win.FindResource("NotInstalled") as DataTemplate); } else if (installState == InstallState.Installed) { return(win.FindResource("Installed") as DataTemplate); } else if (installState == InstallState.Updating) { return(win.FindResource("Updating") as DataTemplate); } else { return(win.FindResource("Dummy") as DataTemplate); } } return(null); }
public MainWindowModel(BootstrapperApplicationModel model) { this.model = model; State = InstallState.Initializing; WireUpEventHandlers(); CancelCommand = new DelegateCommand(() => { this.model.LogMessage("Cancelling..."); FuseBootstrapperApplication.Dispatcher.InvokeShutdown(); }, () => State != InstallState.Cancelled); _progressModel = new ProgressViewModel(CancelCommand); InstallCommand = new DelegateCommand(() => { _progressModel.Title = "Installing Fuse"; InnerContent = new ProgressView(_progressModel); this.model.PlanAction(LaunchAction.Install); }, () => true); UninstallCommand = new DelegateCommand(() => { _progressModel.Title = "Uninstalling Fuse"; InnerContent = new ProgressView(_progressModel); this.model.PlanAction(LaunchAction.Uninstall); }, () => true); InnerContent = model.BootstrapperApplication.Command.Action == LaunchAction.Uninstall ? (FrameworkElement) new UninstallView(new UninstallViewModel(UninstallCommand)) : (FrameworkElement) new InstallerView(new InstallerViewModel(InstallCommand, CancelCommand)); }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { InstallState state = (InstallState)value; switch (state) { case InstallState.NotStart: return(Strings.NotStart); case InstallState.Done: return(Strings.Done); case InstallState.DownloadFail: return(Strings.DownloadFail); case InstallState.Downloading: return(Strings.Downloading); case InstallState.InstallFail: return(Strings.InstallFail); case InstallState.Installing: return(Strings.Installing); case InstallState.UserCancelled: return(Strings.UserCancelled); case InstallState.UserCancelling: return(Strings.UserCancelling); } return(string.Empty); }
private void SetNetworkInstallState() { InstallState installState = Application.Current.InstallState; switch (installState) { case InstallState.NotInstalled: _Stats.InstallStateMessage = "オンライン"; break; case InstallState.Installing: _Stats.InstallStateMessage = "インストール中"; break; case InstallState.Installed: _Stats.InstallStateMessage = "インストール済"; break; case InstallState.InstallFailed: _Stats.InstallStateMessage = "インストール失敗"; break; default: throw new ArgumentOutOfRangeException(); } }
public InstallViewModel( BootstrapperApplicationModel model) { this.model = model; this.State = InstallState.Initializing; this.WireUpEventHandlers(); this.InstallCommand = new DelegateCommand(() => this.model.PlanAction(LaunchAction.Install), () => this.State == InstallState.NotPresent); this.UninstallCommand = new DelegateCommand(() => this.model.PlanAction(LaunchAction.Uninstall), () => this.State == InstallState.Present); this.CancelCommand = new DelegateCommand(() => { this.model.LogMessage("Cancelling..."); if (this.State == InstallState.Applying) { this.State = InstallState.Cancelled; } else { CustomBootstrapperApplication.Dispatcher .InvokeShutdown(); } }, () => this.State != InstallState.Cancelled); }
/// <summary> /// Is the provided path a valid Mono install? /// </summary> public static bool IsValidOutwardMonoPath(string path, out InstallState state) { var suf = $@"{Path.DirectorySeparatorChar}Outward.exe"; if (path.EndsWith(suf)) { path = path.Substring(0, path.Length - suf.Length); } if (File.Exists(Path.Combine(path, "GameAssembly.dll"))) { // il2cpp install. using "Outdated" for this result. state = InstallState.Outdated; return(false); } if (File.Exists(Path.Combine(path, "Outward_Data", "Managed", "Assembly-CSharp.dll")) && Directory.Exists(Path.Combine(path, "MonoBleedingEdge"))) { state = InstallState.Installed; return(true); } state = InstallState.NotInstalled; return(false); }
public override void ReadFromDocument(XmlNode element) { RhinoSDKVersion = XmlHelper.SelectSingleNodeInnerText(element, "RhinoSDKVersion", this.m_plugin_path); RhinoSDKServiceRelease = XmlHelper.SelectSingleNodeInnerText(element, "RhinoSDKServiceRelease", this.m_plugin_path); DotNetSDKVersion = XmlHelper.SelectSingleNodeInnerText(element, "DotNetSDKVersion", this.m_plugin_path); RhinoCommonSDKVersion = XmlHelper.SelectSingleNodeInnerText(element, "RhinoCommonSDKVersion", this.m_plugin_path); try { string sInstallState = XmlHelper.SelectSingleNodeInnerText(element, "InstallState", this.m_plugin_path); InstallState = (PackageInstallState)Enum.Parse(InstallState.GetType(), sInstallState); } catch (System.ArgumentException) { InstallState = PackageInstallState.Unknown; } try { string sPlatform = XmlHelper.SelectSingleNodeInnerText(element, "Platform", this.m_plugin_path); OS = (OSPlatform)Enum.Parse(OS.GetType(), sPlatform); } catch { OS = OSPlatform.Unknown; } }
public AppInstallItem(GadgetItemOnline item, WebClient client, string localFile) { this.appItem = item; this.webClient = client; this.locakPackFile = localFile; this.Percent = 0; this.State = InstallState.NotStart; }
private void RollbackOrUninstall(InstallerFileTable objTable, string strInstallRoot, double initialProgress) { InstallState = InstallState.Rollingback; if (objTable != null) { objTable.RemoveInstalledFiles(strInstallRoot, ref _dblProgress, ref _strCurrentFile, initialProgress); } }
public int FeatureCost(string feature, CostTree costTree, InstallState state) { int cost = 0; TR(MsiGetFeatureCost(m_handle.Handle, feature, (UInt32)costTree, (UInt32)state, out cost)); return(cost); }
/// <summary> /// Constructeur /// </summary> /// <param name="nom">Nom du jeu</param> /// <param name="icône">Icône représentant le jeu</param> /// <param name="executablePath">Chemin vers l'executable du jeu</param> /// <param name="description">Description du jeu</param> public Game(String nom, String icône, String executablePath, string description, int version, InstallState installed) { this.Name = nom; this.Icon = icône; this.Executable = executablePath; this.Description = description; this.Install = installed; this.Version = version; }
/// <summary> /// Installs files that are unexpectedly missing. /// </summary> /// <param name="product">Product code for the product that owns the component to be installed</param> /// <param name="component">Component to be installed</param> /// <param name="installState">Specifies the way the component should be installed.</param> /// <exception cref="InstallCanceledException">the user exited the installation</exception> /// <remarks><p> /// Win32 MSI API: /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiinstallmissingcomponent.asp">MsiInstallMissingComponent</a> /// </p></remarks> public static void InstallMissingComponent(string product, string component, InstallState installState) { uint ret = NativeMethods.MsiInstallMissingComponent(product, component, (int)installState); if (ret != 0) { throw InstallerException.ExceptionFromReturnCode(ret); } }
/// <summary> /// 리스트뷰 아이템추가 /// </summary> protected void AddItem(string p_strName, string p_strPath, InstallState p_state) { ListViewItem item = new ListViewItem(); item.Text = p_strName; item.SubItems.Add(p_strPath); item.SubItems.Add(p_state.ToString()); item.SubItems.Add(""); this.AddItem(item); }
protected void DetectPackageComplete(object sender, DetectPackageCompleteEventArgs e) { Console.WriteLine(e.PackageId + " " + e.State.ToString()); State = InstallState.NotPresent; if (e.PackageId.Equals("MyInstaller.msi", StringComparison.Ordinal)) { if (e.State == PackageState.Present) { State = InstallState.Present; } } }
public void EnumComponentCosts(string component, int index, InstallState installState, out string driveResult, out int cost, out int tempCost) { int driveLength = Installer.MaxPathLength; StringBuilder drive = new StringBuilder(driveLength); TR(MsiEnumComponentCosts(m_handle.Handle, component, index, (UInt32)installState, drive, ref driveLength, out cost, out tempCost)); driveResult = drive.ToString(); }
/// <summary> /// Is BepInEx installed at all? /// </summary> public static bool IsBepInExInstalled() { if (!Folders.IsCurrentOutwardPathValid()) { //Console.WriteLine("Current Outward install path not set or invalid!"); s_lastInstallStateResult = InstallState.NotInstalled; return(false); } return(File.Exists(BepInExFilePath) && File.Exists(Path.Combine(Folders.OUTWARD_FOLDER, "winhttp.dll"))); }
public MSI.InstallState FeatureState(string feature, out InstallState installedReturn, out InstallState actionReturn) { UInt32 installed; UInt32 action; MSI.InstallState result = (MSI.InstallState) MsiGetFeatureState(m_handle.Handle, feature, out installed, out action); installedReturn = (InstallState)installed; actionReturn = (InstallState)action; return(result); }
public void Init() { List <Dism.Feature> features; if (!Dism.TryGetFeatures(out features)) { throw new Exception("Failed to call out to DISM. This installer supports Window 7 SP1 and above on workstations and Windows 2008 R2 and above on servers"); } MSMQFeatures = features.Where(p => p.Name.StartsWith("MSMQ")).ToList(); var msmqServer = MSMQFeatures.Single(p => p.Name.Equals("MSMQ-Server")); InstallState = msmqServer.State == Dism.FeatureState.Enabled ? InstallState.Installed : InstallState.NotInstalled; }
public MSI.InstallState ComponentState(string component, out InstallState installedReturn, out InstallState actionReturn) { UInt32 installed; UInt32 action; MSI.InstallState result = (MSI.InstallState) MsiGetComponentState(m_handle.Handle, component, out installed, out action); installedReturn = (InstallState)installed; actionReturn = (InstallState)action; return(result); }
void UseWrench() { //objectBehaviour.ServerSetAnchored(!objectBehaviour.IsPushable, currentInteraction.Performer); objectBehaviour.ServerSetPushable(!objectBehaviour.IsPushable); if (objectBehaviour.IsPushable) { installState = InstallState.Unattached; } else { installState = InstallState.Anchored; } }
private void EndInstallation() { if (InstallState == Installer.InstallState.Rollingback) { InstallState = InstallState.Canceled; } else if (InstallState == Installer.InstallState.Installing) { InstallState = Installer.InstallState.Successful; } else { Globals.Throw("Install state was invalid for end installation. The program may not have installed."); } }
/// <summary> /// Checks a registry value to see if MSMQ is installed /// </summary> private void CheckMSMQ() { // Checks to see if MSMQ is installed Microsoft.Win32.RegistryKey subKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\MSMQ\\Setup"); if (subKey != null) { //BUG FIX ! subKey.GetValue is null - statement commented out for now //if ((int)subKey.GetValue("msmq_CoreInstalled") == 1) //{ msmqInstallState = InstallState.Installed; /*} * else * { * msmqInstallState = InstallState.NotInstalled; * }*/ } }
private void ExecuteUninstall() { InstallerFileTable objTable = null; InstallerBinary objBinary = null; InstallOptions objOptions = null; InstallState = Installer.InstallState.Uninstalling; //TODO: uninstaller has to store options AND uninstall table. try { objBinary = new InstallerBinary(); objBinary.OpenStream(); objOptions = new InstallOptions(); objOptions.Deserialize(objBinary); objTable = new InstallerFileTable(this); objTable.Deserialize(objBinary); objBinary.CloseStream(); ProgramInfo objInfo = new ProgramInfo(objOptions); string strInstallRoot = objOptions.GetOptionValueOrDefault(InstallOption.UninstallFolderRoot_Uninstaller_Only); if (!System.IO.Directory.Exists(strInstallRoot)) { Globals.Logger.LogError("Fatal Error: The original install directory '" + strInstallRoot + "' does not exist, or was not packed in the uninstaller binary.", true, true); } RollbackOrUninstall(objTable, strInstallRoot, 0.0); RemoveRegistryKeys(objInfo); InstallState = Installer.InstallState.Successful; } catch (Exception ex) { InstallState = Installer.InstallState.Canceled; InstallErrors.Add("Error: " + ex.ToString()); Globals.Logger.LogError(ex.ToString(), false, true); } finally { EndUninstall(); } }
public Installer(VersionInfoRemote versionToInstall, VersionInfoLocal currentInstalled, InstallState currentInstallState, string rwLocation) { this.versionToInstall = versionToInstall; this.currentInstalled = currentInstalled; this.currentInstallState = currentInstallState; this.rwLocation = rwLocation; this.ctSource = new CancellationTokenSource(); var tempPath = Path.GetTempPath(); var dlPath = Path.Combine(tempPath, "CTAInstaller"); if (!Directory.Exists(dlPath)) { Directory.CreateDirectory(dlPath); } this.packageFile = Path.Combine(dlPath, "cta_latest.rwp"); }
/// <summary> /// Is BepInEx up to date? /// </summary> public static bool IsBepInExUpdated() { // Only query the version once per launch. // This is to limit GitHub API queries, since we are limited to 60 per hour. if (string.IsNullOrEmpty(s_latestBepInExVersion)) { s_latestBepInExVersion = GithubHelper.GetLatestReleaseVersion(BEPINEX_RELEASE_API_QUERY); } if (string.IsNullOrEmpty(s_latestBepInExVersion)) { Console.WriteLine("BepInEx GitHub release query returned null! Are you offline?"); if (File.Exists(BepInExFilePath)) { s_lastInstallStateResult = InstallState.Installed; return(true); } s_lastInstallStateResult = InstallState.NotInstalled; return(false); } if (!File.Exists(BepInExFilePath)) { //Console.WriteLine("BepInEx not installed at '" + existingFilePath + "'"); s_lastInstallStateResult = InstallState.NotInstalled; return(false); } string file_version = FileVersionInfo.GetVersionInfo(BepInExFilePath).FileVersion; if (new Version(file_version) >= new Version(s_latestBepInExVersion)) { // Console.WriteLine($"BepInEx {latestVersion} is up to date!"); s_lastInstallStateResult = InstallState.Installed; return(true); } else { Console.WriteLine($"Your current BepInEx version {file_version} is older than latest version: {s_latestBepInExVersion}"); s_lastInstallStateResult = InstallState.Outdated; return(false); } }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { InstallState state = (InstallState)value; switch (state) { case InstallState.NotStart: return(Resources.NotStart); case InstallState.Done: return(Resources.InstallDone); case InstallState.DownloadFail: return(Resources.DownloadFail); case InstallState.Downloading: return(Resources.Downloading); case InstallState.InstallFail: return(Resources.InstallFail); case InstallState.InstallFail_FileInUse: return(Resources.InstallFail); case InstallState.InstallFail_PathTooLongException: return(Resources.InstallFail); case InstallState.InstallFail_RequirePermission: return(Resources.InstallFail); case InstallState.InstallFail_UnauthorizedAccess: return(Resources.InstallFail); case InstallState.Installing: return(Resources.Installing); case InstallState.UserCancelled: return(Resources.UserCancelled); case InstallState.UserCancelling: return(Resources.UserCancelling); } return(string.Empty); }
/// <summary> /// Set the Outward folder path to the provided path. /// </summary> /// <returns><see langword="true"/> if successful and a valid Mono path, otherwise <see langword="false"/></returns> public static bool SetOutwardFolderPath(string path, out InstallState state) { path = Path.GetFullPath(path); if (!IsValidOutwardMonoPath(path, out state)) { Console.WriteLine($"'{path}' is not a valid Outward Mono install path!"); return(false); } m_outwardPath = path; CheckOutwardMefinoInstall(); //Console.WriteLine($"Set Outward folder to '{OUTWARD_FOLDER}'"); return(true); }
private void ChangeState(InstallState state) { switch (state) { case InstallState.Install: StateText.Text = "未安装"; InstallButton.Content = "安装"; InstallButton.Visibility = System.Windows.Visibility.Visible; DeleteButton.Visibility = System.Windows.Visibility.Collapsed; break; case InstallState.Fix: StateText.Text = "有错误"; InstallButton.Content = "修复"; InstallButton.Visibility = System.Windows.Visibility.Visible; DeleteButton.Visibility = System.Windows.Visibility.Visible; break; case InstallState.Modify: StateText.Text = "已安装"; InstallButton.Content = "保存修改"; if (AdvanceExpander.IsExpanded) { InstallButton.Visibility = System.Windows.Visibility.Visible; } else { InstallButton.Visibility = System.Windows.Visibility.Collapsed; } DeleteButton.Visibility = System.Windows.Visibility.Visible; break; case InstallState.Modified: StateText.Text = "已修改"; InstallButton.Content = "保存修改"; InstallButton.Visibility = System.Windows.Visibility.Visible; DeleteButton.Visibility = System.Windows.Visibility.Visible; break; default: break; } TobeState = state; }
/// <summary> /// Gets disk space per drive required to install a component. /// </summary> /// <param name="installState">Requested component state</param> /// <returns>A list of InstallCost structures, specifying the cost for each drive for the component</returns> /// <remarks><p> /// Win32 MSI API: /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msienumcomponentcosts.asp">MsiEnumComponentCosts</a> /// </p></remarks> public IList <InstallCost> GetCost(InstallState installState) { IList <InstallCost> costs = new List <InstallCost>(); StringBuilder driveBuf = new StringBuilder(20); for (uint i = 0; true; i++) { int cost, tempCost; uint driveBufSize = (uint)driveBuf.Capacity; uint ret = RemotableNativeMethods.MsiEnumComponentCosts( (int)this.session.Handle, this.name, i, (int)installState, driveBuf, ref driveBufSize, out cost, out tempCost); if (ret == (uint)NativeMethods.Error.NO_MORE_ITEMS) { break; } if (ret == (uint)NativeMethods.Error.MORE_DATA) { driveBuf.Capacity = (int)++driveBufSize; ret = RemotableNativeMethods.MsiEnumComponentCosts( (int)this.session.Handle, this.name, i, (int)installState, driveBuf, ref driveBufSize, out cost, out tempCost); } if (ret != 0) { throw InstallerException.ExceptionFromReturnCode(ret); } costs.Add(new InstallCost(driveBuf.ToString(), cost * 512L, tempCost * 512L)); } return(costs); }
private void SetState(InstallState state) { this.state = state; this.Invoke(new EventHandler(delegate { switch (state) { case InstallState.UnInstalled: this.progressBar.Hide(); this.labelProgress.Hide(); this.labelStatus.Text = "UnInstall finished"; MoveControlToTheLeftOf(labelStatus, this.Right); SetInstalLinkText("Install"); break; case InstallState.None: this.progressBar.Hide(); this.labelProgress.Hide(); if (this.ApplicationItem.DetectedVersion.Length > 0) { SetInstalLinkText("UnInstall"); } else { SetInstalLinkText("Install"); } break; case InstallState.Downloading: // Hide any previous errors we might have had this.downloadErrorBox.Visible = false; this.installErrorBox.Visible = false; // Update the progress bar with our progress this.progressBar.Visible = true; SetInstalLinkText("Cancel"); break; case InstallState.Downloaded: this.labelStatus.Visible = true; this.labelStatus.Text = "Downloaded"; MoveControlToTheLeftOf(labelStatus, this.Right); this.progressBar.Visible = false; SetInstalLinkText("Install"); break; case InstallState.Installing: this.labelStatus.Text = "Installing..."; MoveControlToTheLeftOf(labelStatus, this.Right); this.downloadErrorBox.Visible = false; // Reset any errors we've had in the past this.installError = null; this.installErrorBox.Visible = false; this.labelProgress.Hide(); SetInstalLinkText("Cancel"); break; case InstallState.Installed: this.labelStatus.Text = "Install finished"; MoveControlToTheLeftOf(labelStatus, this.Right); this.ApplicationItem.DetectVersion(); SetInstalLinkText("UnInstall"); break; } })); }
/// <summary> /// Checks a registry value to see if MSMQ is installed /// </summary> private void CheckMSMQ() { // Checks to see if MSMQ is installed Microsoft.Win32.RegistryKey subKey =Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\MSMQ\\Setup"); if (subKey != null) { //BUG FIX ! subKey.GetValue is null - statement commented out for now //if ((int)subKey.GetValue("msmq_CoreInstalled") == 1) //{ msmqInstallState = InstallState.Installed; /*} else { msmqInstallState = InstallState.NotInstalled; }*/ } }
/// <summary> /// Configures the installed state for a product feature. /// </summary> /// <param name="productCode">Product code of the product to be configured.</param> /// <param name="feature">Specifies the feature ID for the feature to be configured.</param> /// <param name="installState">Specifies the installation state for the feature.</param> /// <exception cref="InstallerException">There was an error configuring the feature</exception> /// <remarks><p> /// The <see cref="RebootRequired"/> and <see cref="RebootInitiated"/> properties should be /// tested after calling this method. /// </p><p> /// Win32 MSI API: /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiconfigurefeature.asp">MsiConfigureFeature</a> /// </p></remarks> public static void ConfigureFeature(string productCode, string feature, InstallState installState) { uint ret = NativeMethods.MsiConfigureFeature(productCode, feature, (int) installState); Installer.CheckInstallResult(ret); }
/// <summary> /// Installs files that are unexpectedly missing. /// </summary> /// <param name="product">Product code for the product that owns the component to be installed</param> /// <param name="component">Component to be installed</param> /// <param name="installState">Specifies the way the component should be installed.</param> /// <exception cref="InstallCanceledException">the user exited the installation</exception> /// <remarks><p> /// Win32 MSI API: /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiinstallmissingcomponent.asp">MsiInstallMissingComponent</a> /// </p></remarks> public static void InstallMissingComponent(string product, string component, InstallState installState) { uint ret = NativeMethods.MsiInstallMissingComponent(product, component, (int) installState); if (ret != 0) { throw InstallerException.ExceptionFromReturnCode(ret); } }
/// <summary> /// Installs or uninstalls a product. /// </summary> /// <param name="productCode">Product code of the product to be configured.</param> /// <param name="installLevel">Specifies the default installation configuration of the /// product. The <paramref name="installLevel"/> parameter is ignored and all features /// are installed if the <paramref name="installState"/> parameter is set to any other /// value than <see cref="InstallState.Default"/>. This parameter must be either 0 /// (install using authored feature levels), 65535 (install all features), or a value /// between 0 and 65535 to install a subset of available features. </param> /// <param name="installState">Specifies the installation state for the product.</param> /// <param name="commandLine">Specifies the command line property settings. This should /// be a list of the format Property=Setting Property=Setting.</param> /// <exception cref="InstallerException">There was an error configuring the product</exception> /// <remarks><p> /// This method displays the user interface with the current settings and /// log mode. You can change user interface settings with the <see cref="SetInternalUI(InstallUIOptions)"/> /// and <see cref="SetExternalUI(ExternalUIHandler,InstallLogModes)"/> functions. You can set the log mode with the /// <see cref="EnableLog(InstallLogModes,string)"/> function. /// </p><p> /// The <see cref="RebootRequired"/> and <see cref="RebootInitiated"/> properties should be /// tested after calling this method. /// </p><p> /// Win32 MSI APIs: /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiconfigureproduct.asp">MsiConfigureProduct</a>, /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiconfigureproductex.asp">MsiConfigureProductEx</a> /// </p></remarks> public static void ConfigureProduct(string productCode, int installLevel, InstallState installState, string commandLine) { uint ret = NativeMethods.MsiConfigureProductEx(productCode, installLevel, (int) installState, commandLine); Installer.CheckInstallResult(ret); }
private void CheckInstalledTTVersion() { string softwareNode = null; // Check for 32 or 64 bit OS Microsoft.Win32.RegistryKey osSubKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Wow6432Node\\NaturalPoint\\TrackingTools"); if (osSubKey != null) // 64-bit OS { softwareNode = "Software\\Wow6432Node\\"; } else // 32-bit OS { softwareNode = "Software\\"; } //Build the tracking tools node string string ttNode = softwareNode + "NaturalPoint\\TrackingTools"; //See if its there yet Microsoft.Win32.RegistryKey subKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(ttNode); if (subKey != null) { // If its there - see if the versions match Microsoft.Win32.RegistryKey ttVersionKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(ttNode + "\\" + StroMoHab_Setup_Packages.Properties.Settings.Default.TrackingToolsVersion + ".0000"); if (ttVersionKey != null) { // Versions match ttInstallState = InstallState.Installed; } else { // old version ttInstallState = InstallState.InstalledButOld; } } else // not installed { ttInstallState = InstallState.NotInstalled; } }
public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); m_eInstallingState = InstallState.InstallStateInstalling; }
public override void Uninstall(System.Collections.IDictionary savedState) { m_eInstallingState = InstallState.InstallStateUninstalling; UnregisterSelf(); base.Uninstall(savedState); }
public static extern uint ConfigureFeature(string productCode, string featureName, InstallState state);
/// <summary> /// Initializes a new instance of the <see cref="FeatureItem"/> class. /// </summary> /// <param name="session">The session.</param> /// <param name="name">The name.</param> public FeatureItem(Session session, string name) { var data = session.OpenView("select * from Feature where Feature = '" + name + "'"); Dictionary<string, object> row = data.FirstOrDefault(); if (row != null) { Name = name; ParentName = (string)row["Feature_Parent"]; Title = (string)row["Title"].ToString(); Description = (string)row["Description"]; var defaultState = (InstallState)row["Level"]; CurrentState = DetectFeatureState(session, name); RequestedState = session.IsInstalled() ? CurrentState : defaultState; Attributes = (FeatureAttributes)row["Attributes"]; } }