aboutsummaryrefslogtreecommitdiff
path: root/Build/Scripts/EnablePluginByDefault.cs
diff options
context:
space:
mode:
authorivey <[email protected]>2020-06-15 15:54:16 -0400
committerivey <[email protected]>2020-06-15 15:54:16 -0400
commitd5310c3455f9849243b7b950deb4e910aa1f24dd (patch)
tree994a81eec10538d2a1efd9ed78469a249ff086f2 /Build/Scripts/EnablePluginByDefault.cs
parentUpdated image paths. (diff)
downloadugcexample-d5310c3455f9849243b7b950deb4e910aa1f24dd.tar.xz
ugcexample-d5310c3455f9849243b7b950deb4e910aa1f24dd.zip
Initial commit of the UGCExample Project
Diffstat (limited to 'Build/Scripts/EnablePluginByDefault.cs')
-rw-r--r--Build/Scripts/EnablePluginByDefault.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/Build/Scripts/EnablePluginByDefault.cs b/Build/Scripts/EnablePluginByDefault.cs
new file mode 100644
index 0000000..64c25c1
--- /dev/null
+++ b/Build/Scripts/EnablePluginByDefault.cs
@@ -0,0 +1,37 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System.Reflection;
+using AutomationTool;
+using UnrealBuildTool;
+using Tools.DotNETCommon;
+
+using System.Linq;
+using System.Text;
+using Microsoft.Win32;
+using System.Diagnostics;
+
+namespace SimpleUGC.Automation
+{
+ [Help("Sets the EnabledByDefault flag for a plugin to true")]
+ public class EnablePluginByDefault : BuildCommand
+ {
+ public override void ExecuteBuild()
+ {
+ string FileName = ParseParamValue("FileName", null);
+ if(FileName == null)
+ {
+ throw new AutomationException("Missing -FileName=... argument");
+ }
+
+ CommandUtils.SetFileAttributes(FileName, ReadOnly: false);
+
+ PluginDescriptor Plugin = PluginDescriptor.FromFile(new FileReference(FileName));
+ Plugin.bEnabledByDefault = true;
+ Plugin.Save(FileName);
+ }
+ }
+}