diff --git a/.github/workflows/apbx.yaml b/.github/workflows/apbx.yaml index 84b69823f4..3c65432f53 100644 --- a/.github/workflows/apbx.yaml +++ b/.github/workflows/apbx.yaml @@ -112,8 +112,8 @@ jobs: sed -i 's|.*<\/Description>|Experimental testing version of the Atlas Playbook, built with GitHub Actions from commit ${{ github.sha }}. Be aware of these builds being potentially unstable and buggy!|g' playbook.conf cd Configuration/atlas echo "Enabling AME Wizard Live Log..." - sed -i "6i \ # AME Wizard Live Log for development Playbooks\n \- \!cmd: {command: 'start \"AME Wizard Live Log\" PowerShell \-NoP\ -C \"Get\-Content \-Wait Logs\AdminOutput.txt \-ErrorAction SilentlyContinue | Write\-Output; pause\"\', baseDir: true, wait: false, showError: true}\n" start.yml - + sed '8s/ #//' + - name: Create playbook (ZIP/APBX password is malte) if: ${{ steps.config-playbook.outcome != 'skipped' }} run: | diff --git a/src/playbook/Configuration/atlas/start.yml b/src/playbook/Configuration/atlas/start.yml index cc1bd6a9f0..c6e037a21a 100644 --- a/src/playbook/Configuration/atlas/start.yml +++ b/src/playbook/Configuration/atlas/start.yml @@ -3,6 +3,10 @@ title: Initial Configuration description: Copies Atlas folders/files, installs dependencies and performs the preliminary configuration privilege: TrustedInstaller actions: + # AME Wizard Live Log for development Playbooks + # Do not change the line position of this, otherwise things will break + # - !cmd: {command: 'start "AME Wizard Live Log" PowerShell -NoP -C "gc -Wait Logs\TIOutput.txt | Write-Output; pause"', baseDir: true, wait: false} + # Prevent annoying notifications during deployment - !registryValue: {path: 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance', value: 'Enabled', type: REG_DWORD, data: '0'} diff --git a/src/playbook/local-build.cmd b/src/playbook/local-build.cmd index f288bd2378..9ffbe9c686 100644 --- a/src/playbook/local-build.cmd +++ b/src/playbook/local-build.cmd @@ -9,11 +9,14 @@ $fileName = "Atlas Test" # if not, it will make something like "Atlas Test (1).apbx" $replaceOldPlaybook = $true +# add AME Wizard Live Log window +$liveLog = $true + # choose to get Atlas dependencies or not to speed up installation $removeDependencies = $false # choose not to modify certain aspects from playbook.conf $removeRequirements = $false -$removeBuildRequirement = $true +$removeWinverRequirement = $true # not recommended to disable as it will show malicious $removeProductCode = $true @@ -81,29 +84,42 @@ try { # 0.6.5 has a bug where it will crash without the 'Requirements' field, but all of the requirements are removed # "" and # "" if ($removeRequirements) {$patterns += ""} - if ($removeBuildRequirement) {$patterns += "", "", ""} + if ($removeWinverRequirement) {$patterns += "", "", ""} if ($removeProductCode) {$patterns += ""} $newContent = Get-Content "playbook.conf" | Where-Object { $_ -notmatch ($patterns -join '|') } $newContent | Set-Content "$tempPlaybookConf" -Force - if ($removeDependencies) { + if ($removeDependencies -or $liveLog) { $startYML = "$PWD\$ymlPath" if (Test-Path $startYML -PathType Leaf) { Copy-Item -Path $startYML -Destination $tempStartYML -Force - $content = Get-Content -Path $tempStartYML -Raw + $content = Get-Content -Path $tempStartYML + + if ($liveLog) { + # uncomment the 8th line (7 in PowerShell because arrays are zero-based) + if ($content.Count -gt 7) { + $content[7] = $content[7] -replace ' #', '' + } + } - $startMarker = " ################ NO LOCAL BUILD ################" - $endMarker = " ################ END NO LOCAL BUILD ################" + if ($removeDependencies) { + # has to be raw for removing dependencies + $content = $content -join "`n" - $startIndex = $content.IndexOf($startMarker) - $endIndex = $content.IndexOf($endMarker) + $startMarker = " ################ NO LOCAL BUILD ################" + $endMarker = " ################ END NO LOCAL BUILD ################" - if ($startIndex -ge 0 -and $endIndex -ge 0) { - $newContent = $content.Substring(0, $startIndex) + $content.Substring($endIndex + $endMarker.Length) - Set-Content -Path $tempStartYML -Value $newContent + $startIndex = $content.IndexOf($startMarker) + $endIndex = $content.IndexOf($endMarker) + + if ($startIndex -ge 0 -and $endIndex -ge 0) { + $content = $content.Substring(0, $startIndex) + $content.Substring($endIndex + $endMarker.Length) + } } + + Set-Content -Path $tempStartYML -Value $content } }