Merge pull request #1114 from mattias-symphony/SDA-2681

fix: SDA-2681 Ensuring correct paths and function for silent install
This commit is contained in:
mattias-symphony 2020-11-17 08:47:28 +01:00 committed by GitHub
commit b02e72e854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,7 +150,7 @@ class Script
// these when running the installer, but if not specified, the defaults will be used.
project.Properties = new[]
{
new PublicProperty("ALLUSERS", "true"),
new PublicProperty("ALLUSERS", "1"),
new PublicProperty("ALWAYS_ON_TOP", "DISABLED" ),
new PublicProperty("AUTO_LAUNCH_PATH", ""),
new PublicProperty("AUTO_START", "ENABLED"),
@ -252,6 +252,22 @@ class Script
{
try
{
// "ALLUSERS" will be set to "2" if installing through UI, so the "MSIINSTALLPERUSER" property can be used so the user can choose install scope
if (e.Session["ALLUSERS"] != "2" )
{
// If "ALLUSERS" is "1" or "", this is a quiet command line installation, and we need to set the right paths here, since the UI haven't
if (e.Session["ALLUSERS"] == "")
{
// Install for current user
e.Session["INSTALLDIR"] = System.Environment.ExpandEnvironmentVariables(@"%LOCALAPPDATA%\Programs\Symphony\" + e.ProductName);
}
else
{
// Install for all users
e.Session["INSTALLDIR"] = e.Session["PROGRAMSFOLDER"] + @"\Symphony\" + e.ProductName;
}
}
// Try to close all running symphony instances before installing
KillSymphonyProcesses();