Add TempPath parameter to bootstrapper install
Allows a temporary path to be passed to the Bootstrapper to be used when mounting WIM images during the offline install phase. Allows mounting to be done on another (faster, SSD) volume.
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
@@ -14,11 +11,13 @@ namespace Disco.ClientBootstrapper
|
||||
private CompleteCallback mCompleteCallback;
|
||||
private string InstallLocation;
|
||||
private string WimImageId;
|
||||
private string TempPath;
|
||||
|
||||
public InstallLoop(string InstallLocation, string WimImageId = null)
|
||||
public InstallLoop(string InstallLocation, string WimImageId, string TempPath)
|
||||
{
|
||||
this.InstallLocation = InstallLocation;
|
||||
this.WimImageId = WimImageId;
|
||||
this.TempPath = TempPath;
|
||||
}
|
||||
|
||||
public void Start(CompleteCallback Callback)
|
||||
@@ -34,7 +33,7 @@ namespace Disco.ClientBootstrapper
|
||||
|
||||
//Program.Status.UpdateStatus(null, null, "Testing UI");
|
||||
//Program.SleepThread(5000, false);
|
||||
Interop.InstallInterop.Install(this.InstallLocation, this.WimImageId);
|
||||
Interop.InstallInterop.Install(this.InstallLocation, this.WimImageId, this.TempPath);
|
||||
if (this.mCompleteCallback != null)
|
||||
{
|
||||
this.mCompleteCallback.BeginInvoke(null, null);
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Win32;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Disco.ClientBootstrapper.Interop
|
||||
{
|
||||
@@ -187,7 +183,7 @@ namespace Disco.ClientBootstrapper.Interop
|
||||
#endregion
|
||||
}
|
||||
|
||||
public static void Install(string InstallLocation, string WimImageId = null)
|
||||
public static void Install(string InstallLocation, string WimImageId, string TempPath)
|
||||
{
|
||||
Program.Status.UpdateStatus("Installing Bootstrapper", "Starting", "Please wait...", false);
|
||||
|
||||
@@ -234,12 +230,12 @@ namespace Disco.ClientBootstrapper.Interop
|
||||
}
|
||||
|
||||
// Get Temp Path
|
||||
var wimMountPath = Path.Combine(Path.GetTempPath(), "DiscoClientBootstrapperWimMount");
|
||||
var wimMountPath = Path.Combine(TempPath ?? Path.GetTempPath(), "DiscoClientBootstrapperWimMount");
|
||||
if (Directory.Exists(wimMountPath))
|
||||
Directory.Delete(wimMountPath, true);
|
||||
Directory.CreateDirectory(wimMountPath);
|
||||
|
||||
var wimTempMountPath = Path.Combine(Path.GetTempPath(), "DiscoClientBootstrapperWimTempMount");
|
||||
var wimTempMountPath = Path.Combine(TempPath ?? Path.GetTempPath(), "DiscoClientBootstrapperWimTempMount");
|
||||
if (Directory.Exists(wimTempMountPath))
|
||||
Directory.Delete(wimTempMountPath, true);
|
||||
Directory.CreateDirectory(wimTempMountPath);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Disco.ClientBootstrapper
|
||||
{
|
||||
@@ -40,11 +39,14 @@ namespace Disco.ClientBootstrapper
|
||||
statusForm.Show();
|
||||
string installLocation = null;
|
||||
string wimImage = null;
|
||||
string tempPath = null;
|
||||
if (args.Length > 1)
|
||||
installLocation = args[1];
|
||||
if (args.Length > 2)
|
||||
wimImage = args[2];
|
||||
InstallLoop = new InstallLoop(installLocation, wimImage);
|
||||
if (args.Length > 3)
|
||||
tempPath = args[3];
|
||||
InstallLoop = new InstallLoop(installLocation, wimImage, tempPath);
|
||||
InstallLoop.Start(new InstallLoop.CompleteCallback(InstallComplete));
|
||||
Application.Run();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user