Merge branch 'master' of github.com:symphonyoss/SymphonyElectron

This commit is contained in:
Vishwas Shashidhar 2021-01-13 18:34:05 +05:30
commit 1cef8fbb60
4 changed files with 88 additions and 50 deletions

View File

@ -20,20 +20,35 @@ SDA can be automatically installed from the terminal. The process of customizing
The parameters that should be configured in `sym_settings.txt` are listed below. They need to be in the same order as they'll be picked up by the installer in the same order. Do not skip any parameters. The parameters that should be configured in `sym_settings.txt` are listed below. They need to be in the same order as they'll be picked up by the installer in the same order. Do not skip any parameters.
- Pod Url - Pod Url
- Context Origin Url (Only required if your Pod url is set to your SSO provider URL, otherwise, leave it blank.)
- Minimize On Close - Minimize On Close
- Launch On Startup - Launch On Startup
- Always on Top - Always on Top
- Bring to Front - Bring to Front
- Dev Tools Enabled - Dev Tools Enabled
You can find a sample below: You can find samples below:
Your SSO URL is set as the POD URL
``` ```
https://corporate.symphony.com/login/sso/initsso https://mysso.mycompany.com/login/sso/initsso
https://mypod.symphony.com
ENABLED ENABLED
ENABLED ENABLED
DISABLED DISABLED
DISABLED DISABLED
true
```
Your POD takes care of SSO as well
```
https://mypod.symphony.com/login/sso/initsso
ENABLED ENABLED
ENABLED
DISABLED
DISABLED
true
``` ```
## sym_permissions.txt ## sym_permissions.txt
@ -50,13 +65,13 @@ The parameters that should be configured in `sym_permissions.txt` are listed bel
You can find a sample below: You can find a sample below:
``` ```
ENABLED true
ENABLED true
ENABLED true
ENABLED true
ENABLED true
ENABLED true
ENABLED true
``` ```
# Installation # Installation
@ -85,14 +100,16 @@ settings_temp_file="/tmp/sym_settings.txt"
## Set the POD URL and other user related settings. ## Set the POD URL and other user related settings.
## Note, all the user related settings should be either "ENABLED", "DISABLED" or "NOT_SET" ## Note, all the user related settings should be either "ENABLED", "DISABLED" or "NOT_SET"
pod_url="https://corporate.symphony.com/login/sso/initsso" pod_url="https://corporate.symphony.com/login/sso/initsso"
context_origin_url="https://corporate.symphony.com"
minimize_on_close="ENABLED" minimize_on_close="ENABLED"
launch_on_startup="ENABLED" launch_on_startup="ENABLED"
always_on_top="DISABLED" always_on_top="DISABLED"
bring_to_front="DISABLED" bring_to_front="DISABLED"
dev_tools_enabled="ENABLED" dev_tools_enabled=true
## DO NOT CHANGE THIS ## DO NOT CHANGE THIS
sudo echo ${pod_url} > ${settings_temp_file} sudo echo ${pod_url} > ${settings_temp_file}
sudo echo ${context_origin_url} >> ${settings_temp_file}
sudo echo ${minimize_on_close} >> ${settings_temp_file} sudo echo ${minimize_on_close} >> ${settings_temp_file}
sudo echo ${launch_on_startup} >> ${settings_temp_file} sudo echo ${launch_on_startup} >> ${settings_temp_file}
sudo echo ${always_on_top} >> ${settings_temp_file} sudo echo ${always_on_top} >> ${settings_temp_file}
@ -103,13 +120,13 @@ sudo echo ${dev_tools_enabled} >> ${settings_temp_file}
permissions_temp_file="/tmp/sym_permissions.txt" permissions_temp_file="/tmp/sym_permissions.txt"
## Set the permissions. By default, it should be "ENABLED" for all unless you know what you are doing ## Set the permissions. By default, it should be "ENABLED" for all unless you know what you are doing
media="ENABLED" media=true
geo_location="ENABLED" geo_location=true
notifications="ENABLED" notifications=true
midi_sysex="ENABLED" midi_sysex=true
pointer_lock="ENABLED" pointer_lock=true
full_screen="ENABLED" full_screen=true
open_external_app="ENABLED" open_external_app=true
## DO NOT CHANGE THIS ## DO NOT CHANGE THIS
sudo echo ${media} > ${permissions_temp_file} sudo echo ${media} > ${permissions_temp_file}
@ -125,4 +142,5 @@ sudo installer -store -pkg ${package_path} -target /
rm -rf ${settings_temp_file} rm -rf ${settings_temp_file}
rm -rf ${permissions_temp_file} rm -rf ${permissions_temp_file}
``` ```

