wip
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
param(
|
||||
[Parameter(Mandatory=$false)]
|
||||
[ValidateSet("production", "ptr", "local")]
|
||||
[string]$Env = "local"
|
||||
[string]$Env = "local",
|
||||
[switch]$DeveloperLogin
|
||||
)
|
||||
|
||||
# Stop on errors
|
||||
@@ -68,9 +69,16 @@ if ((Test-Path -LiteralPath $installedWarcraftXL -PathType Leaf) -and
|
||||
-not (Test-ExistingFileWriteAccess -Path $installedWarcraftXL) -and
|
||||
-not $isAdministrator) {
|
||||
Write-Host "WarcraftXL.dll requires administrator access. Requesting elevation..."
|
||||
$elevationArguments = @(
|
||||
"-NoProfile", "-ExecutionPolicy", "Bypass", "-File",
|
||||
"`"$($MyInvocation.MyCommand.Path)`"", "-Env", $Env
|
||||
)
|
||||
if ($DeveloperLogin) {
|
||||
$elevationArguments += "-DeveloperLogin"
|
||||
}
|
||||
$elevatedProcess = Start-Process -FilePath "powershell.exe" -Verb RunAs -PassThru -Wait `
|
||||
-WorkingDirectory $ROOT `
|
||||
-ArgumentList "-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "`"$($MyInvocation.MyCommand.Path)`"", "-Env", $Env
|
||||
-ArgumentList $elevationArguments
|
||||
exit $elevatedProcess.ExitCode
|
||||
}
|
||||
|
||||
@@ -149,7 +157,8 @@ if (!(Test-Path (Join-Path $DIST_DIR "Data"))) {
|
||||
# are uploaded by upload_to_s3.py and consumed by the launcher manifest.
|
||||
Stop-WowRuntime -ClientPath $WOW_HOME
|
||||
Write-Host "Building and packaging WarcraftXL..."
|
||||
& $WXL_BUILD_SCRIPT -Configuration Release -ClientPath $WOW_HOME `
|
||||
$runtimeConfiguration = if ($DeveloperLogin) { "Debug" } else { "Release" }
|
||||
& $WXL_BUILD_SCRIPT -Configuration $runtimeConfiguration -ClientPath $WOW_HOME `
|
||||
-PackagePath $DIST_DIR -Deploy
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "WarcraftXL build/deploy failed!"
|
||||
@@ -200,4 +209,11 @@ if ($realmlist) {
|
||||
|
||||
# --- Run WoW reload script
|
||||
Write-Host "Launching WoW..."
|
||||
cmd /c $RELOAD_SCRIPT
|
||||
if ($DeveloperLogin) {
|
||||
$env:MOONWELL_DEV_LOGIN = "1"
|
||||
}
|
||||
try {
|
||||
cmd /c $RELOAD_SCRIPT
|
||||
} finally {
|
||||
Remove-Item Env:MOONWELL_DEV_LOGIN -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user