Skip to content

Commit

Permalink
Set RootDir depending on Salt Version
Browse files Browse the repository at this point in the history
  • Loading branch information
twangboy authored and s0undt3ch committed Jul 26, 2023
1 parent fdbe7db commit 4d33f86
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bootstrap-salt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,14 @@ if ($RunService.ToLower() -eq "true") {

$ConfiguredAnything = $False

$RootDir = "C:\salt"
# Detect older version of Salt to determing default RootDir
if ($majorVersion -lt 3004) {
$RootDir = "$env:SystemDrive`:\salt"
} else {
$RootDir = "$env:ProgramData\Salt Project\Salt"
}

# Check for existing installation where RootDir is stored in the registry
$SaltRegKey = "HKLM:\SOFTWARE\Salt Project\Salt"
if (Test-Path -Path $SaltRegKey) {
if ($null -ne (Get-ItemProperty $SaltRegKey).root_dir) {
Expand Down

0 comments on commit 4d33f86

Please sign in to comment.