Index: Help/index.html |
— | — | @@ -1,4 +1,4 @@ |
2 | Â | -<!DOCTYPE html>
|
 | 2 | +<!DOCTYPE html>
|
3 | 3 | <!--[if IE 6]>
|
4 | 4 | <html id="ie6" lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
|
5 | 5 | <![endif]-->
|
— | — | @@ -31,13 +31,6 @@ |
32 | 32 | <h2 id="site-description"></h2>
|
33 | 33 | </hgroup>
|
34 | 34 | <img src="images/dxgl-header.png" width="940" height="198" alt="DXGL" />
|
35 | Â | - <div class="only-search with-image">
|
36 | Â | - <form method="get" id="searchform" action="https://www.dxgl.info/">
|
37 | Â | - <label for="s" class="assistive-text">Search</label>
|
38 | Â | - <input type="text" class="field" name="s" id="s" placeholder="Search" />
|
39 | Â | - <input type="submit" class="submit" name="submit" id="searchsubmit" value="Search" />
|
40 | Â | - </form>
|
41 | Â | - </div>
|
42 | 35 | </header><!-- #branding -->
|
43 | 36 |
|
44 | 37 |
|
— | — | @@ -50,7 +43,7 @@ |
51 | 44 | </header><!-- .entry-header -->
|
52 | 45 | <div class="entry-content">
|
53 | 46 | Notice: Offline help is not currently available. To get help for DXGL please go to
|
54 | Â | - <a href="https://www.dxgl.info/help/">https://www.dxgl.info/help</a> to access the online help.
|
 | 47 | + <a href="https://www.dxgl.info/help.php?v=0.5.13">https://www.dxgl.info/help.php?v=0.5.13</a> to access the online help.
|
55 | 48 | </div><!-- .entry-content -->
|
56 | 49 | <footer class="entry-meta">
|
57 | 50 | </footer><!-- .entry-meta -->
|
— | — | @@ -61,7 +54,7 @@ |
62 | 55 | <footer id="colophon" role="contentinfo">
|
63 | 56 | <div id="supplementary" class="one">
|
64 | 57 | <div id="first" class="widget-area" role="complementary">
|
65 | Â | - <aside id="text-3" class="widget widget_text"><h3 class="widget-title">DXGL Copyright © 2011-2017 William Feely</h3>
|
 | 58 | + <aside id="text-3" class="widget widget_text"><h3 class="widget-title">DXGL Copyright © 2011-2018 William Feely</h3>
|
66 | 59 | </aside> </div><!-- #first .widget-area -->
|
67 | 60 | </div><!-- #supplementary -->
|
68 | 61 | </footer><!-- #colophon -->
|
Index: cfgmgr/cfgmgr.c |
— | — | @@ -1363,9 +1363,120 @@ |
1364 | 1364 | }
|
1365 | 1365 | }
|
1366 | 1366 |
|
 | 1367 | +// Checks for obsolete DXGL Test registry entry and renames it to DXGLCFG.
|
 | 1368 | +
|
 | 1369 | +void UpgradeDXGLTestToDXGLCfg()
