Esempio n. 1
0
        /// <summary>
        /// Startet den Updatevorgang.
        /// </summary>
        public void runUpdate()
        {
            foreach (updatePackage currentPackage in m_config.Result)
            {
                //Füge eine Action zum validieren der Signatur hinzu
                applyUpdateBase validationAction = new applyValidatePackageSignature(new validatePackageAction(), currentConfig,
                                                                                     currentPackage);
                validationAction.actionFinished  += action_actionFinished;
                validationAction.progressChanged += action_progressChanged;
                validationAction.ownerForm        = m_ownerForm;
                m_updateActions.Add(validationAction);

                //Updateaktionen hinzufügen
                foreach (string id in currentPackage.actionOrder)
                {
                    applyUpdateBase action = getActionById(id, currentPackage);

                    if (action == null)
                    {
                        continue;
                    }

                    action.ownerForm             = m_ownerForm;
                    action.actionFinished       += action_actionFinished;
                    action.progressChanged      += action_progressChanged;
                    action.interfaceInteraction += action_interfaceInteraction;
                    m_updateActions.Add(action);
                }
            }

            //Registryversion aktualisieren
            if (!string.IsNullOrEmpty(currentConfig.ServerConfiguration.setupId))
            {
                string latestVersion =
                    currentConfig.ServerConfiguration.updatePackages[currentConfig.ServerConfiguration.updatePackages.Count - 1].
                    releaseInfo.Version;
                applyUpdateBase updateReg = new applyUpdateRegistryAction(new updateRegistryAction {
                    newVersion = latestVersion
                },
                                                                          currentConfig);
                updateReg.actionFinished  += action_actionFinished;
                updateReg.progressChanged += action_progressChanged;
                m_updateActions.Add(updateReg);
            }

            //Cleanupaction zum löschen der Updatedateien hinzufügen
            applyUpdateBase cleanup = new applyCleanupAction(new cleanupAction(), currentConfig);

            cleanup.actionFinished  += action_actionFinished;
            cleanup.progressChanged += action_progressChanged;
            m_updateActions.Add(cleanup);

            //Erste Aktion ausführen
            m_updateActions[applyUpdateActionCount].runAction();
        }
		/// <summary>
		/// Startet den Updatevorgang.
		/// </summary>
		public void runUpdate() {
			foreach (updatePackage currentPackage in m_config.Result) {
				//Füge eine Action zum validieren der Signatur hinzu
				applyUpdateBase validationAction = new applyValidatePackageSignature(new validatePackageAction(), currentConfig,
				                                                                     currentPackage);
				validationAction.actionFinished += action_actionFinished;
				validationAction.progressChanged += action_progressChanged;
				validationAction.ownerForm = m_ownerForm;
				m_updateActions.Add(validationAction);

				//Updateaktionen hinzufügen
				foreach (string id in currentPackage.actionOrder) {
					applyUpdateBase action = getActionById(id, currentPackage);

					if (action == null) {
						continue;
					}

					action.ownerForm = m_ownerForm;
					action.actionFinished += action_actionFinished;
					action.progressChanged += action_progressChanged;
					action.interfaceInteraction += action_interfaceInteraction;
					m_updateActions.Add(action);
				}
			}

			//Registryversion aktualisieren
			if (!string.IsNullOrEmpty(currentConfig.ServerConfiguration.setupId)) {
				string latestVersion =
					currentConfig.ServerConfiguration.updatePackages[currentConfig.ServerConfiguration.updatePackages.Count - 1].
						releaseInfo.Version;
				applyUpdateBase updateReg = new applyUpdateRegistryAction(new updateRegistryAction {newVersion = latestVersion},
				                                                          currentConfig);
				updateReg.actionFinished += action_actionFinished;
				updateReg.progressChanged += action_progressChanged;
				m_updateActions.Add(updateReg);
			}

			//Cleanupaction zum löschen der Updatedateien hinzufügen
			applyUpdateBase cleanup = new applyCleanupAction(new cleanupAction(), currentConfig);
			cleanup.actionFinished += action_actionFinished;
			cleanup.progressChanged += action_progressChanged;
			m_updateActions.Add(cleanup);

			//Erste Aktion ausführen
			m_updateActions[applyUpdateActionCount].runAction();
		}