WiX installer fixes.

This commit is contained in:
McMak 2015-05-25 19:43:56 +03:00
parent 276a106dc9
commit 6ec738ae6e
10 changed files with 247 additions and 58096 deletions

View file

@ -777,28 +777,19 @@ namespace WebsitePanel.Setup.Actions
try
{
Begin(LogStartInstallMessage);
//
Log.WriteStart("Updating configuration file (server password)");
Log.WriteInfo(String.Format("Server password is: '{0}'", vars.ServerPassword));
Log.WriteInfo("Single quotes are added for clarity purposes");
//
string file = Path.Combine(vars.InstallationFolder, vars.ConfigurationFile);
string hash = Utils.ComputeSHA1(vars.ServerPassword);
// load file
string content = string.Empty;
using (StreamReader reader = new StreamReader(file))
{
content = reader.ReadToEnd();
}
// expand variables
content = Utils.ReplaceScriptVariable(content, "installer.server.password", hash);
// save file
using (StreamWriter writer = new StreamWriter(file))
{
writer.Write(content);
}
var XmlDoc = new XmlDocument();
XmlDoc.Load(file);
var Node = XmlDoc.SelectSingleNode("configuration/websitepanel.server/security/password") as XmlElement;
if (Node == null)
throw new Exception("Unable to set a server access password. Check structure of configuration file.");
else
Node.SetAttribute("value", hash);
XmlDoc.Save(file);
}
catch (Exception ex)
{