DXGL r22 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r21‎ | r22 | r23 >
Date:23:47, 10 December 2011
Author:admin
Status:new
Tags:
Comment:
Fix adding applications
Modified paths:
  • /dxglcfg/dxglcfg.cpp (modified) (history)

Diff [purge]

Index: dxglcfg/dxglcfg.cpp
@@ -73,6 +73,7 @@
7474 DWORD AddApp(LPTSTR path, bool copyfile, bool admin)
7575 {
7676 bool installed = false;
 77+ bool dxgl_installdir = false;
7778 bool old_dxgl = false;
7879 tstring command;
7980 if(copyfile)
@@ -84,6 +85,7 @@
8586 LONG error = RegOpenKeyEx(HKEY_LOCAL_MACHINE,_T("Software\\DXGL"),0,KEY_READ,&hKeyInstall);
8687 if(error == ERROR_SUCCESS)
8788 {
 89+ dxgl_installdir = true;
8890 error = RegQueryValueEx(hKeyInstall,_T("InstallDir"),NULL,NULL,(LPBYTE)installpath,&sizeout);
8991 if(error == ERROR_SUCCESS) installed = true;
9092 }
@@ -92,7 +94,8 @@
9395 {
9496 GetModuleFileName(NULL,installpath,MAX_PATH+1);
9597 }
96 - (_tcsrchr(installpath,_T('\\')))[1] = 0;
 98+ if(dxgl_installdir) _tcscat(installpath,_T("\\"));
 99+ else (_tcsrchr(installpath,_T('\\')))[1] = 0;
97100 _tcscat(installpath,_T("ddraw.dll"));
98101 _tcsncpy(destpath,path,MAX_PATH+1);
99102 (_tcsrchr(destpath,_T('\\')))[1] = 0;