|
 | 1370 | +{
|
 | 1371 | + Sha256Context sha_context;
|
 | 1372 | + SHA256_HASH sha256;
|
 | 1373 | + TCHAR sha256string[65];
|
 | 1374 | + TCHAR installpath[MAX_PATH + 1];
|
 | 1375 | + TCHAR profilepath[MAX_PATH + 80];
|
 | 1376 | + TCHAR destpath[MAX_PATH + 80];
|
 | 1377 | + LONG error;
|
 | 1378 | + DWORD sizeout = (MAX_PATH + 1) * sizeof(TCHAR);
|
 | 1379 | + DWORD sizeout2;
|
 | 1380 | + HKEY hKeyInstall = NULL;
|
 | 1381 | + HKEY hKeyProfile = NULL;
|
 | 1382 | + HKEY hKeyDest = NULL;
|
 | 1383 | + DWORD numvalue;
|
 | 1384 | + DWORD olddirsize = 1024;
|
 | 1385 | + TCHAR *olddir = NULL;
|
 | 1386 | + DWORD oldvaluesize = 1024;
|
 | 1387 | + TCHAR *oldvalue = NULL;
|
 | 1388 | + DWORD regtype;
|
 | 1389 | + int i;
|
 | 1390 | + error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\DXGL"), 0, KEY_READ, &hKeyInstall);
|
 | 1391 | + if (error == ERROR_SUCCESS)
|
 | 1392 | + {
|
 | 1393 | + error = RegQueryValueEx(hKeyInstall, _T("InstallDir"), NULL, NULL, (LPBYTE)installpath, &sizeout);
|
 | 1394 | + if (error == ERROR_SUCCESS)
|
 | 1395 | + {
|
 | 1396 | + _tcslwr(installpath);
|
 | 1397 | + Sha256Initialise(&sha_context);
|
 | 1398 | + Sha256Update(&sha_context, installpath, _tcslen(installpath));
|
 | 1399 | + Sha256Finalise(&sha_context, &sha256);
|
 | 1400 | + for (i = 0; i < (256 / 8); i++)
|
 | 1401 | + {
|
 | 1402 | + sha256string[i * 2] = (TCHAR)hexdigit(sha256.bytes[i] >> 4);
|
 | 1403 | + sha256string[(i * 2) + 1] = (TCHAR)hexdigit(sha256.bytes[i] & 0xF);
|
 | 1404 | + }
|
 | 1405 | + sha256string[256 / 4] = 0;
|
 | 1406 | + _tcscpy(profilepath, _T("Software\\DXGL\\Profiles\\dxgltest.exe-"));
|
 | 1407 | + _tcscat(profilepath, sha256string);
|
 | 1408 | + _tcscpy(destpath, _T("Software\\DXGL\\Profiles\\dxglcfg.exe-"));
|
 | 1409 | + _tcscat(destpath, sha256string);
|
 | 1410 | + error = RegOpenKeyEx(HKEY_CURRENT_USER, profilepath, 0, KEY_READ, &hKeyProfile);
|
 | 1411 | + if (error == ERROR_SUCCESS)
|
 | 1412 | + {
|
 | 1413 | + error = RegOpenKeyEx(HKEY_CURRENT_USER, destpath, 0, KEY_READ, &hKeyDest);
|
 | 1414 | + if (error == ERROR_SUCCESS) // Clear spurious DXGLCfg entry
|
 | 1415 | + {
|
 | 1416 | + RegCloseKey(hKeyDest);
|
 | 1417 | + RegDeleteKey(HKEY_CURRENT_USER, destpath);
|
 | 1418 | + }
|
 | 1419 | + // Copy over to new key
|
 | 1420 | + error = RegCreateKeyEx(HKEY_CURRENT_USER, destpath, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKeyDest, NULL);
|
 | 1421 | + if (error == ERROR_SUCCESS)
|
 | 1422 | + {
|
 | 1423 | + olddir = malloc(olddirsize);
|
 | 1424 | + oldvalue = malloc(oldvaluesize);
|
 | 1425 | + numvalue = 0;
|
 | 1426 | + do
|
 | 1427 | + {
|
 | 1428 | + sizeout = olddirsize;
|
 | 1429 | + sizeout2 = oldvaluesize;
|
 | 1430 | + error = RegEnumValue(hKeyProfile, numvalue, olddir, &sizeout, NULL, ®type, oldvalue, &sizeout2);
|
 | 1431 | + if (error == ERROR_MORE_DATA)
|
 | 1432 | + {
|
 | 1433 | + if (sizeout > olddirsize)
|
 | 1434 | + {
|
 | 1435 | + olddirsize = sizeout;
|
 | 1436 | + olddir = realloc(olddir, olddirsize);
|
 | 1437 | + if (!olddir)
|
 | 1438 | + {
|
 | 1439 | + MessageBox(NULL, _T("Out of memory updating registry"), _T("Fatal error"), MB_ICONSTOP | MB_OK);
|
 | 1440 | + ExitProcess(error);
|
 | 1441 | + }
|
 | 1442 | + }
|
 | 1443 | + if (sizeout2 > oldvaluesize)
|
 | 1444 | + {
|
 | 1445 | + oldvaluesize = sizeout2;
|
 | 1446 | + oldvalue = realloc(oldvalue, oldvaluesize);
|
 | 1447 | + if (!oldvalue)
|
 | 1448 | + {
|
 | 1449 | + MessageBox(NULL, _T("Out of memory updating registry"), _T("Fatal error"), MB_ICONSTOP | MB_OK);
|
 | 1450 | + ExitProcess(error);
|
 | 1451 | + }
|
 | 1452 | + }
|
 | 1453 | + sizeout = olddirsize;
|
 | 1454 | + sizeout2 = oldvaluesize;
|
 | 1455 | + error = RegEnumValue(hKeyProfile, numvalue, olddir, &sizeout, NULL, ®type, oldvalue, &sizeout2);
|
 | 1456 | + }
|
 | 1457 | + if (error == ERROR_SUCCESS)
|
 | 1458 | + {
|
 | 1459 | + if (_tcsnicmp(olddir, _T("InstallPaths"), sizeout))
|
 | 1460 | + RegSetValueEx(hKeyDest, olddir, 0, regtype, oldvalue, sizeout2);
|
 | 1461 | + }
|
 | 1462 | + numvalue++;
|
 | 1463 | + } while (error == ERROR_SUCCESS);
|
 | 1464 | + RegCloseKey(hKeyDest);
|
 | 1465 | + free(olddir);
|
 | 1466 | + free(oldvalue);
|
 | 1467 | + }
|
 | 1468 | + // Delete old key
|
 | 1469 | + RegCloseKey(hKeyProfile);
|
 | 1470 | + RegDeleteKey(HKEY_CURRENT_USER, profilepath);
|
 | 1471 | + }
|
 | 1472 | + }
|
 | 1473 | + }
|
 | 1474 | + if (hKeyInstall) RegCloseKey(hKeyInstall);
|
 | 1475 | +}
