Configuration Precedence
Detailed precedence rules for AutoDoctor settings across registry, INI files, environment variables, and defaults for both agent and API runtime.
Categories:
Who This Is For
- Operators managing policy-controlled deployments.
- Developers debugging environment drift.
Agent Root and DB Precedence
For PowerShell agent path resolution:
AUTO_DOCTOR_HOME(if set)- Project-relative root when running from source
C:\ProgramData\AutoDoctor
DB path precedence:
AUTO_DOCTOR_DB_PATHroot\db\autodoctor.db
API Host/Port Precedence
Both agent API-health probe and API launcher follow host/port precedence:
- Windows registry:
HKLM\Software\AutoDoctor(APIHost,APIPort) autodoctor.ini([Server] host,port)- Environment:
AUTO_DOCTOR_API_HOST,AUTO_DOCTOR_API_PORT - Defaults:
127.0.0.1:8000
INI Discovery Precedence (API Launcher)
run_autodoctor.py checks INI in this order:
AUTO_DOCTOR_CONFIG_INIroot\config\autodoctor.ini- Local fallback near API script
Service Runtime Mode Precedence
Installer writes Service.mode in INI:
bundledsystem_python
Service wrapper reads this mode and selects child launch strategy accordingly.
Practical Examples
Example A: Registry override beats INI
- Registry sets
APIPort=9000 - INI sets
port=8000 - Result: API and probe use
9000
Example B: Environment host only
- No registry/INI host
AUTO_DOCTOR_API_HOST=0.0.0.0- Probe normalizes to
127.0.0.1
Example C: Source mode with explicit home
- Running in repo but
AUTO_DOCTOR_HOME=D:\Lab\AutoDoctor - Result: DB/reports/logs/telemetry move to
D:\Lab\AutoDoctor\...
Validation Commands
Get-ItemProperty -Path "HKLM:\Software\AutoDoctor" -ErrorAction SilentlyContinue
Get-Content "C:\ProgramData\AutoDoctor\config\autodoctor.ini"
$env:AUTO_DOCTOR_API_HOST
$env:AUTO_DOCTOR_API_PORT
Next Steps
- Review Service Runtime Modes
- Use Configuration Reference for key-by-key details