diff --git a/src/PerfView/App.cs b/src/PerfView/App.cs
index eb109853c..204753146 100755
--- a/src/PerfView/App.cs
+++ b/src/PerfView/App.cs
@@ -54,6 +54,25 @@ public static int Main(string[] args)
(string.Compare(args[0], "/noGui", StringComparison.OrdinalIgnoreCase) == 0 ||
string.Compare(args[0], 0, "/logFile", 0, 8, StringComparison.OrdinalIgnoreCase) == 0));
+ // Users will need to check the return code for failure because there is no console setup yet and we can't log any status.
+ var buildLayout = args.Length > 1 && string.Compare(args[0], "/buildLayout", StringComparison.OrdinalIgnoreCase) == 0;
+ if (buildLayout)
+ {
+ string destDirectory = args[1];
+ if (Directory.Exists(destDirectory))
+ {
+ return retCode;
+ }
+
+ SupportFiles.SetSupportFilesDir(destDirectory);
+ App.Unpack();
+ App.WriteDefaultAppConfigDataFile(destDirectory);
+
+ retCode = 0;
+ return retCode;
+ }
+
+
// If we need to install, display the splash screen early, otherwise wait
if (!Directory.Exists(SupportFiles.SupportFileDir) && !noGui)
{
@@ -394,6 +413,11 @@ public static ConfigData AppConfigData
}
}
+ public static void WriteDefaultAppConfigDataFile(string directoryPath)
+ {
+ string defaultConfig = "\r\n .\\\r\n";
+ File.WriteAllText(Path.Combine(directoryPath, "AppConfig.xml"), defaultConfig);
+ }
// Logfile
///
diff --git a/src/PerfView/Utilities/SupportFiles.cs b/src/PerfView/Utilities/SupportFiles.cs
index 89d93c300..a6de51296 100755
--- a/src/PerfView/Utilities/SupportFiles.cs
+++ b/src/PerfView/Utilities/SupportFiles.cs
@@ -338,6 +338,11 @@ private static void UnpackResources()
}
}
+ internal static void SetSupportFilesDir(string supportFilesDir)
+ {
+ s_supportFileDir = supportFilesDir;
+ }
+
private static void Cleanup()
{
string cleanupMarkerFile = Path.Combine(SupportFileDirBase, "CleanupNeeded");