| 218 | } |
| 219 | |
| 220 | static void GetAppPath(CString& app_path) |
| 221 | { |
| 222 | app_path = ""; |
| 223 | HKEY hSetup; |
| 224 | DWORD dwType, dwSize; |
| 225 | if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, szSetup, |
| 226 | 0, KEY_READ, &hSetup) == ERROR_SUCCESS && |
| 227 | RegQueryValueEx(hSetup, szPath, NULL, &dwType, NULL, |
| 228 | &dwSize) == ERROR_SUCCESS && dwType == REG_SZ) { |
| 229 | unsigned char *path = new unsigned char[dwSize]; |
| 230 | if (RegQueryValueEx(hSetup, "Path", NULL, &dwType, path, |
| 231 | &dwSize) == ERROR_SUCCESS) { |
| 232 | app_path = path; |
| 233 | delete[] path; |
| 234 | } |
| 235 | RegCloseKey(hSetup); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | #if 0 |
| 240 | static void GetTclPathAndVersion(CString& tcl_path, CString& tcl_version) |