updated the way vpc generating guid

This commit is contained in:
Fisual
2021-12-12 16:52:07 +07:00
parent 5008a489ae
commit 0fe2cfa99f
4 changed files with 27 additions and 41 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -40,28 +40,21 @@ public:
{
firstVer = 10;
}
else if ( g_pVPC->BUse2008() )
{
firstVer = 9;
}
for (int vsVer = firstVer; vsVer <= lastVer; ++vsVer)
{
// Handle both VisualStudio and VCExpress (used by some SourceSDK customers)
RegStartPoint searchPoints[] =
const char* productName[] =
{
{ HKEY_LOCAL_MACHINE, "Software\\Microsoft\\VisualStudio\\%d.0\\Projects" }, // Visual Studio Professional
{ HKEY_LOCAL_MACHINE, "Software\\Microsoft\\VCExpress\\%d.0\\Projects" }, // VC Express 2010 and 2012
{ HKEY_CURRENT_USER, "Software\\Microsoft\\WDExpress\\%d.0_Config\\Projects" }, // WinDev Express -- VS Express starting with VS 2013
"VisualStudio",
"VCExpress",
};
for ( int j = 0; j < ARRAYSIZE(searchPoints); ++j )
for (int productNumber = 0; productNumber < ARRAYSIZE(productName); ++productNumber)
{
RegStartPoint& searchPoint = searchPoints[ j ];
char pRegKeyName[1000];
V_snprintf( pRegKeyName, ARRAYSIZE(pRegKeyName), searchPoint.baseDir, vsVer );
LONG ret = RegOpenKeyEx( searchPoint.baseKey, pRegKeyName, 0, KEY_READ, &hKey );
if ( ret != ERROR_SUCCESS )
g_pVPC->VPCError( "Unable to open registry key %s.", pRegKeyName );
V_snprintf(pRegKeyName, ARRAYSIZE(pRegKeyName), "Software\\Microsoft\\%s\\%d.0\\Projects", productName[productNumber], vsVer);
LONG ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, pRegKeyName, 0, KEY_READ, &hKey);
//if ( ret != ERROR_SUCCESS )
// g_pVPC->VPCError( "Unable to open registry key %s.", pRegKeyName );
for (int i = 0; i < 200; i++)
{
@@ -93,13 +86,6 @@ public:
RegCloseKey(hKey);
}
//{
// char szKeyName[MAX_PATH];
// DWORD dwKeyNameSize = sizeof(szKeyName);
// V_strncpy(szSolutionGUID, szKeyName, ARRAYSIZE(szSolutionGUID));
// return;
//}
}
g_pVPC->VPCError("Unable to find RegKey for .vcproj or .vcxproj files in solutions.");
}