Installer: old to new update #4

This commit is contained in:
McMak 2015-05-20 16:19:56 +03:00
parent 8219bc32c9
commit b2bb23ea13
7 changed files with 106 additions and 21 deletions

View file

@ -565,6 +565,16 @@
<Property Id="COMPFOUND_PORTAL" Secure="yes" Value="0" /> <Property Id="COMPFOUND_PORTAL" Secure="yes" Value="0" />
<Property Id="COMPFOUND_WDPORTAL" Secure="yes" Value="1" /> <Property Id="COMPFOUND_WDPORTAL" Secure="yes" Value="1" />
<Property Id="COMPFOUND_SCHEDULER" Secure="yes" Value="1" /> <Property Id="COMPFOUND_SCHEDULER" Secure="yes" Value="1" />
<Property Id="COMPFOUND_SERVER_ID" Secure="yes" />
<Property Id="COMPFOUND_ESERVER_ID" Secure="yes" />
<Property Id="COMPFOUND_PORTAL_ID" Secure="yes" />
<Property Id="COMPFOUND_WDPORTAL_ID" Secure="yes" />
<Property Id="COMPFOUND_SCHEDULER_ID" Secure="yes" />
<Property Id="COMPFOUND_SERVER_MAIN_CFG" Secure="yes" />
<Property Id="COMPFOUND_ESERVER_MAIN_CFG" Secure="yes" />
<Property Id="COMPFOUND_PORTAL_MAIN_CFG" Secure="yes" />
<Property Id="COMPFOUND_WDPORTAL_MAIN_CFG" Secure="yes" />
<Property Id="COMPFOUND_SCHEDULER_MAIN_CFG" Secure="yes" />
<!--CustomActions.--> <!--CustomActions.-->
<CustomAction Id="CA_CheckConnectionUI" BinaryKey="Assembly_CA" DllEntry="CheckConnectionUI" /> <CustomAction Id="CA_CheckConnectionUI" BinaryKey="Assembly_CA" DllEntry="CheckConnectionUI" />
<CustomAction Id="CA_PropertyFinalizeInstall" Property="CA_FinalizeInstall" Value="" Return="check"/> <CustomAction Id="CA_PropertyFinalizeInstall" Property="CA_FinalizeInstall" Value="" Return="check"/>
@ -593,23 +603,23 @@
<CustomAction Id="CA_InstallWebFeatures" BinaryKey="Assembly_CA" DllEntry="InstallWebFeatures" Impersonate="no" /> <CustomAction Id="CA_InstallWebFeatures" BinaryKey="Assembly_CA" DllEntry="InstallWebFeatures" Impersonate="no" />
<!--Run corresponding install scripts.--> <!--Run corresponding install scripts.-->
<!-- Prepare and backup when upgrading from old to new installer type. <!-- Prepare and backup when upgrading from old to new installer type.
Yes, session variables and custom action data are identical for corresponding WebsitePanel components in prepare and install scripts. Yes, session variables and custom action data are identical almost for corresponding WebsitePanel components in prepare and install scripts.
Prepare scripts must be run before normal installation process and file copying.--> Prepare scripts must be run before normal installation process and file copying.-->
<CustomAction Id="CA_PropertyOnServerPrepare" Property="CA_OnServerPrepare" Value ="ApplicationName=$(var.NAME);ComponentName=$(var.ServerTitle);ComponentCode=server;ComponentDescription=$(var.ServerDescription);Version=$(var.VERSION);InstallationFolder=[PI_SERVER_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_SERVER_IP];WebSitePort=[PI_SERVER_PORT];WebSiteDomain=[PI_SERVER_HOST];UserDomain=[PI_SERVER_DOMAIN];UserAccount=[PI_SERVER_LOGIN];UserPassword=[PI_SERVER_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" /> <CustomAction Id="CA_PropertyOnServerPrepare" Property="CA_OnServerPrepare" Value ="ApplicationName=$(var.NAME);ComponentName=$(var.ServerTitle);ComponentCode=server;ComponentDescription=$(var.ServerDescription);Version=$(var.VERSION);InstallationFolder=[PI_SERVER_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_SERVER_IP];WebSitePort=[PI_SERVER_PORT];WebSiteDomain=[PI_SERVER_HOST];UserDomain=[PI_SERVER_DOMAIN];UserAccount=[PI_SERVER_LOGIN];UserPassword=[PI_SERVER_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE];ComponentId=[COMPFOUND_SERVER_ID];MainConfig=[COMPFOUND_SERVER_MAIN_CFG]" />
<CustomAction Id="CA_OnServerPrepare" BinaryKey="Assembly_CA" DllEntry="OnServerPrepare" Impersonate="no" Execute="deferred" HideTarget="no" /> <CustomAction Id="CA_OnServerPrepare" BinaryKey="Assembly_CA" DllEntry="OnServerPrepare" Impersonate="no" Execute="deferred" HideTarget="no" />
<CustomAction Id="CA_PropertyOnEServerPrepare" Property="CA_OnEServerPrepare" Value ="ApplicationName=$(var.NAME);ComponentName=$(var.EServerTitle);ComponentCode=enterprise server;ComponentDescription=$(var.EServerDescription);Version=$(var.VERSION);InstallationFolder=[PI_ESERVER_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_ESERVER_IP];WebSitePort=[PI_ESERVER_PORT];WebSiteDomain=[PI_ESERVER_HOST];UserDomain=[PI_ESERVER_DOMAIN];UserAccount=[PI_ESERVER_LOGIN];UserPassword=[PI_ESERVER_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" /> <CustomAction Id="CA_PropertyOnEServerPrepare" Property="CA_OnEServerPrepare" Value ="ApplicationName=$(var.NAME);ComponentName=$(var.EServerTitle);ComponentCode=enterprise server;ComponentDescription=$(var.EServerDescription);Version=$(var.VERSION);InstallationFolder=[PI_ESERVER_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_ESERVER_IP];WebSitePort=[PI_ESERVER_PORT];WebSiteDomain=[PI_ESERVER_HOST];UserDomain=[PI_ESERVER_DOMAIN];UserAccount=[PI_ESERVER_LOGIN];UserPassword=[PI_ESERVER_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE];ComponentId=[COMPFOUND_ESERVER_ID];MainConfig=[COMPFOUND_ESERVER_MAIN_CFG]" />
<CustomAction Id="CA_OnEServerPrepare" BinaryKey="Assembly_CA" DllEntry="OnEServerPrepare" Impersonate="no" Execute="deferred" HideTarget="no" /> <CustomAction Id="CA_OnEServerPrepare" BinaryKey="Assembly_CA" DllEntry="OnEServerPrepare" Impersonate="no" Execute="deferred" HideTarget="no" />
<CustomAction Id="CA_PropertyOnPortalPrepare" Property="CA_OnPortalPrepare" Value ="ApplicationName=$(var.NAME);ComponentName=$(var.PortalTitle);ComponentCode=portal;ComponentDescription=$(var.PortalDescription);Version=$(var.VERSION);InstallationFolder=[PI_PORTAL_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_PORTAL_IP];WebSitePort=[PI_PORTAL_PORT];WebSiteDomain=[PI_PORTAL_HOST];UserDomain=[PI_PORTAL_DOMAIN];UserAccount=[PI_PORTAL_LOGIN];UserPassword=[PI_PORTAL_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" /> <CustomAction Id="CA_PropertyOnPortalPrepare" Property="CA_OnPortalPrepare" Value ="ApplicationName=$(var.NAME);ComponentName=$(var.PortalTitle);ComponentCode=portal;ComponentDescription=$(var.PortalDescription);Version=$(var.VERSION);InstallationFolder=[PI_PORTAL_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_PORTAL_IP];WebSitePort=[PI_PORTAL_PORT];WebSiteDomain=[PI_PORTAL_HOST];UserDomain=[PI_PORTAL_DOMAIN];UserAccount=[PI_PORTAL_LOGIN];UserPassword=[PI_PORTAL_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE];ComponentId=[COMPFOUND_PORTAL_ID];MainConfig=[COMPFOUND_PORTAL_MAIN_CFG]" />
<CustomAction Id="CA_OnPortalPrepare" BinaryKey="Assembly_CA" DllEntry="OnPortalPrepare" Impersonate="no" Execute="deferred" HideTarget="no" /> <CustomAction Id="CA_OnPortalPrepare" BinaryKey="Assembly_CA" DllEntry="OnPortalPrepare" Impersonate="no" Execute="deferred" HideTarget="no" />
<!--Install scripts.--> <!--Install scripts.-->
<!--Server.--> <!--Server.-->
<CustomAction Id="CA_PropertyOnServerInstall" Property="CA_OnServerInstall" Value="ApplicationName=$(var.NAME);ComponentName=$(var.ServerTitle);ComponentCode=server;ComponentDescription=$(var.ServerDescription);Version=$(var.VERSION);InstallationFolder=[PI_SERVER_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_SERVER_IP];WebSitePort=[PI_SERVER_PORT];WebSiteDomain=[PI_SERVER_HOST];UserDomain=[PI_SERVER_DOMAIN];UserAccount=[PI_SERVER_LOGIN];UserPassword=[PI_SERVER_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" /> <CustomAction Id="CA_PropertyOnServerInstall" Property="CA_OnServerInstall" Value="ApplicationName=$(var.NAME);ComponentName=$(var.ServerTitle);ComponentCode=server;ComponentDescription=$(var.ServerDescription);Version=$(var.VERSION);InstallationFolder=[PI_SERVER_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_SERVER_IP];WebSitePort=[PI_SERVER_PORT];WebSiteDomain=[PI_SERVER_HOST];UserDomain=[PI_SERVER_DOMAIN];UserAccount=[PI_SERVER_LOGIN];UserPassword=[PI_SERVER_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE];ComponentId=[COMPFOUND_SERVER_ID]" />
<CustomAction Id="CA_OnServerInstall" BinaryKey ="Assembly_CA" DllEntry="OnServerInstall" Impersonate="no" Execute="deferred" HideTarget="no"/> <CustomAction Id="CA_OnServerInstall" BinaryKey ="Assembly_CA" DllEntry="OnServerInstall" Impersonate="no" Execute="deferred" HideTarget="no"/>
<!--EServer.--> <!--EServer.-->
<CustomAction Id="CA_PropertyOnEServerInstall" Property="CA_OnEServerInstall" Value="ApplicationName=$(var.NAME);ComponentName=$(var.EServerTitle);ComponentCode=enterprise server;ComponentDescription=$(var.EServerDescription);Version=$(var.VERSION);InstallationFolder=[PI_ESERVER_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_ESERVER_IP];WebSitePort=[PI_ESERVER_PORT];WebSiteDomain=[PI_ESERVER_HOST];UserDomain=[PI_ESERVER_DOMAIN];UserAccount=[PI_ESERVER_LOGIN];UserPassword=[PI_ESERVER_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" /> <CustomAction Id="CA_PropertyOnEServerInstall" Property="CA_OnEServerInstall" Value="ApplicationName=$(var.NAME);ComponentName=$(var.EServerTitle);ComponentCode=enterprise server;ComponentDescription=$(var.EServerDescription);Version=$(var.VERSION);InstallationFolder=[PI_ESERVER_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_ESERVER_IP];WebSitePort=[PI_ESERVER_PORT];WebSiteDomain=[PI_ESERVER_HOST];UserDomain=[PI_ESERVER_DOMAIN];UserAccount=[PI_ESERVER_LOGIN];UserPassword=[PI_ESERVER_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE];ComponentId=[COMPFOUND_ESERVER_ID]" />
<CustomAction Id="CA_OnEServerInstall" BinaryKey ="Assembly_CA" DllEntry="OnEServerInstall" Impersonate="no" Execute="deferred" HideTarget="no"/> <CustomAction Id="CA_OnEServerInstall" BinaryKey ="Assembly_CA" DllEntry="OnEServerInstall" Impersonate="no" Execute="deferred" HideTarget="no"/>
<!--Portal.--> <!--Portal.-->
<CustomAction Id="CA_PropertyOnPortalInstall" Property="CA_OnPortalInstall" Value="ApplicationName=$(var.NAME);ComponentName=$(var.PortalTitle);ComponentCode=portal;ComponentDescription=$(var.PortalDescription);Version=$(var.VERSION);InstallationFolder=[PI_PORTAL_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_PORTAL_IP];WebSitePort=[PI_PORTAL_PORT];WebSiteDomain=[PI_PORTAL_HOST];UserDomain=[PI_PORTAL_DOMAIN];UserAccount=[PI_PORTAL_LOGIN];UserPassword=[PI_PORTAL_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" /> <CustomAction Id="CA_PropertyOnPortalInstall" Property="CA_OnPortalInstall" Value="ApplicationName=$(var.NAME);ComponentName=$(var.PortalTitle);ComponentCode=portal;ComponentDescription=$(var.PortalDescription);Version=$(var.VERSION);InstallationFolder=[PI_PORTAL_INSTALL_DIR];InstallerFolder=[WSP_INSTALL_DIR];Installer=Microsoft Windows Installer;InstallerType=MSI;InstallerPath=[OriginalDatabase];IISVersion=[];SetupXml=[];WebSiteIP=[PI_PORTAL_IP];WebSitePort=[PI_PORTAL_PORT];WebSiteDomain=[PI_PORTAL_HOST];UserDomain=[PI_PORTAL_DOMAIN];UserAccount=[PI_PORTAL_LOGIN];UserPassword=[PI_PORTAL_PASSWORD];ServerPassword=[SERVER_ACCESS_PASSWORD];EnterpriseServerUrl=[PI_ESERVER_URL];ServerAdminPassword=[SERVERADMIN_PASSWORD];DatabaseServer=[DB_SERVER];DatabaseName=[DB_DATABASE];DbServerAdmin=[DB_LOGIN];DbServerAdminPassword=[DB_PASSWORD];BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE];ComponentId=[COMPFOUND_PORTAL_ID]" />
<CustomAction Id="CA_OnPortalInstall" BinaryKey ="Assembly_CA" DllEntry="OnPortalInstall" Impersonate="no" Execute="deferred" HideTarget="no"/> <CustomAction Id="CA_OnPortalInstall" BinaryKey ="Assembly_CA" DllEntry="OnPortalInstall" Impersonate="no" Execute="deferred" HideTarget="no"/>
<!--Run corresponding uninstall scripts.--> <!--Run corresponding uninstall scripts.-->
<CustomAction Id="CA_PropertyOnServerRemove" Property="CA_OnServerRemove" Value="InstallerFolder=[WSP_INSTALL_DIR];ComponentCode=server;BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" /> <CustomAction Id="CA_PropertyOnServerRemove" Property="CA_OnServerRemove" Value="InstallerFolder=[WSP_INSTALL_DIR];ComponentCode=server;BaseDirectory=[WSP_INSTALL_DIR];MODE_UP=[WIX_UPGRADE_DETECTED];MODE_RUP=[UPGRADINGPRODUCTCODE]" />