|
 | 1476 | +
|
 | 1477 | +
|
1367 | 1478 | /**
|
1368 | 1479 | * Checks the registry configuration version and if outdated upgrades to
|
1369 | Â | - * the latest version - currently version 1
|
 | 1480 | + * the latest version - currently version 2
|
1370 | 1481 | * Alpha version configuration is assumed to be version 0.
|
1371 | 1482 | */
|
1372 | 1483 | void UpgradeConfig()
|
Index: cfgmgr/cfgmgr.h |
— | — | @@ -130,6 +130,7 @@ |
131 | 131 | void GetConfig(DXGLCFG *cfg, DXGLCFG *mask, LPCTSTR name);
|
132 | 132 | void SetConfig(const DXGLCFG *cfg, const DXGLCFG *mask, LPCTSTR name);
|
133 | 133 | void GetDirFromPath(LPTSTR path);
|
 | 134 | +void UpgradeDXGLTestToDXGLCfg();
|
134 | 135 | void UpgradeConfig();
|
135 | 136 | void ReadAppINIOptions(LPCTSTR path, app_ini_options *options);
|
136 | 137 | void SaveWindowSettings(const DXGLCFG *cfg);
|
Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -4047,6 +4047,7 @@ |
4048 | 4048 | if (!_tcsnicmp(lpCmdLine, _T("profile_install"), 15))
|
4049 | 4049 | {
|
4050 | 4050 | // FIXME: Remove DXGL Config profile
|
 | 4051 | + UpgradeDXGLTestToDXGLCfg();
|
4051 | 4052 | LPDIRECTDRAW lpdd;
|
4052 | 4053 | DirectDrawCreate(NULL, &lpdd, NULL);
|
4053 | 4054 | IDirectDraw_Release(lpdd);
|