From 5a925699557a423ae88848b23adfd1f478b13835 Mon Sep 17 00:00:00 2001 From: sbenmoussati <51402489+sbenmoussati@users.noreply.github.com> Date: Wed, 9 Jun 2021 10:41:42 +0200 Subject: [PATCH] SDA-3201 Enabling user-agent overriding with MSI installer --- docs/features/silent-installation-windows.md | 1 + installer/win/WixSharpInstaller/Symphony.cs | 4 +++- installer/win/install_instructions_win.md | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/features/silent-installation-windows.md b/docs/features/silent-installation-windows.md index b991300a..b9f6367f 100644 --- a/docs/features/silent-installation-windows.md +++ b/docs/features/silent-installation-windows.md @@ -48,6 +48,7 @@ Add “/l* symphony_install.log” to get debug information from the install wri - OPEN_EXTERNAL (Boolean) - DEV_TOOLS_ENABLED (Boolean) - AUTO_LAUNCH_PATH (String) +- OVERRIDE_USER_AGENT (Boolean) You'll need to quote the Boolean values when passing from the command line. #### Check-boxes (in the installer UI) that can be altered are listed below: diff --git a/installer/win/WixSharpInstaller/Symphony.cs b/installer/win/WixSharpInstaller/Symphony.cs index 6c00933b..d1d7bc58 100644 --- a/installer/win/WixSharpInstaller/Symphony.cs +++ b/installer/win/WixSharpInstaller/Symphony.cs @@ -187,6 +187,7 @@ class Script new PublicProperty("CONTEXT_ORIGIN_URL", ""), new PublicProperty("POINTER_LOCK", "true"), new PublicProperty("USER_DATA_PATH", ""), + new PublicProperty("OVERRIDE_USER_AGENT", "false"), new Property("MSIINSTALLPERUSER", "1"), new Property("PROGRAMSFOLDER", System.Environment.ExpandEnvironmentVariables(@"%PROGRAMFILES%")) }; @@ -214,7 +215,7 @@ class Script 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 - 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,USER_DATA_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,USER_DATA_PATH,OVERRIDE_USER_AGENT" }, // CleanRegistry @@ -383,6 +384,7 @@ public class CustomActions data = ReplaceProperty(data, "devToolsEnabled", session.Property("DEV_TOOLS_ENABLED")); data = ReplaceProperty(data, "autoLaunchPath", FixPathFormat(session.Property("AUTO_LAUNCH_PATH"))); data = ReplaceProperty(data, "userDataPath", FixPathFormat(session.Property("USER_DATA_PATH"))); + data = ReplaceProperty(data, "overrideUserAgent", session.Property("OVERRIDE_USER_AGENT")); // Write the contents back to the file System.IO.File.WriteAllText(filename, data); diff --git a/installer/win/install_instructions_win.md b/installer/win/install_instructions_win.md index 8153b809..3dc9bc30 100644 --- a/installer/win/install_instructions_win.md +++ b/installer/win/install_instructions_win.md @@ -492,3 +492,12 @@ The default (if not specified, or if specified as empty string "") is +------------------------------------------------------------------- +### OVERRIDE_USER_AGENT + +Expected values: + +* "true" + "Electron/X.X" is removed from user-agents. +* "false" + User-agents are not modified. \ No newline at end of file