View File

@ -11,28 +11,32 @@ newPath=${configFilePath}
## Get Symphony Settings from the temp file ## ## Get Symphony Settings from the temp file ##
pod_url=$(sed -n '1p' ${settingsFilePath}); pod_url=$(sed -n '1p' ${settingsFilePath});
minimize_on_close=$(sed -n '2p' ${settingsFilePath}); context_origin_url=$(sed -n '2p' ${settingsFilePath});
launch_on_startup=$(sed -n '3p' ${settingsFilePath}); minimize_on_close=$(sed -n '3p' ${settingsFilePath});
always_on_top=$(sed -n '4p' ${settingsFilePath}); launch_on_startup=$(sed -n '4p' ${settingsFilePath});
bring_to_front=$(sed -n '5p' ${settingsFilePath}); always_on_top=$(sed -n '5p' ${settingsFilePath});
dev_tools_enabled=$(sed -n '6p' ${settingsFilePath}); bring_to_front=$(sed -n '6p' ${settingsFilePath});
dev_tools_enabled=$(sed -n '7p' ${settingsFilePath});
## If any of the above values turn out to be empty, set default values ## ## If any of the above values turn out to be empty, set default values ##
if [ "$pod_url" == "" ]; then pod_url="https://my.symphony.com"; fi if [ "$pod_url" = "" ]; then pod_url="https://my.symphony.com"; fi
if [ "$minimize_on_close" == "" ] || [ "$minimize_on_close" == 'true' ]; then minimize_on_close='ENABLED'; else minimize_on_close='DISABLED'; fi if [ "$context_origin_url" = "" ]; then context_origin_url=""; fi
if [ "$launch_on_startup" == "" ] || [ "$launch_on_startup" == 'true' ]; then launch_on_startup='ENABLED'; else launch_on_startup='DISABLED'; fi if [ "$minimize_on_close" = "" ] || [ "$minimize_on_close" = 'true' ]; then minimize_on_close='ENABLED'; else minimize_on_close='DISABLED'; fi
if [ "$always_on_top" == "" ] || [ "$always_on_top" == 'false' ]; then always_on_top='DISABLED'; else always_on_top='ENABLED'; fi if [ "$launch_on_startup" = "" ] || [ "$launch_on_startup" = 'true' ]; then launch_on_startup='ENABLED'; else launch_on_startup='DISABLED'; fi
if [ "$bring_to_front" == "" ] || [ "$bring_to_front" == 'false' ]; then bring_to_front='DISABLED'; else bring_to_front='ENABLED'; fi if [ "$always_on_top" = "" ] || [ "$always_on_top" = 'false' ]; then always_on_top='DISABLED'; else always_on_top='ENABLED'; fi
if [ "$dev_tools_enabled" == "" ]; then dev_tools_enabled=true; fi if [ "$bring_to_front" = "" ] || [ "$bring_to_front" = 'false' ]; then bring_to_front='DISABLED'; else bring_to_front='ENABLED'; fi
if [ "$dev_tools_enabled" = "" ]; then dev_tools_enabled=true; fi
pod_url_escaped=$(sed 's#[&/\]#\\&#g' <<<"$pod_url") pod_url_escaped=$(sed 's#[&/\]#\\&#g' <<<"$pod_url")
context_origin_url_escaped=$(sed 's#[&/\]#\\&#g' <<<"$context_origin_url")
## Replace the default settings with the user selected settings ## ## Replace the default settings with the user selected settings ##
sed -i "" -E "s#\"url\" ?: ?\".*\"#\"url\"\: \"$pod_url_escaped\"#g" ${newPath} sed -i "" -E "s#\"url\" ?: ?\".*\"#\"url\"\: \"$pod_url_escaped\"#g" "${newPath}"
sed -i "" -E "s#\"minimizeOnClose\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"minimizeOnClose\":\ \"$minimize_on_close\"#g" ${newPath} sed -i "" -E "s#\"contextOriginUrl\" ?: ?\".*\"#\"contextOriginUrl\"\: \"$context_origin_url_escaped\"#g" "${newPath}"
sed -i "" -E "s#\"alwaysOnTop\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"alwaysOnTop\":\ \"$always_on_top\"#g" ${newPath} sed -i "" -E "s#\"minimizeOnClose\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"minimizeOnClose\":\ \"$minimize_on_close\"#g" "${newPath}"
sed -i "" -E "s#\"launchOnStartup\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"launchOnStartup\":\ \"$launch_on_startup\"#g" ${newPath} sed -i "" -E "s#\"alwaysOnTop\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"alwaysOnTop\":\ \"$always_on_top\"#g" "${newPath}"
sed -i "" -E "s#\"bringToFront\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"bringToFront\":\ \"$bring_to_front\"#g" ${newPath} sed -i "" -E "s#\"launchOnStartup\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"launchOnStartup\":\ \"$launch_on_startup\"#g" "${newPath}"
sed -i "" -E "s#\"devToolsEnabled\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"devToolsEnabled\":\ $dev_tools_enabled#g" ${newPath} sed -i "" -E "s#\"bringToFront\" ?: ?\"([Ee][Nn][Aa][Bb][Ll][Ee][Dd]|[Dd][Ii][Ss][Aa][Bb][Ll][Ee][Dd])\"#\"bringToFront\":\ \"$bring_to_front\"#g" "${newPath}"
sed -i "" -E "s#\"devToolsEnabled\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"devToolsEnabled\":\ $dev_tools_enabled#g" "${newPath}"
## Get Symphony Permissions from the temp file ## ## Get Symphony Permissions from the temp file ##
media=$(sed -n '1p' ${permissionsFilePath}); media=$(sed -n '1p' ${permissionsFilePath});
@ -44,25 +48,25 @@ full_screen=$(sed -n '6p' ${permissionsFilePath});
open_external_app=$(sed -n '7p' ${permissionsFilePath}); open_external_app=$(sed -n '7p' ${permissionsFilePath});
## If any of the above values turn out to be empty, set default values ## ## If any of the above values turn out to be empty, set default values ##
if [ "$media" == "" ]; then media=true; fi if [ "$media" = "" ]; then media=true; fi
if [ "$geo_location" == "" ]; then geo_location=true; fi if [ "$geo_location" = "" ]; then geo_location=true; fi
if [ "$notifications" == "" ]; then notifications=true; fi if [ "$notifications" = "" ]; then notifications=true; fi
if [ "$midi_sysex" == "" ]; then midi_sysex=true; fi if [ "$midi_sysex" = "" ]; then midi_sysex=true; fi
if [ "$pointer_lock" == "" ]; then pointer_lock=true;fi if [ "$pointer_lock" = "" ]; then pointer_lock=true;fi
if [ "$full_screen" == "" ]; then full_screen=true; fi if [ "$full_screen" = "" ]; then full_screen=true; fi
if [ "$open_external_app" == "" ]; then open_external_app=true; fi if [ "$open_external_app" = "" ]; then open_external_app=true; fi
## Replace the default permissions with the user selected permissions ## ## Replace the default permissions with the user selected permissions ##
sed -i "" -E "s#\"media\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"media\":\ $media#g" ${newPath} sed -i "" -E "s#\"media\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"media\":\ $media#g" "${newPath}"
sed -i "" -E "s#\"geolocation\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"geolocation\":\ $geo_location#g" ${newPath} sed -i "" -E "s#\"geolocation\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"geolocation\":\ $geo_location#g" "${newPath}"
sed -i "" -E "s#\"notifications\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"notifications\":\ $notifications#g" ${newPath} sed -i "" -E "s#\"notifications\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"notifications\":\ $notifications#g" "${newPath}"
sed -i "" -E "s#\"midiSysex\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"midiSysex\":\ $midi_sysex#g" ${newPath} sed -i "" -E "s#\"midiSysex\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"midiSysex\":\ $midi_sysex#g" "${newPath}"
sed -i "" -E "s#\"pointerLock\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"pointerLock\":\ $pointer_lock#g" ${newPath} sed -i "" -E "s#\"pointerLock\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"pointerLock\":\ $pointer_lock#g" "${newPath}"
sed -i "" -E "s#\"fullscreen\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"fullscreen\":\ $full_screen#g" ${newPath} sed -i "" -E "s#\"fullscreen\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"fullscreen\":\ $full_screen#g" "${newPath}"
sed -i "" -E "s#\"openExternal\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"openExternal\":\ $open_external_app#g" ${newPath} sed -i "" -E "s#\"openExternal\" ?: ?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])#\"openExternal\":\ $open_external_app#g" "${newPath}"
## Remove the temp settings & permissions file created ## ## Remove the temp settings & permissions file created ##
rm -f ${settingsFilePath} rm -f ${settingsFilePath}
rm -f ${permissionsFilePath} rm -f ${permissionsFilePath}
uuidgen > ${installVariantPath} uuidgen > "${installVariantPath}"

