mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Set RootDir depending on Salt Version
This commit is contained in:
parent
fdbe7db9ee
commit
4d33f86007
1 changed files with 8 additions and 1 deletions
|
@ -353,7 +353,14 @@ if ($RunService.ToLower() -eq "true") {
|
||||||
|
|
||||||
$ConfiguredAnything = $False
|
$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"
|
$SaltRegKey = "HKLM:\SOFTWARE\Salt Project\Salt"
|
||||||
if (Test-Path -Path $SaltRegKey) {
|
if (Test-Path -Path $SaltRegKey) {
|
||||||
if ($null -ne (Get-ItemProperty $SaltRegKey).root_dir) {
|
if ($null -ne (Get-ItemProperty $SaltRegKey).root_dir) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue