public void Install(Version assemblyVersion)
{
using (SqlConnection connection = new SqlConnection(this.connectionString))
{
connection.Open();
using (SqlTransaction transaction = connection.BeginTransaction())
{
try
{
string[] scripts = ListInstallationScripts(this.GetCurrentInstallationVersion(), VersionInfo.FrameworkVersion);
foreach (string scriptName in scripts)
{
ScriptHelper.ExecuteScript(scriptName, transaction, _dbUser);
}
ScriptHelper.ExecuteScript("StoredProcedures.sql", transaction, _dbUser);
UpdateInstallationVersionNumber(assemblyVersion, transaction);
transaction.Commit();
}
catch (Exception)
{
transaction.Rollback();
throw;
}
}
}
}