Ejemplo n.º 1
0
        private static void Project_AfterInstall(SetupEventArgs e)
        {
            if (e.IsUpgrading)
            {
                return;
            }

            if (e.IsUninstalling)
            {
                return;
            }

            var connectionString = e.Data[Properties.ConnectionString.PropertyName];

            try
            {
                _sqlManager.CreateDatabase(connectionString);
                var processToStart = Path.Combine(e.InstallDir, "migrate.exe");
                _sqlManager.ApplyMigrations(processToStart);
            }
            catch (Exception ex)
            {
                e.Session.Log(ex.ToString());
                NotificationManager.ShowErrorMessage(ex.Message,
                                                     isWizardInstallation: IsWizardInstallationMode(e.Data));

                e.Result = ActionResult.Failure;
                return;
            }
        }