View File

@ -172,6 +172,7 @@ class Script
new PublicProperty("NOTIFICATIONS", "true"), new PublicProperty("NOTIFICATIONS", "true"),
new PublicProperty("OPEN_EXTERNAL", "true"), new PublicProperty("OPEN_EXTERNAL", "true"),
new PublicProperty("POD_URL", "https://my.symphony.com"), new PublicProperty("POD_URL", "https://my.symphony.com"),
new PublicProperty("CONTEXT_ORIGIN_URL", ""),
new PublicProperty("POINTER_LOCK", "true"), new PublicProperty("POINTER_LOCK", "true"),
new Property("MSIINSTALLPERUSER", "1"), new Property("MSIINSTALLPERUSER", "1"),
new Property("PROGRAMSFOLDER", System.Environment.ExpandEnvironmentVariables(@"%PROGRAMFILES%")) new Property("PROGRAMSFOLDER", System.Environment.ExpandEnvironmentVariables(@"%PROGRAMFILES%"))
@ -200,7 +201,7 @@ class Script
new ElevatedManagedAction(CustomActions.UpdateConfig, Return.check, When.After, Step.InstallFiles, Condition.NOT_BeingRemoved ) new ElevatedManagedAction(CustomActions.UpdateConfig, Return.check, When.After, Step.InstallFiles, Condition.NOT_BeingRemoved )
{ {
// The UpdateConfig action needs the built-in property INSTALLDIR as well as most of the custom properties // The UpdateConfig action needs the built-in property INSTALLDIR as well as most of the custom properties
UsesProperties = "INSTALLDIR,POD_URL,MINIMIZE_ON_CLOSE,ALWAYS_ON_TOP,AUTO_START,BRING_TO_FRONT,MEDIA,LOCATION,NOTIFICATIONS,MIDI_SYSEX,POINTER_LOCK,FULL_SCREEN,OPEN_EXTERNAL,CUSTOM_TITLE_BAR,DEV_TOOLS_ENABLED,AUTO_LAUNCH_PATH" UsesProperties = "INSTALLDIR,POD_URL,CONTEXT_ORIGIN_URL,MINIMIZE_ON_CLOSE,ALWAYS_ON_TOP,AUTO_START,BRING_TO_FRONT,MEDIA,LOCATION,NOTIFICATIONS,MIDI_SYSEX,POINTER_LOCK,FULL_SCREEN,OPEN_EXTERNAL,CUSTOM_TITLE_BAR,DEV_TOOLS_ENABLED,AUTO_LAUNCH_PATH"
}, },
// CleanRegistry // CleanRegistry
@ -341,6 +342,7 @@ public class CustomActions
// Replace all the relevant settings with values from the properties // Replace all the relevant settings with values from the properties
data = ReplaceProperty(data, "url", session.Property("POD_URL")); data = ReplaceProperty(data, "url", session.Property("POD_URL"));
data = ReplaceProperty(data, "contextOriginUrl", session.Property("CONTEXT_ORIGIN_URL"));
data = ReplaceProperty(data, "minimizeOnClose", session.Property("MINIMIZE_ON_CLOSE")); data = ReplaceProperty(data, "minimizeOnClose", session.Property("MINIMIZE_ON_CLOSE"));
data = ReplaceProperty(data, "alwaysOnTop", session.Property("ALWAYS_ON_TOP")); data = ReplaceProperty(data, "alwaysOnTop", session.Property("ALWAYS_ON_TOP"));
data = ReplaceProperty(data, "launchOnStartup", session.Property("AUTO_START")); data = ReplaceProperty(data, "launchOnStartup", session.Property("AUTO_START"));

View File

@ -367,6 +367,20 @@ Expected values:
-------------------------------------------------------------------
### CONTEXT_ORIGIN_URL
Expected values:
* Your actual POD URL and not the SSO URL
(default is "" )
#### Example
msiexec /i Symphony.msi /q CONTEXT_ORIGIN_URL="https://my.symphony.com"
------------------------------------------------------------------- -------------------------------------------------------------------
### POINTER_LOCK ### POINTER_LOCK