Merge topic 'fix-9629-add-unicode-nsis-reg-key'

668dda0 CPack: Add automatic detection of the Unicode makensis (#9629)
This commit is contained in:
David Cole 2012-10-31 16:33:27 -04:00 committed by CMake Topic Stage
commit 72632f885c
1 changed files with 19 additions and 7 deletions

View File

@ -356,18 +356,30 @@ int cmCPackNSISGenerator::InitializeInternal()
<< std::endl); << std::endl);
std::vector<std::string> path; std::vector<std::string> path;
std::string nsisPath; std::string nsisPath;
bool gotRegValue = true; bool gotRegValue = false;
#ifdef _WIN32 #ifdef _WIN32
if ( !cmsys::SystemTools::ReadRegistryValue( if ( !gotRegValue && cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath,
cmsys::SystemTools::KeyWOW64_32) )
{
gotRegValue = true;
}
if ( !gotRegValue && cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath) )
{
gotRegValue = true;
}
if ( !gotRegValue && cmsys::SystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath, "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath,
cmsys::SystemTools::KeyWOW64_32) ) cmsys::SystemTools::KeyWOW64_32) )
{ {
if ( !cmsys::SystemTools::ReadRegistryValue( gotRegValue = true;
"HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath) ) }
{ if ( !gotRegValue && cmsys::SystemTools::ReadRegistryValue(
gotRegValue = false; "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath) )
} {
gotRegValue = true;
} }
if (gotRegValue) if (gotRegValue)