Skip to content

Commit

Permalink
Merge branch 'main' into na-upgradability
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Jul 18, 2024
2 parents 4167195 + c836877 commit 61caee9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 18 deletions.
33 changes: 30 additions & 3 deletions src/local-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ param (

$removals | % { Set-Variable -Name "remove$_" -Value $true }

# Function to convert paths for convienience, needed for Linux/macOS
# Convert paths for convienience, needed for Linux/macOS
function Seperator {
return $args -replace '\\', "$([IO.Path]::DirectorySeparatorChar)"
}
Expand Down Expand Up @@ -101,7 +101,7 @@ while ($true) { Get-Content -Wait -LiteralPath $a -EA 0 | Write-Output; Start-Sl

Set-Content -Path $tempCustomYmlPath -Value $newCustomYml
} else {
Write-Error "Can't find "$customYmlPath", not adding live log."
Write-Error "Can't find '$customYmlPath', not adding live log."
}
}

Expand All @@ -120,10 +120,37 @@ while ($true) { Get-Content -Wait -LiteralPath $a -EA 0 | Write-Output; Start-Sl

Set-Content -Path $tempStartYmlPath -Value $newStartYml
} else {
Write-Error "Can't find "$startYmlPath", not removing dependencies."
Write-Error "Can't find '$startYmlPath', not removing dependencies."
}
}

$oemYmlPath = Seperator "Configuration\tweaks\misc\config-oem-information.yml"
$tempOemYmlPath = Seperator "$playbookTemp\$oemYmlPath"
if (Test-Path $oemYmlPath -PathType Leaf) {
$confXml = ([xml](Get-Content "playbook.conf" -Raw -EA 0)).Playbook
$version = "v$($confXml.Version)"
if ($version -like '*.*.*') {
if ($confXml.Title | Select-String '(dev)' -Quiet) {
$version = $version + ' (dev)'
}

$oemToReplace = 'AtlasVersionUndefined'
$oemYml = Get-Content -Path $oemYmlPath -Raw
$tempOemYml = $oemYml -replace $oemToReplace, $version

if ($tempOemYml -eq $oemYml) {
Write-Error "Couldn't find OEM string '$oemToReplace'."
} else {
New-Item (Split-Path $tempOemYmlPath) -ItemType Directory -Force | Out-Null
Set-Content -Path $tempOemYmlPath -Value $tempOemYml
}
} else {
Write-Error "Can't XML in 'playbook.conf', not setting OEM version."
}
} else {
Write-Error "Can't find '$oemYmlPath', not setting OEM version."
}

# exclude files
$excludeFiles = @(
"local-build.*",
Expand Down
19 changes: 14 additions & 5 deletions src/playbook/Configuration/tweaks/misc/config-oem-information.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@
title: Configure OEM Information
description: Configures OEM information to contain the Atlas version and the Atlas Discord server
actions:
- !registryValue:
path: 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation'
value: 'Model'
data: 'AtlasOS v0.5.0 (dev)'
type: REG_SZ
- !powerShell:
command: |
$version = 'AtlasVersionUndefined'
Write-Output 'Setting boot entry name...'
bcdedit /set description """AtlasOS $(('10', '11')[[int]([System.Environment]::OSVersion.Version.Build -ge 22000)]) $version"""
Write-Output 'Setting other versioned OEM information...'
$reportedVer = """Atlas Playbook $version"""
# Shows in Settings
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation' -Name 'Model' -Value $reportedVer -Force
# Shows in winver
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name 'RegisteredOrganization' -Value $reportedVer -Force
wait: true
- !registryValue:
path: 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation'
value: 'Manufacturer'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,3 @@ actions:

# Use legacy boot menu
- !run: {exe: 'bcdedit', args: '/set {bootloadersettings} bootmenupolicy legacy'}

# Set boot manager descriptions
- !run:
exe: 'bcdedit'
args: '/set description "AtlasOS 10"'
builds: [ '<22000' ]
- !run:
exe: 'bcdedit'
args: '/set description "AtlasOS 11"'
builds: [ '>=22000' ]
5 changes: 5 additions & 0 deletions src/release-zip/Read the Install Guide First!.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11
[InternetShortcut]
IDList=
URL=https://docs.atlasos.net/getting-started/installation/

0 comments on commit 61caee9

Please sign in to comment.