Merge branch 'master' into revert-api-window-opts-change

This commit is contained in:
psjostrom
2020-12-08 12:43:55 +01:00
committed by GitHub
3 changed files with 57 additions and 16 deletions

View File

@@ -156,6 +156,7 @@ class Script
// these when running the installer, but if not specified, the defaults will be used.
project.Properties = new[]
{
new PublicProperty("APPDIR", ""),
new PublicProperty("ALLUSERS", "1"),
new PublicProperty("ALWAYS_ON_TOP", "DISABLED" ),
new PublicProperty("AUTO_LAUNCH_PATH", ""),
@@ -250,8 +251,14 @@ class Script
// "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"] == "")
// 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["APPDIR"] != "")
{
// If "APPDIR" param was specified, just use that as is
e.Session["INSTALLDIR"] = e.Session["APPDIR"];
}
else if (e.Session["ALLUSERS"] == "")
{
// Install for current user
e.Session["INSTALLDIR"] = System.Environment.ExpandEnvironmentVariables(@"%LOCALAPPDATA%\Programs\Symphony\" + e.ProductName);

View File

@@ -49,19 +49,32 @@ namespace Symphony
// To enable Wix to use the "MSIINSTALLPERUSER" property being set below, ALLUSERS must be set to 2
Runtime.Session["ALLUSERS"] = "2";
var installDir = "";
if (radioButtonCurrentUser.Checked)
{
// Install for current user
Runtime.Session["MSIINSTALLPERUSER"] = "1"; // per-user
Runtime.Session["INSTALLDIR"] = System.Environment.ExpandEnvironmentVariables(@"%LOCALAPPDATA%\Programs\Symphony\" + Runtime.ProductName);
} else if (radioButtonAllUsers.Checked)
}
else if (radioButtonAllUsers.Checked)
{
// Install for all users
Runtime.Session["MSIINSTALLPERUSER"] = ""; // per-machine
Runtime.Session["INSTALLDIR"] = Runtime.Session["PROGRAMSFOLDER"] + @"\Symphony\" + Runtime.ProductName;
}
// Set INSTALLDIR
if( Runtime.Session["APPDIR"] != "" )
{
// If APPDIR param was specified, just use that as is
Runtime.Session["INSTALLDIR"] = Runtime.Session["APPDIR"];
}
else
{
// Apply the install dir as determined by radio buttons
Runtime.Session["INSTALLDIR"] = installDir;
}
// Detect if Symphony is running
bool isRunning = System.Diagnostics.Process.GetProcessesByName("Symphony").Length > 1;
if (isRunning)

View File

@@ -31,6 +31,27 @@ or
msiexec /i Symphony.msi /q ALLUSERS=""
-------------------------------------------------------------------
### APPDIR
Expected values:
* Full file path for target location to install Symphony to
The default value differs depending on ALLUSERS setting.
* %LOCALAPPDATA%\Programs\Symphony\Symphony
If installing *Only for me* (ALLUSERS="")
* %PROGRAMFILES%\Symphony\Symphony
If installing *For all users* (ALLUSERS="1")
#### Example
msiexec /i Symphony.msi /q APPDIR="C:\Program Files\Symphony"
-------------------------------------------------------------------
### ALWAYS_ON_TOP