Skip to content

Commit

Permalink
Check if registry file exists before copying file over (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyvenugo committed May 24, 2019
1 parent 1c51762 commit 2ccf90c
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -25,9 +25,13 @@ HRESULT PrepareDevirtualizedRegistry::ExtractRegistry()
{
std::wstring registryFilePath = m_msixRequest->GetPackageDirectoryPath() + registryDatFile;
std::wstring registryFileCopyPath = m_msixRequest->GetPackageDirectoryPath() + registryDatFileCopy;
if (!CopyFile(registryFilePath.c_str(), registryFileCopyPath.c_str(), false))

if (std::experimental::filesystem::exists(registryFilePath))
{
return HRESULT_FROM_WIN32(GetLastError());
if (!CopyFile(registryFilePath.c_str(), registryFileCopyPath.c_str(), false))
{
return HRESULT_FROM_WIN32(GetLastError());
}
}

std::shared_ptr<RegistryDevirtualizer> registryDevirtualizer;
Expand Down

0 comments on commit 2ccf90c

Please sign in to comment.