/// <summary>Fügt einen neuen Eintrag der Softwareauflistung in der Systemsteuerung hinzu.</summary>
		/// <param name="product">Die von IProduct abgeleitete Klasse welche Informationen über das Produkt bereithält.</param>
		/// <returns>Gibt True zurück wenn der Eintrag erfolgreich erzeugt wurde, andernfalls False.</returns>
		public static bool Add(setupContext context) {
			RegistryKey softwareRoot = Registry.LocalMachine.OpenSubKey(_uninstallRoot, true);
			RegistryKey productRoot = softwareRoot.OpenSubKey(context.Product.applicationID, true);

			if (productRoot == null) //Hive existiert noch nicht
				productRoot = softwareRoot.CreateSubKey(context.Product.applicationID);

			//Produktinformationen setzen
			productRoot.SetValue("DisplayVersion", context.Product.newVersion.ToString());
			productRoot.SetValue("DisplayName", context.Product.Product);
			productRoot.SetValue("DisplayIcon", Path.Combine(context.installationDirectory, context.Product.mainExecutable));
			productRoot.SetValue("Contact", context.Product.Contact);
			productRoot.SetValue("Comments", "");
			productRoot.SetValue("Publisher", context.Product.Publisher);
			productRoot.SetValue("HelpLink", context.Product.supportUrl);
			productRoot.SetValue("InstallDate", DateTime.Now.ToString("yyyyMMdd"));
			productRoot.SetValue("InstallDirectory", context.installationDirectory);

			//Install/Uninstallflags setzen
			productRoot.SetValue("NoModify", 1, RegistryValueKind.DWord);
			productRoot.SetValue("NoRepair", 1, RegistryValueKind.DWord);
			productRoot.SetValue("WindowsInstaller", 0, RegistryValueKind.DWord);
			productRoot.SetValue("UninstallString",
			                     string.Format("{0} /uninstall",
			                                   Path.Combine(context.installationDirectory, context.Product.setupName)));

			return true;
		}
        /// <summary>Fügt einen neuen Eintrag der Softwareauflistung in der Systemsteuerung hinzu.</summary>
        /// <param name="product">Die von IProduct abgeleitete Klasse welche Informationen über das Produkt bereithält.</param>
        /// <returns>Gibt True zurück wenn der Eintrag erfolgreich erzeugt wurde, andernfalls False.</returns>
        public static bool Add(setupContext context)
        {
            RegistryKey softwareRoot = Registry.LocalMachine.OpenSubKey(_uninstallRoot, true);
            RegistryKey productRoot  = softwareRoot.OpenSubKey(context.Product.applicationID, true);

            if (productRoot == null)             //Hive existiert noch nicht
            {
                productRoot = softwareRoot.CreateSubKey(context.Product.applicationID);
            }

            //Produktinformationen setzen
            productRoot.SetValue("DisplayVersion", context.Product.newVersion.ToString());
            productRoot.SetValue("DisplayName", context.Product.Product);
            productRoot.SetValue("DisplayIcon", Path.Combine(context.installationDirectory, context.Product.mainExecutable));
            productRoot.SetValue("Contact", context.Product.Contact);
            productRoot.SetValue("Comments", "");
            productRoot.SetValue("Publisher", context.Product.Publisher);
            productRoot.SetValue("HelpLink", context.Product.supportUrl);
            productRoot.SetValue("InstallDate", DateTime.Now.ToString("yyyyMMdd"));
            productRoot.SetValue("InstallDirectory", context.installationDirectory);

            //Install/Uninstallflags setzen
            productRoot.SetValue("NoModify", 1, RegistryValueKind.DWord);
            productRoot.SetValue("NoRepair", 1, RegistryValueKind.DWord);
            productRoot.SetValue("WindowsInstaller", 0, RegistryValueKind.DWord);
            productRoot.SetValue("UninstallString",
                                 string.Format("{0} /uninstall",
                                               Path.Combine(context.installationDirectory, context.Product.setupName)));

            return(true);
        }
Пример #3
0
		public setupPackage(setupContext currentContext) {
			_context = currentContext;
		}
Пример #4
0
		private bool initializeSetup() {

			//BETA RTM SWITCH
			_context = new setupContext {
			                            	Product = new productBeta()
			                            };

			//Setupseiten initialisieren
			_setupPages = new Dictionary<Type, ISetupPage> {
			                                               	{typeof (stpBeta), new stpBeta()},
			                                               	{typeof (stpLicense), new stpLicense()},
			                                               	{typeof (stpDonate), new stpDonate()},
			                                               	{typeof (stpOptions), new stpOptions()},
			                                               	{typeof (stpInstall), new stpInstall()},
			                                               	{typeof (stpInterrupted), new stpInterrupted()},
			                                               	{typeof (stpInstalled), new stpInstalled()},
			                                               	{typeof (stpWelcomeUninstall), new stpWelcomeUninstall()},
			                                               	{typeof (stpUninstall), new stpUninstall()},
			                                               	{typeof (stpUninstalled), new stpUninstalled()},
			                                               	{typeof (stpUpgrade), new stpUpgrade()}
			                                               };

			_context.isUpgrade = (ProgramsAndFeaturesHelper.isInstalled(_context.Product) &&
			                      ProgramsAndFeaturesHelper.getCurrentVersion(_context.Product) <
			                      Assembly.GetExecutingAssembly().GetName().Version);

			if (ProgramsAndFeaturesHelper.isInstalled(_context.Product) &&
				ProgramsAndFeaturesHelper.getCurrentVersion(_context.Product) == Assembly.GetExecutingAssembly().GetName().Version &&
				!_arguments.Contains("/uninstall"))
				if (MessageBox.Show(string.Format("Es ist bereits eine identische Version von {0} installiert.\r\nMöchten Sie das Setup trotzdem starten?", _context.Product.Product), _context.Product.Product, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No)
					return false;

			return true;
		}
Пример #5
0
 public setupPackage(setupContext currentContext)
 {
     _context = currentContext;
 }