Registry reg;
r = reg.Construct(__regPath, "a+");
- SysAssertf(!IsFailed(r), "[%s] Constructing the registry file (%ls) has failed.", GetErrorMessage(r), __regPath.GetPointer());
+ if (r == E_IO)
+ {
+ r = File::Remove(__regPath);
+ SysAssertf(!IsFailed(r), "[%s] Removing the registry file (%ls) has failed.", GetErrorMessage(r), __regPath.GetPointer());
+
+ r = reg.Construct(__regPath, "a+");
+ SysAssertf(!IsFailed(r), "[%s] Constructing the registry file (%ls) has failed.", GetErrorMessage(r), __regPath.GetPointer());
+ }
FileLock* pReglock = reg.LockN(FILE_LOCK_EXCLUSIVE);
SysTryLog(NID_APP, pReglock != null, "[%s] Locking the app registry file has failed.", GetErrorMessage(GetLastResult()));