-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2_Setup_UE4_SpatialOS_Auto_Public.ps1
49 lines (45 loc) · 2.05 KB
/
2_Setup_UE4_SpatialOS_Auto_Public.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
param(
[Parameter(Mandatory=$true)][string]$drive,
[Parameter(Mandatory=$true)][string]$project_folder,
[Parameter(Mandatory=$true)][string]$github_username
)
Clear-Host;
$DriveLetters = (Get-Volume).DriveLetter;
if ($DriveLetters -contains $drive) {
Write-Output "Valid Drive Letter Found.";
$DriveLetter = $drive.ToUpper() + ":";
$ProjectDirectory = $DriveLetter, $project_folder;
$ProjectDirectory = $ProjectDirectory -join "\";
if ((Test-Path $ProjectDirectory)) {
Set-Location $ProjectDirectory;
Write-Output "Downloading Unreal Engine|Spatial OS Build from Git."
git clone https://[email protected]/improbableio/UnrealEngine.git
$EnvironmentVar = Join-Path $ProjectDirectory 'UnrealEngine'
[Environment]::SetEnvironmentVariable('UNREAL_HOME', $EnvironmentVar, 'Machine')
Write-Output "Setup Environment Variable for UNREAL_HOME";
$Setup = Join-Path $EnvironmentVar 'Setup.bat'
$sProc = Start-Process $Setup -PassThru -Verb RunAs
$sProc.WaitForExit()
$Generate = Join-Path $EnvironmentVar 'GenerateProjectFiles.bat'
$gProc = Start-Process $Generate -PassThru -Verb RunAs
$gProc.WaitForExit()
Set-Location $EnvironmentVar
$pf = "programfiles(x86)"
$msBuildDir = Get-ChildItem -Path env:$pf
$msBuildDir = Join-Path $msBuildDir.value "\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe"
$msArgs = 'UE4.sln /target:Engine\UE4 /p:Configuration="Development Editor" /p:Platform="Win64"'
$msBuild = Start-Process $msBuildDir -ArgumentList $msArgs -Passthru -Verb RunAs
$msBuild.WaitForExit()
Write-Output "Now Follow the Rest of the Guide.";
Read-Host "Press any key to exit..."
exit
} else {
Write-Output "Please run the 1_Setup_ToolChain.ps1 first, or Create a Folder called "+$project_folder+" in the Drive you Selected.";
Read-Host "Press any key to exit..."
exit
}
} else {
Write-Output "Please input a Valid Drive Letter.";
Read-Host "Press any key to exit..."
exit
}