View file

@ -63,6 +63,9 @@ namespace WebsitePanel.Setup.Actions
void IInstallAction.Run(SetupVariables vars) void IInstallAction.Run(SetupVariables vars)
{ {
if (vars.ComponentExists)
return;
try try
{ {
OnInstallProgressChanged(LogStartInstallMessage, 0); OnInstallProgressChanged(LogStartInstallMessage, 0);
@ -232,6 +235,9 @@ namespace WebsitePanel.Setup.Actions
{ {
void IInstallAction.Run(SetupVariables vars) void IInstallAction.Run(SetupVariables vars)
{ {
if (vars.ComponentExists)
return;
try try
{ {
// //
@ -330,6 +336,9 @@ namespace WebsitePanel.Setup.Actions
void IInstallAction.Run(SetupVariables vars) void IInstallAction.Run(SetupVariables vars)
{ {
if (vars.ComponentExists)
return;
try try
{ {
Log.WriteStart("Updating serveradmin password"); Log.WriteStart("Updating serveradmin password");
@ -389,6 +398,9 @@ namespace WebsitePanel.Setup.Actions
{ {
void IInstallAction.Run(SetupVariables vars) void IInstallAction.Run(SetupVariables vars)
{ {
if (vars.ComponentExists)
return;
Log.WriteStart("Updating web.config file (connection string)"); Log.WriteStart("Updating web.config file (connection string)");
var file = Path.Combine(vars.InstallationFolder, vars.ConfigurationFile); var file = Path.Combine(vars.InstallationFolder, vars.ConfigurationFile);
vars.ConnectionString = String.Format(vars.ConnectionString, vars.DatabaseServer, vars.Database, vars.Database, vars.DatabaseUserPassword); vars.ConnectionString = String.Format(vars.ConnectionString, vars.DatabaseServer, vars.Database, vars.Database, vars.DatabaseUserPassword);

View file

@ -151,6 +151,8 @@ namespace WebsitePanel.Setup.Actions
void IInstallAction.Run(SetupVariables vars) void IInstallAction.Run(SetupVariables vars)
{ {
if (vars.ComponentExists)
return;
// Exit with an error if Windows account with the same name already exists // Exit with an error if Windows account with the same name already exists
if (SecurityUtils.UserExists(vars.UserDomain, vars.UserAccount)) if (SecurityUtils.UserExists(vars.UserDomain, vars.UserAccount))
throw new Exception(UserAccountExists); throw new Exception(UserAccountExists);
@ -394,7 +396,7 @@ namespace WebsitePanel.Setup.Actions
} }
// This flag is the opposite of poolExists flag // This flag is the opposite of poolExists flag
vars.NewWebApplicationPool = !poolExists; vars.NewWebApplicationPool = !poolExists || vars.ComponentExists;
if (poolExists) if (poolExists)
{ {
@ -501,6 +503,9 @@ namespace WebsitePanel.Setup.Actions
void IInstallAction.Run(SetupVariables vars) void IInstallAction.Run(SetupVariables vars)
{ {
if (vars.ComponentExists)
return;
var siteName = vars.ComponentFullName; var siteName = vars.ComponentFullName;
var ip = vars.WebSiteIP; var ip = vars.WebSiteIP;
var port = vars.WebSitePort; var port = vars.WebSitePort;
@ -774,6 +779,9 @@ namespace WebsitePanel.Setup.Actions
void IInstallAction.Run(SetupVariables vars) void IInstallAction.Run(SetupVariables vars)
{ {
if (vars.ComponentExists)
return;
try try
{ {
Begin(LogStartInstallMessage); Begin(LogStartInstallMessage);

View file

@ -335,10 +335,10 @@ namespace WebsitePanel.Setup
return files; return files;
} }
public static void CopyFileToFolder(string sourceFile, string destinationFolder) public static void CopyFileToFolder(string sourceFile, string destinationFolder, string destinationFileName = "")
{ {
string fileName = Path.GetFileName(sourceFile); string fileName = Path.GetFileName(sourceFile);
string destinationFile = Path.Combine(destinationFolder, fileName); string destinationFile = Path.Combine(destinationFolder, string.IsNullOrWhiteSpace(destinationFileName) ? fileName : destinationFileName);
CopyFile(new FileInfo(sourceFile), destinationFile); CopyFile(new FileInfo(sourceFile), destinationFile);
} }

View file

@ -249,6 +249,11 @@ namespace WebsitePanel.Setup
public string BaseDirectory { get; set; } public string BaseDirectory { get; set; }
public string SpecialBaseDirectory { get; set; }
public IDictionary<string, string> FileNameMap { get; set; }
public bool ComponentExists { get; set; }
public string UpdateVersion { get; set; } public string UpdateVersion { get; set; }
public string EnterpriseServerURL { get; set; } public string EnterpriseServerURL { get; set; }

View file

@ -163,6 +163,8 @@ namespace WebsitePanel.Setup.Internal
Utils.GetStringSetupParameter(Hash, Global.Parameters.DbServerAdminPassword)); Utils.GetStringSetupParameter(Hash, Global.Parameters.DbServerAdminPassword));
Dst.BaseDirectory = Utils.GetStringSetupParameter(Hash, Global.Parameters.BaseDirectory); Dst.BaseDirectory = Utils.GetStringSetupParameter(Hash, Global.Parameters.BaseDirectory);
Dst.ComponentId = Utils.GetStringSetupParameter(Hash, Global.Parameters.ComponentId);
Dst.ComponentExists = string.IsNullOrWhiteSpace(Dst.ComponentId) ? false : true;
} }
public static string GetFullConfigPath(SetupVariables Ctx) public static string GetFullConfigPath(SetupVariables Ctx)
{ {
@ -2739,7 +2741,7 @@ namespace WebsitePanel.Setup.Internal
BackupDatabase(action.ConnectionString, action.Name); BackupDatabase(action.ConnectionString, action.Name);
break; break;
case ActionTypes.BackupConfig: case ActionTypes.BackupConfig:
BackupConfig(action.Path, destinationDirectory); BackupConfig(action.Path, destinationDirectory, action.SetupVariables != null ? action.SetupVariables.FileNameMap : null);
break; break;
} }
} }
@ -2755,7 +2757,7 @@ namespace WebsitePanel.Setup.Internal
} }
} }
private void BackupConfig(string path, string backupDirectory) private void BackupConfig(string path, string backupDirectory, IDictionary<string, string> NameMap = null)
{ {
try try
{ {
@ -2772,7 +2774,7 @@ namespace WebsitePanel.Setup.Internal
string[] files = Directory.GetFiles(path, "*.config", SearchOption.TopDirectoryOnly); string[] files = Directory.GetFiles(path, "*.config", SearchOption.TopDirectoryOnly);
foreach (string file in files) foreach (string file in files)
{ {
FileUtils.CopyFileToFolder(file, destination); FileUtils.CopyFileToFolder(file, destination, GetMappedFileName(file, NameMap));
} }
Log.WriteEnd("Backed up system configuration"); Log.WriteEnd("Backed up system configuration");
InstallLog.AppendLine("- Backed up system configuration"); InstallLog.AppendLine("- Backed up system configuration");
@ -2786,6 +2788,17 @@ namespace WebsitePanel.Setup.Internal
} }
} }
private string GetMappedFileName(string FullFileName, IDictionary<string, string> Map)
{
if (Map == null)
return "";
string Key = new FileInfo(FullFileName).Name;
if (Map.Keys.Contains(Key))
return Map[Key];
else
return "";
}
private void BackupDatabase(string connectionString, string database) private void BackupDatabase(string connectionString, string database)
{ {
try try
@ -2881,10 +2894,14 @@ namespace WebsitePanel.Setup.Internal
} }
//config //config
action = new InstallAction(ActionTypes.BackupConfig); action = new InstallAction(ActionTypes.BackupConfig);
action.Description = "Backing up configuration settings...";
action.Path = Context.BaseDirectory; action.Path = Context.BaseDirectory;
action.Description = "Backing up configuration settings...";
if (!string.IsNullOrWhiteSpace(Context.SpecialBaseDirectory) )
{
action.Path = Context.SpecialBaseDirectory;
action.SetupVariables = Context;
}
list.Add(action); list.Add(action);
return list; return list;
} }
private void UpdateWebSiteBindings() private void UpdateWebSiteBindings()
@ -4225,6 +4242,12 @@ namespace WebsitePanel.Setup.Internal
WiXThrow = true; WiXThrow = true;
}); });
sam.Start(); sam.Start();
if (Context.ComponentExists)
{
Context.UpdateVersion = Context.Release;
AppConfig.LoadComponentSettings(Context);
new RestoreScript(Context).Run();
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -4303,6 +4326,12 @@ namespace WebsitePanel.Setup.Internal
WiXThrow = true; WiXThrow = true;
}); });
sam.Start(); sam.Start();
if(Context.ComponentExists)
{
Context.UpdateVersion = Context.Release;
AppConfig.LoadComponentSettings(Context);
new RestoreScript(Context).Run();
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -4381,6 +4410,12 @@ namespace WebsitePanel.Setup.Internal
WiXThrow = true; WiXThrow = true;
}); });
sam.Start(); sam.Start();
if (Context.ComponentExists)
{
Context.UpdateVersion = Context.Release;
AppConfig.LoadComponentSettings(Context);
new RestoreScript(Context).Run();
}
} }
catch (Exception ex) catch (Exception ex)
{ {

View file

@ -159,7 +159,7 @@ namespace WebsitePanel.WIXInstaller
}; };
var Ctx = session; var Ctx = session;
Ctx.AttachToSetupLog(); Ctx.AttachToSetupLog();
PopUpDebugger(); PopUpDebugger();
@ -181,6 +181,9 @@ namespace WebsitePanel.WIXInstaller
{ {
AppConfig.LoadComponentSettings(CtxVars); AppConfig.LoadComponentSettings(CtxVars);
SetProperty(Ctx, "COMPFOUND_SERVER_ID", CtxVars.ComponentId);
SetProperty(Ctx, "COMPFOUND_SERVER_MAIN_CFG", CfgPath);
SetProperty(Ctx, "PI_SERVER_IP", CtxVars.WebSiteIP); SetProperty(Ctx, "PI_SERVER_IP", CtxVars.WebSiteIP);
SetProperty(Ctx, "PI_SERVER_PORT", CtxVars.WebSitePort); SetProperty(Ctx, "PI_SERVER_PORT", CtxVars.WebSitePort);
SetProperty(Ctx, "PI_SERVER_HOST", CtxVars.WebSiteDomain); SetProperty(Ctx, "PI_SERVER_HOST", CtxVars.WebSiteDomain);
@ -200,6 +203,9 @@ namespace WebsitePanel.WIXInstaller
{ {
AppConfig.LoadComponentSettings(CtxVars); AppConfig.LoadComponentSettings(CtxVars);
SetProperty(Ctx, "COMPFOUND_ESERVER_ID", CtxVars.ComponentId);
SetProperty(Ctx, "COMPFOUND_ESERVER_MAIN_CFG", CfgPath);
SetProperty(Ctx, "PI_ESERVER_IP", CtxVars.WebSiteIP); SetProperty(Ctx, "PI_ESERVER_IP", CtxVars.WebSiteIP);
SetProperty(Ctx, "PI_ESERVER_PORT", CtxVars.WebSitePort); SetProperty(Ctx, "PI_ESERVER_PORT", CtxVars.WebSitePort);
SetProperty(Ctx, "PI_ESERVER_HOST", CtxVars.WebSiteDomain); SetProperty(Ctx, "PI_ESERVER_HOST", CtxVars.WebSiteDomain);
@ -220,7 +226,7 @@ namespace WebsitePanel.WIXInstaller
SetProperty(Ctx, "DB_LOGIN", ConnStr.UserID); SetProperty(Ctx, "DB_LOGIN", ConnStr.UserID);
SetProperty(Ctx, "DB_PASSWORD", ConnStr.Password); SetProperty(Ctx, "DB_PASSWORD", ConnStr.Password);
} }
var HaveAccount = SecurityUtils.UserExists(CtxVars.UserDomain, CtxVars.UserAccount); var HaveAccount = SecurityUtils.UserExists(CtxVars.UserDomain, CtxVars.UserAccount);
bool HavePool = Tool.AppPoolExists(CtxVars.ApplicationPool); bool HavePool = Tool.AppPoolExists(CtxVars.ApplicationPool);
@ -231,6 +237,9 @@ namespace WebsitePanel.WIXInstaller
{ {
AppConfig.LoadComponentSettings(CtxVars); AppConfig.LoadComponentSettings(CtxVars);
SetProperty(Ctx, "COMPFOUND_PORTAL_ID", CtxVars.ComponentId);
SetProperty(Ctx, "COMPFOUND_PORTAL_MAIN_CFG", CfgPath);
SetProperty(Ctx, "PI_PORTAL_IP", CtxVars.WebSiteIP); SetProperty(Ctx, "PI_PORTAL_IP", CtxVars.WebSiteIP);
SetProperty(Ctx, "PI_PORTAL_PORT", CtxVars.WebSitePort); SetProperty(Ctx, "PI_PORTAL_PORT", CtxVars.WebSitePort);
SetProperty(Ctx, "PI_PORTAL_HOST", CtxVars.WebSiteDomain); SetProperty(Ctx, "PI_PORTAL_HOST", CtxVars.WebSiteDomain);
@ -242,7 +251,7 @@ namespace WebsitePanel.WIXInstaller
SetProperty(Ctx, "PI_PORTAL_INSTALL_DIR", CtxVars.InstallFolder); SetProperty(Ctx, "PI_PORTAL_INSTALL_DIR", CtxVars.InstallFolder);
SetProperty(Ctx, "WSP_INSTALL_DIR", Directory.GetParent(CtxVars.InstallFolder).FullName); SetProperty(Ctx, "WSP_INSTALL_DIR", Directory.GetParent(CtxVars.InstallFolder).FullName);
var HaveAccount = SecurityUtils.UserExists(CtxVars.UserDomain, CtxVars.UserAccount); var HaveAccount = SecurityUtils.UserExists(CtxVars.UserDomain, CtxVars.UserAccount);
bool HavePool = Tool.AppPoolExists(CtxVars.ApplicationPool); bool HavePool = Tool.AppPoolExists(CtxVars.ApplicationPool);
@ -496,7 +505,7 @@ namespace WebsitePanel.WIXInstaller
GetConnectionString(session["DB_SERVER"], "master", session["DB_LOGIN"], session["DB_PASSWORD"]); GetConnectionString(session["DB_SERVER"], "master", session["DB_LOGIN"], session["DB_PASSWORD"]);
string msg; string msg;
bool Result = CheckConnection(ConnStr, out msg); bool Result = CheckConnection(ConnStr, out msg);
session["DB_CONN_CORRECT"] = Result ? YesNo.Yes: YesNo.No; session["DB_CONN_CORRECT"] = Result ? YesNo.Yes : YesNo.No;
session["DB_CONN"] = Result ? ConnStr : ""; session["DB_CONN"] = Result ? ConnStr : "";
session["DB_CONN_MSG"] = msg; session["DB_CONN_MSG"] = msg;
return ActionResult.Success; return ActionResult.Success;
@ -799,7 +808,7 @@ namespace WebsitePanel.WIXInstaller
private static string GetProperty(Session Ctx, string Property) private static string GetProperty(Session Ctx, string Property)
{ {
if (Ctx.CustomActionData.ContainsKey(Property)) if (Ctx.CustomActionData.ContainsKey(Property))
return Ctx[Property]; return Ctx.CustomActionData[Property];
else else
return string.Empty; return string.Empty;
} }
@ -816,11 +825,17 @@ namespace WebsitePanel.WIXInstaller
{ {
var CtxVars = new SetupVariables(); var CtxVars = new SetupVariables();
WiXSetup.FillFromSession(Ctx.CustomActionData, CtxVars); WiXSetup.FillFromSession(Ctx.CustomActionData, CtxVars);
AppConfig.LoadConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = GetProperty(Ctx, "MainConfig") });
CtxVars.IISVersion = Tool.GetWebServerVersion(); CtxVars.IISVersion = Tool.GetWebServerVersion();
CtxVars.ComponentId = GetProperty(Ctx, "ComponentId");
CtxVars.Version = AppConfig.GetComponentSettingStringValue(CtxVars.ComponentId, Global.Parameters.Release);
CtxVars.SpecialBaseDirectory = Directory.GetParent(GetProperty(Ctx, "MainConfig")).FullName;
CtxVars.FileNameMap = new Dictionary<string, string>();
CtxVars.FileNameMap.Add(new FileInfo(GetProperty(Ctx, "MainConfig")).Name, BackupRestore.MainConfig);
SetupScript Result = new ExpressScript(CtxVars); SetupScript Result = new ExpressScript(CtxVars);
Result.Actions.Add(new InstallAction(ActionTypes.StopApplicationPool) { SetupVariables = CtxVars }); Result.Actions.Add(new InstallAction(ActionTypes.StopApplicationPool) { SetupVariables = CtxVars });
Result.Actions.Add(new InstallAction(ActionTypes.Backup) { SetupVariables = CtxVars }); Result.Actions.Add(new InstallAction(ActionTypes.Backup) { SetupVariables = CtxVars });
Result.Actions.Add(new InstallAction(ActionTypes.DeleteDirectory) { SetupVariables = CtxVars }); Result.Actions.Add(new InstallAction(ActionTypes.DeleteDirectory) { SetupVariables = CtxVars, Path = CtxVars.InstallFolder });
return Result; return Result;
} }
} }