Example #1
0
        private void featureDirectoryList_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            SetupDirectory dir = null;

            if (1 == featureDirectoryList.SelectedItems.Count)
            {
                dir = (SetupDirectory)featureDirectoryList.SelectedItems[0].Tag;
            }
            //if (e.Item != null)
            //    dir = (SetupDirectory)e.Item.Tag;

            directoryProperties.SelectedObject = dir;
        }
Example #2
0
 public SetupFeature()
 {
     enableInDefaultInstall = true;
     enableInMinimalInstall = true;
     _childFeatures         = new List <SetupFeature>();
     _components            = new List <SetupComponent>();
     _featureId             = "ID" + SetupDirectory.GetMd5Hash(Guid.NewGuid().ToString());
     _featureId             = _featureId.Replace('-', '_').ToUpper();
     _defaultInstallMode    = InstallModeE.NOT_INSTALLED;
     _featureName           = "New Feature";
     _featureDescription    = "Enter Description Here";
     _directories           = new List <SetupDirectory>();
     //_component = new SetupComponent();
     _shortcuts = new List <SetupShortcut>();
 }
        private void MakeVcIntegration(string ideName, SetupDirectory dir, SetupFeature feature, XmlElement featureNode)
        {
            string ide_version = "";
            string feature_option = "";
            switch (ideName)
            {
                case "Microsoft Visual Studio 2003":
                    ide_version = "7.1";
                    feature_option = projectProperties.VS2003Integration;
                    break;
                case "Microsoft Visual Studio 2005":
                    ide_version = "8.0";
                    feature_option = projectProperties.VS2005Integration;
                    break;
            }

            // Must modify C:\Documents and Settings\jgaa\Local Settings\Application Data\Microsoft\VisualStudio\7.1\VCComponents.dat
            #if DEBUG
            XmlElement bin = GetBinDll(Path.Combine(Path.Combine(Shell.warSetupResPath, "CustomActions"), "WarSetupPluginD.dll"));
            #else
            XmlElement bin = GetBinDll(Path.Combine(Path.Combine(Shell.warSetupResPath, "CustomActions"), "WarSetupPlugin.dll"));
            #endif

            string ini_path = @"[LocalAppDataFolder]Microsoft\VisualStudio\" + ide_version + @"\VCComponents.dat";

            SetPropertyValue("VCCOMPONENTSFILEPATH", ini_path);

            string prop_key = MakeVcFileCond(ini_path, null);

            SetPropertyValue("VC_VERSION", ideName);

            string feature_cond_install = "";
            if ((null != feature_option) && ("" != feature_option))
            {
                // make a rule that only activates the integration i fa feature with Id feature_option is enabled
                feature_cond_install = " AND (&" + feature_option + "=3) ";
                //feature_cond_uninstall = " OR (&feature_option=2) ";
            }

            // TODO: Add CustomAction to abort installation if the feature is enabled and
            // the VCComponents.dat file is missing.
            {
                XmlElement abort = doc.CreateElement("CustomAction");
                abort.SetAttribute("Id", GetUniqueId().ToUpper());
                abort.SetAttribute("Error", "The required file " + ini_path
                    + " is missing. "
                    + ideName + " must be installed, and you must have entered the "
                    + "Tools/Options menu and selected Projects/C++ Directories "
                    + "at least once (That's when this file is created).");
                product.AppendChild(abort);

                AddExecuteSequence(abort.GetAttribute("Id"), "(NOT " + prop_key
                    + ") AND (&" + featureNode.GetAttribute("Id") + "=3)"
                    + feature_cond_install);
            }

            if (dir.ideExecutables)
                MakeVcIntegrationPath(bin, "VCCOMPONENTSFILEEXECDIR", dir.dstPath, featureNode, prop_key, feature_option);

            if (dir.ideHeaderFiles)
                MakeVcIntegrationPath(bin, "VCCOMPONENTSFILEHEADERDIR", dir.dstPath, featureNode, prop_key, feature_option);

            if (dir.ideLibrary)
                MakeVcIntegrationPath(bin, "VCCOMPONENTSFILELIBDIR", dir.dstPath, featureNode, prop_key, feature_option);
        }