anchor.diff: -﻿#if COMPILED
  -namespace ModelMod
  -#endif
  +﻿namespace ModelMod
   
  +open System
  +open System.IO
   open Microsoft.Win32
   
   module RegKeys = 
       let DocRoot = "DocRoot"
  +    let ProfExePath = "ExePath"
       let ProfRunModeFull = "RunModeFull"
       let ProfSnapshotProfile = "SnapshotProfile"
       let ProfInputProfile = "InputProfile"
  
positive.code:         | null -> def
          | _ -> res
  
      let GetExeHash (exePath:string):string =
          string (exePath.ToUpperInvariant().GetHashCode())
  
      let Load (exePath:string):CoreTypes.RunConfig = 
          let exehash = GetExeHash exePath
          let profRoot = mmRoot + "\\Profiles\\" + exehash
  
          let dwordAsBool dw = 
              if (int dw > 0) then true else false
  
          log.Info "Searching for configuration data under key %A for executable %A" profRoot exePath
  
          { 
              CoreTypes.RunConfig.DocRoot = Regget(mmRoot,RegKeys.DocRoot,"") :?> string
              RunModeFull = dwordAsBool ( Regget(profRoot,RegKeys.ProfRunModeFull, 1) :?> int )
              InputProfile = Regget(profRoot,RegKeys.ProfInputProfile, "") :?> string
              SnapshotProfile = Regget(profRoot,RegKeys.ProfSnapshotProfile, "") :?> string
          }
  
  
  
negative.code: module RegConfig =
      let private log = Logging.GetLogger("RegConfig")
  
      // not using path.combine here; has some weird behavior: System.IO.Path.Combine(@"a",@"\b") -> "\b"
      // however, this doesn't handle the case where a or b has more than one consecutive \
      let (@@) (a:string) (b:string) = 
          let aEndsWithBS = a.EndsWith(@"\")
          let bStartsWithBS = b.StartsWith(@"\")
          
          match aEndsWithBS,bStartsWithBS with
          | true,true -> a + b.Substring(1) 
          | true,false 
          | false,true -> a + b
          | false,false -> a + @"\" + b
  
      let private mmHive = @"HKEY_CURRENT_USER"
      let private mmRoot = @"Software\ModelMod"
      let private mmHiveRoot = mmHive @@ mmRoot
      let private mmProfRoot = mmRoot @@ "Profiles"
      let private mmProfHiveRoot = mmHive @@ mmProfRoot
      let private mmProfHiveDefaultsKey = mmProfHiveRoot @@ "ProfileDefaults"
  
      let private Regget(key,value,def) =
          let res = Registry.GetValue(key, value, def)
  