void CInfo::Load() { SetDefault(); CS_LOCK CKey key; if (OpenMainKey(key, kOptionsInfoKeyName) != ERROR_SUCCESS) return; UInt32 dirType; if (key.QueryValue(kWorkDirType, dirType) != ERROR_SUCCESS) return; switch (dirType) { case NMode::kSystem: case NMode::kCurrent: case NMode::kSpecified: Mode = (NMode::EEnum)dirType; } UString pathU; if (key.QueryValue(kWorkDirPath, pathU) == ERROR_SUCCESS) Path = us2fs(pathU); else { Path.Empty(); if (Mode == NMode::kSpecified) Mode = NMode::kSystem; } key.GetValue_IfOk(kTempRemovableOnly, ForRemovableOnly); }
void CInfo::Load() { PathMode = NPathMode::kCurPaths; PathMode_Force = false; OverwriteMode = NOverwriteMode::kAsk; OverwriteMode_Force = false; Paths.Clear(); CS_LOCK CKey key; if (OpenMainKey(key, kKeyName) != ERROR_SUCCESS) return; key.GetValue_Strings(kPathHistory, Paths); UInt32 v; if (key.QueryValue(kExtractMode, v) == ERROR_SUCCESS && v <= NPathMode::kAbsPaths) { PathMode = (NPathMode::EEnum)v; PathMode_Force = true; } if (key.QueryValue(kOverwriteMode, v) == ERROR_SUCCESS && v <= NOverwriteMode::kRenameExisting) { OverwriteMode = (NOverwriteMode::EEnum)v; OverwriteMode_Force = true; } Key_Get_BoolPair_true(key, kSplitDest, SplitDest); Key_Get_BoolPair(key, kElimDup, ElimDup); // Key_Get_BoolPair(key, kAltStreams, AltStreams); Key_Get_BoolPair(key, kNtSecur, NtSecurity); Key_Get_BoolPair(key, kShowPassword, ShowPassword); }
bool Read_ShowPassword() { CS_LOCK CKey key; bool showPassword = false; if (OpenMainKey(key, kKeyName) != ERROR_SUCCESS) return showPassword; key.GetValue_IfOk(kShowPassword, showPassword); return showPassword; }
void CInfo::Load() { ArcPaths.Clear(); Formats.Clear(); Level = 5; ArcType = L"7z"; ShowPassword = false; EncryptHeaders = false; CS_LOCK CKey key; if (OpenMainKey(key, kKeyName) != ERROR_SUCCESS) return; key.GetValue_Strings(kArcHistory, ArcPaths); { CKey optionsKey; if (optionsKey.Open(key, kOptionsKeyName, KEY_READ) == ERROR_SUCCESS) { CSysStringVector formatIDs; optionsKey.EnumKeys(formatIDs); for (int i = 0; i < formatIDs.Size(); i++) { CKey fk; CFormatOptions fo; fo.FormatID = formatIDs[i]; if (fk.Open(optionsKey, fo.FormatID, KEY_READ) == ERROR_SUCCESS) { GetRegString(fk, kOptions, fo.Options); GetRegString(fk, kMethod, fo.Method); GetRegString(fk, kEncryptionMethod, fo.EncryptionMethod); GetRegUInt32(fk, kLevel, fo.Level); GetRegUInt32(fk, kDictionary, fo.Dictionary); GetRegUInt32(fk, kOrder, fo.Order); GetRegUInt32(fk, kBlockSize, fo.BlockLogSize); GetRegUInt32(fk, kNumThreads, fo.NumThreads); Formats.Add(fo); } } } } UString a; if (key.QueryValue(kArchiver, a) == ERROR_SUCCESS) ArcType = a; key.GetValue_IfOk(kLevel, Level); key.GetValue_IfOk(kShowPassword, ShowPassword); key.GetValue_IfOk(kEncryptHeaders, EncryptHeaders); }
void CInfo::Load() { PathMode = NPathMode::kCurrentPathnames; OverwriteMode = NOverwriteMode::kAskBefore; ShowPassword = false; Paths.Clear(); CS_LOCK CKey key; if (OpenMainKey(key, kKeyName) != ERROR_SUCCESS) return; key.GetValue_Strings(kPathHistory, Paths); UInt32 v; if (key.QueryValue(kExtractMode, v) == ERROR_SUCCESS && v <= NPathMode::kNoPathnames) PathMode = (NPathMode::EEnum)v; if (key.QueryValue(kOverwriteMode, v) == ERROR_SUCCESS && v <= NOverwriteMode::kAutoRenameExisting) OverwriteMode = (NOverwriteMode::EEnum)v; key.GetValue_IfOk(kShowPassword, ShowPassword); }