1 | /* $Id: odininst.cpp,v 1.9 2001-08-11 09:34:11 sandervl Exp $ */
|
---|
2 | /*
|
---|
3 | * Odin WarpIn installation app
|
---|
4 | *
|
---|
5 | * Creates:
|
---|
6 | * - SYSTEMDIR\drivers
|
---|
7 | * - SYSTEMDIR\drivers\etc
|
---|
8 | * - WINDOWSDIR\SYSTEM
|
---|
9 | * - WINDOWSDIR\AppData
|
---|
10 | * - WINDOWSDIR\Cache
|
---|
11 | * - WINDOWSDIR\Cookies
|
---|
12 | * - WINDOWSDIR\Desktop
|
---|
13 | * - WINDOWSDIR\Favorites
|
---|
14 | * - WINDOWSDIR\Fonts
|
---|
15 | * - WINDOWSDIR\History
|
---|
16 | * - WINDOWSDIR\NetHood
|
---|
17 | * - WINDOWSDIR\My Documents
|
---|
18 | * - WINDOWSDIR\PrintHood
|
---|
19 | * - WINDOWSDIR\Recent
|
---|
20 | * - WINDOWSDIR\SendTo
|
---|
21 | * - WINDOWSDIR\Start Menu
|
---|
22 | * - WINDOWSDIR\Start Menu\Programs
|
---|
23 | * - WINDOWSDIR\Start Menu\Programs\Startup
|
---|
24 | * - WINDOWSDIR\ShellNew
|
---|
25 | * - x:\Program Files
|
---|
26 | * - x:\Program Files\Common Files
|
---|
27 | * - WINDOWSDIR\Temp
|
---|
28 | * - and a minimal system registry
|
---|
29 | *
|
---|
30 | * Copyright 1999-2001 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
31 | *
|
---|
32 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
33 | *
|
---|
34 | */
|
---|
35 | #include <os2win.h>
|
---|
36 | #include <string.h>
|
---|
37 | #include <stdio.h>
|
---|
38 | #include <ctype.h>
|
---|
39 | #include "winreg.h"
|
---|
40 | #include "global.h"
|
---|
41 | #include "winnt.h"
|
---|
42 | #include "winerror.h"
|
---|
43 | #include "winreg.h"
|
---|
44 | #include "winnls.h"
|
---|
45 | #include "debugtools.h"
|
---|
46 | #include <odininst.h>
|
---|
47 | #include <win\options.h>
|
---|
48 | #include <versionos2.h>
|
---|
49 | #include <time.h>
|
---|
50 |
|
---|
51 | BOOL CreateSystemDirectories();
|
---|
52 | BOOL SetupControlPanelKeys();
|
---|
53 | BOOL InitSystemAndRegistry();
|
---|
54 |
|
---|
55 | //******************************************************************************
|
---|
56 | //******************************************************************************
|
---|
57 | //[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows]
|
---|
58 | //"Directory"=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,00
|
---|
59 | //"SystemDirectory"=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,\
|
---|
60 | // 6d,33,32,00
|
---|
61 | //"ErrorMode"=dword:00000000
|
---|
62 | //"NoInteractiveServices"=dword:00000000
|
---|
63 | //"CSDVersion"=dword:00000300
|
---|
64 | BYTE ShutdownTime[] = {0x44,0x5e,0xf2,0xbb,0x84,0x41,0xbf,0x01};
|
---|
65 |
|
---|
66 | static char DIR_Windows[260];
|
---|
67 | static char DIR_System[260];
|
---|
68 |
|
---|
69 | //******************************************************************************
|
---|
70 | //******************************************************************************
|
---|
71 | int main(int argc, char *argv[])
|
---|
72 | {
|
---|
73 | InitSystemAndRegistry();
|
---|
74 | CreateSystemDirectories();
|
---|
75 | SetupControlPanelKeys();
|
---|
76 | return 0;
|
---|
77 | }
|
---|
78 | //******************************************************************************
|
---|
79 | //******************************************************************************
|
---|
80 | char *InternalGetWindowsDirectory()
|
---|
81 | {
|
---|
82 | static char fInit = FALSE;
|
---|
83 |
|
---|
84 | if(fInit == FALSE) {
|
---|
85 | GetWindowsDirectory(DIR_Windows, sizeof(DIR_Windows)-1);
|
---|
86 | fInit = TRUE;
|
---|
87 | }
|
---|
88 | return DIR_Windows;
|
---|
89 | }
|
---|
90 | //******************************************************************************
|
---|
91 | //******************************************************************************
|
---|
92 | char *InternalGetSystemDirectory()
|
---|
93 | {
|
---|
94 | static char fInit = FALSE;
|
---|
95 |
|
---|
96 | if(fInit == FALSE) {
|
---|
97 | GetSystemDirectory(DIR_System, sizeof(DIR_System)-1);
|
---|
98 | fInit = TRUE;
|
---|
99 | }
|
---|
100 | return DIR_System;
|
---|
101 | }
|
---|
102 | //******************************************************************************
|
---|
103 | //******************************************************************************
|
---|
104 | BOOL InitSystemAndRegistry()
|
---|
105 | {
|
---|
106 | HKEY hkey, hkey1;
|
---|
107 | char *buf;
|
---|
108 | DWORD val;
|
---|
109 | char digbuf[16];
|
---|
110 | char shellpath[260];
|
---|
111 |
|
---|
112 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Control\\Windows",&hkey)!=ERROR_SUCCESS) {
|
---|
113 | dprintf(("InitRegistry: Unable to register system information\n"));
|
---|
114 | return FALSE;
|
---|
115 | }
|
---|
116 | buf = InternalGetWindowsDirectory();
|
---|
117 | RegSetValueEx(hkey,"Directory",0,REG_BINARY, (LPBYTE)buf, strlen(buf)+1);
|
---|
118 | buf = InternalGetSystemDirectory();
|
---|
119 | RegSetValueEx(hkey,"SystemDirectory",0,REG_BINARY, (LPBYTE)buf, strlen(buf)+1);
|
---|
120 | val = 0;
|
---|
121 | RegSetValueEx(hkey,"ErrorMode",0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
122 | val = 0;
|
---|
123 | RegSetValueEx(hkey,"NoInteractiveServices",0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
124 | val = ODINNT_BUILD_NR;
|
---|
125 | RegSetValueEx(hkey,"CSDVersion",0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
126 | RegSetValueEx(hkey,"ShutdownTime",0,REG_DWORD, (LPBYTE)ShutdownTime, sizeof(ShutdownTime));
|
---|
127 | RegCloseKey(hkey);
|
---|
128 |
|
---|
129 | //Software\Microsoft\Windows\CurrentVersion\RunOnce
|
---|
130 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce",&hkey)!=ERROR_SUCCESS) {
|
---|
131 | dprintf(("InitRegistry: Unable to register system information (2)"));
|
---|
132 | return FALSE;
|
---|
133 | }
|
---|
134 | RegCloseKey(hkey);
|
---|
135 |
|
---|
136 | //System\CurrentControlSet\Control\Session Manager
|
---|
137 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"System\\CurrentControlSet\\Control\\Session Manager",&hkey)!=ERROR_SUCCESS) {
|
---|
138 | dprintf(("InitRegistry: Unable to register system information (2)"));
|
---|
139 | return FALSE;
|
---|
140 | }
|
---|
141 | RegCloseKey(hkey);
|
---|
142 |
|
---|
143 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\iexplore.exe",&hkey)!=ERROR_SUCCESS) {
|
---|
144 | dprintf(("InitRegistry: Unable to register system information (2)"));
|
---|
145 | return FALSE;
|
---|
146 | }
|
---|
147 | strcpy(shellpath, InternalGetWindowsDirectory());
|
---|
148 | strcat(shellpath, "\\IEXPLORE.EXE");
|
---|
149 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
|
---|
150 | RegCloseKey(hkey);
|
---|
151 |
|
---|
152 |
|
---|
153 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",&hkey)!=ERROR_SUCCESS) {
|
---|
154 | dprintf(("InitRegistry: Unable to register system information (2)"));
|
---|
155 | return FALSE;
|
---|
156 | }
|
---|
157 | buf = InternalGetSystemDirectory();
|
---|
158 | RegSetValueEx(hkey,"SystemRoot",0,REG_SZ, (LPBYTE)buf, strlen(buf)+1);
|
---|
159 | RegSetValueEx(hkey,"PathName",0,REG_SZ, (LPBYTE)buf, strlen(buf)+1);
|
---|
160 | sprintf(digbuf, "%d", ODINNT_BUILD_NR);
|
---|
161 | RegSetValueEx(hkey,"CurrentBuildNumber",0,REG_SZ, (LPBYTE)digbuf, strlen(digbuf)+1);
|
---|
162 | RegSetValueEx(hkey,"CurrentType",0,REG_SZ, (LPBYTE)ODINNT_OSTYPE_UNI, sizeof(ODINNT_OSTYPE_UNI));
|
---|
163 | RegSetValueEx(hkey,"CSDVersion",0,REG_SZ, (LPBYTE)ODINNT_CSDVERSION, sizeof(ODINNT_CSDVERSION));
|
---|
164 | RegSetValueEx(hkey,"SoftwareType",0,REG_SZ, (LPBYTE)ODINNT_SOFTWARE_TYPE, sizeof(ODINNT_SOFTWARE_TYPE));
|
---|
165 |
|
---|
166 | sprintf(digbuf, "%d.%d", ODINNT_MAJOR_VERSION, ODINNT_MINOR_VERSION);
|
---|
167 | RegSetValueEx(hkey,"CurrentVersion",0,REG_SZ, (LPBYTE)digbuf, strlen(digbuf)+1);
|
---|
168 |
|
---|
169 | val = (DWORD)time(NULL); //todo: Correct format???
|
---|
170 | RegSetValueEx(hkey,"InstallDate",0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
171 |
|
---|
172 | RegCloseKey(hkey);
|
---|
173 | //todo: productid, registered org/owner, sourcepath,
|
---|
174 |
|
---|
175 | //#
|
---|
176 | //# Entries for OLE32 (COM/OLE base)
|
---|
177 | //#
|
---|
178 | //
|
---|
179 | //# OLE32's built-in marshaler, handles standard interfaces such as IClassFactory.
|
---|
180 | //# (PSFactoryBuffer = Proxy/Stub factory)
|
---|
181 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000320-0000-0000-C000-000000000046}]
|
---|
182 | //@="PSFactoryBuffer"
|
---|
183 | //
|
---|
184 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000320-0000-0000-C000-000000000046}\InProcServer32]
|
---|
185 | //@="ole32.dll"
|
---|
186 | //"ThreadingModel"="Both"
|
---|
187 | #define PSFACTORYBUFFER "PSFactoryBuffer"
|
---|
188 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00000320-0000-0000-C000-000000000046}",&hkey)!=ERROR_SUCCESS) {
|
---|
189 | goto initreg_error;
|
---|
190 | }
|
---|
191 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)PSFACTORYBUFFER, sizeof(PSFACTORYBUFFER));
|
---|
192 | RegCloseKey(hkey);
|
---|
193 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00000320-0000-0000-C000-000000000046}\\InProcServer32",&hkey)!=ERROR_SUCCESS) {
|
---|
194 | goto initreg_error;
|
---|
195 | }
|
---|
196 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)CLASS_OLE32DLL, sizeof(CLASS_OLE32DLL));
|
---|
197 | RegSetValueEx(hkey, COM_THREADMODEL, 0, REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
198 | RegCloseKey(hkey);
|
---|
199 |
|
---|
200 | //# IUnknown, the superclass for everything COM/OLE.
|
---|
201 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{00000000-0000-0000-C000-000000000046}]
|
---|
202 | //@="IUnknown"
|
---|
203 | //
|
---|
204 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{00000000-0000-0000-C000-000000000046}\BaseInterface]
|
---|
205 | //@=""
|
---|
206 | //
|
---|
207 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{00000000-0000-0000-C000-000000000046}\NumMethods]
|
---|
208 | //@="3"
|
---|
209 | #define IUNKNOWN "IUnknown"
|
---|
210 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00000000-0000-0000-C000-000000000046}",&hkey)!=ERROR_SUCCESS) {
|
---|
211 | goto initreg_error;
|
---|
212 | }
|
---|
213 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)IUNKNOWN, sizeof(IUNKNOWN));
|
---|
214 | RegCloseKey(hkey);
|
---|
215 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00000000-0000-0000-C000-000000000046}\\BaseInterface",&hkey)!=ERROR_SUCCESS) {
|
---|
216 | goto initreg_error;
|
---|
217 | }
|
---|
218 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)"", 1);
|
---|
219 | RegCloseKey(hkey);
|
---|
220 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00000000-0000-0000-C000-000000000046}\\NumMethods",&hkey)!=ERROR_SUCCESS) {
|
---|
221 | goto initreg_error;
|
---|
222 | }
|
---|
223 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)"3", 2);
|
---|
224 | RegCloseKey(hkey);
|
---|
225 |
|
---|
226 | //# IClassFactory, standard interface for creating instances of classes.
|
---|
227 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{00000001-0000-0000-C000-000000000046}]
|
---|
228 | //@="IClassFactory"
|
---|
229 | //
|
---|
230 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{00000001-0000-0000-C000-000000000046}\NumMethods]
|
---|
231 | //@="5"
|
---|
232 | //
|
---|
233 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{00000001-0000-0000-C000-000000000046}\ProxyStubClsid32]
|
---|
234 | //@="{00000320-0000-0000-C000-000000000046}"
|
---|
235 | #define ICLASSFACTORY "IClassFactory"
|
---|
236 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00000001-0000-0000-C000-000000000046}",&hkey)!=ERROR_SUCCESS) {
|
---|
237 | goto initreg_error;
|
---|
238 | }
|
---|
239 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)ICLASSFACTORY, sizeof(ICLASSFACTORY));
|
---|
240 | RegCloseKey(hkey);
|
---|
241 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00000001-0000-0000-C000-000000000046}\\NumMethods",&hkey)!=ERROR_SUCCESS) {
|
---|
242 | goto initreg_error;
|
---|
243 | }
|
---|
244 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)"5", 2);
|
---|
245 | RegCloseKey(hkey);
|
---|
246 | #define PSFACTORY_GUID "{00000320-0000-0000-C000-000000000046}"
|
---|
247 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00000001-0000-0000-C000-000000000046}\\ProxyStubClsid32",&hkey)!=ERROR_SUCCESS) {
|
---|
248 | goto initreg_error;
|
---|
249 | }
|
---|
250 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)PSFACTORY_GUID, sizeof(PSFACTORY_GUID));
|
---|
251 | RegCloseKey(hkey);
|
---|
252 |
|
---|
253 | //#
|
---|
254 | //# Entries for OLEAUT32 (OLE Automation)
|
---|
255 | //#
|
---|
256 | //
|
---|
257 | //# The Universal Marshaler, also known as the Type Library Marshaler.
|
---|
258 | //# (PSOAInterface = Proxy/Stub OLE Automation interface)
|
---|
259 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00020424-0000-0000-C000-000000000046}]
|
---|
260 | //@="PSOAInterface"
|
---|
261 | //
|
---|
262 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00020424-0000-0000-C000-000000000046}\InProcServer32]
|
---|
263 | //@="oleaut32.dll"
|
---|
264 | //"ThreadingModel"="Both"
|
---|
265 | #define PSOAINTERFACE "PSOAInterface"
|
---|
266 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00020424-0000-0000-C000-000000000046}",&hkey)!=ERROR_SUCCESS) {
|
---|
267 | goto initreg_error;
|
---|
268 | }
|
---|
269 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)PSOAINTERFACE, sizeof(PSOAINTERFACE));
|
---|
270 | RegCloseKey(hkey);
|
---|
271 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00020424-0000-0000-C000-000000000046}\\InProcServer32",&hkey)!=ERROR_SUCCESS) {
|
---|
272 | goto initreg_error;
|
---|
273 | }
|
---|
274 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)CLASS_OLEAUT32DLL, sizeof(CLASS_OLEAUT32DLL));
|
---|
275 | RegSetValueEx(hkey, COM_THREADMODEL, 0, REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
276 | RegCloseKey(hkey);
|
---|
277 |
|
---|
278 |
|
---|
279 | //Shell32 & IE related keys
|
---|
280 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00021400-0000-0000-C000-000000000046}]
|
---|
281 | //@="Desktop"
|
---|
282 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00021400-0000-0000-C000-000000000046}\InProcServer32]
|
---|
283 | //@="shell32.dll"
|
---|
284 | //ThreadingModel="Apartment"
|
---|
285 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00021400-0000-0000-C000-000000000046}",&hkey)!=ERROR_SUCCESS) {
|
---|
286 | goto initreg_error;
|
---|
287 | }
|
---|
288 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)CLASS_DESKTOP, sizeof(CLASS_DESKTOP));
|
---|
289 | RegCloseKey(hkey);
|
---|
290 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00021400-0000-0000-C000-000000000046}\\InProcServer32",&hkey)!=ERROR_SUCCESS) {
|
---|
291 | goto initreg_error;
|
---|
292 | }
|
---|
293 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)CLASS_SHELL32DLL, sizeof(CLASS_SHELL32DLL));
|
---|
294 | RegSetValueEx(hkey, COM_THREADMODEL, 0, REG_SZ, (LPBYTE)COM_THREAD_APARTMENT, sizeof(COM_THREAD_APARTMENT));
|
---|
295 | RegCloseKey(hkey);
|
---|
296 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00021401-0000-0000-C000-000000000046}]
|
---|
297 | //@="Shortcut"
|
---|
298 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00021401-0000-0000-C000-000000000046}\InProcServer32]
|
---|
299 | //@="shell32.dll"
|
---|
300 | //"ThreadingModel"="Apartment"
|
---|
301 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00021401-0000-0000-C000-000000000046}\shellex\MayChangeDefaultMenu]
|
---|
302 | //@=""
|
---|
303 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00021401-0000-0000-C000-000000000046}",&hkey)!=ERROR_SUCCESS) {
|
---|
304 | goto initreg_error;
|
---|
305 | }
|
---|
306 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)CLASS_SHORTCUT, sizeof(CLASS_SHORTCUT));
|
---|
307 | RegCloseKey(hkey);
|
---|
308 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00021401-0000-0000-C000-000000000046}\\InProcServer32",&hkey)!=ERROR_SUCCESS) {
|
---|
309 | goto initreg_error;
|
---|
310 | }
|
---|
311 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)CLASS_SHELL32DLL, sizeof(CLASS_SHELL32DLL));
|
---|
312 | RegSetValueEx(hkey, COM_THREADMODEL, 0, REG_SZ, (LPBYTE)COM_THREAD_APARTMENT, sizeof(COM_THREAD_APARTMENT));
|
---|
313 | RegCloseKey(hkey);
|
---|
314 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{00021401-0000-0000-C000-000000000046}\\shellex\\MayChangeDefaultMenu",&hkey)!=ERROR_SUCCESS) {
|
---|
315 | goto initreg_error;
|
---|
316 | }
|
---|
317 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)"", 0);
|
---|
318 | RegCloseKey(hkey);
|
---|
319 |
|
---|
320 | //# Entries for IWebBrowser
|
---|
321 | //# Used by Internet Explorer HTML-rendering control
|
---|
322 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8856f961-340a-11d0-a96b-00c04fd705a2}]
|
---|
323 | //@="Shortcut"
|
---|
324 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8856f961-340a-11d0-a96b-00c04fd705a2}\InProcServer32]
|
---|
325 | //@="shdocvw.dll"
|
---|
326 | //"ThreadingModel"="Apartment"
|
---|
327 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{8856f961-340a-11d0-a96b-00c04fd705a2}\shellex\MayChangeDefaultMenu]
|
---|
328 | //@=""
|
---|
329 |
|
---|
330 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{8856f961-340a-11d0-a96b-00c04fd705a2}",&hkey)!=ERROR_SUCCESS) {
|
---|
331 | goto initreg_error;
|
---|
332 | }
|
---|
333 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)CLASS_SHORTCUT, sizeof(CLASS_SHORTCUT));
|
---|
334 | RegCloseKey(hkey);
|
---|
335 |
|
---|
336 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{8856f961-340a-11d0-a96b-00c04fd705a2}\\InProcServer32",&hkey)!=ERROR_SUCCESS) {
|
---|
337 | goto initreg_error;
|
---|
338 | }
|
---|
339 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)CLASS_SHDOCVW, sizeof(CLASS_SHDOCVW));
|
---|
340 | RegSetValueEx(hkey, COM_THREADMODEL, 0, REG_SZ, (LPBYTE)COM_THREAD_APARTMENT, sizeof(COM_THREAD_APARTMENT));
|
---|
341 | RegCloseKey(hkey);
|
---|
342 |
|
---|
343 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Classes\\CLSID\\{8856f961-340a-11d0-a96b-00c04fd705a2}\\shellex\\MayChangeDefaultMenu",&hkey)!=ERROR_SUCCESS) {
|
---|
344 | goto initreg_error;
|
---|
345 | }
|
---|
346 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)"", 1);
|
---|
347 | RegCloseKey(hkey);
|
---|
348 |
|
---|
349 | //Now the Ddraw & dsound registry keys:
|
---|
350 | //HKEY_CLASSES_ROOT\DirectDraw = DirectDraw Object
|
---|
351 | //HKEY_CLASSES_ROOT\DirectDraw\CLSID = {D7B70EE0-4340-11CF-B063-0020AFC2CD35}
|
---|
352 | //HKEY_CLASSES_ROOT\CLSID\{D7B70EE0-4340-11CF-B063-0020AFC2CD35} = DirectDraw Object
|
---|
353 | //HKEY_CLASSES_ROOT\CLSID\{D7B70EE0-4340-11CF-B063-0020AFC2CD35}\InprocServer32 = ddraw.dll
|
---|
354 | if(RegCreateKey(HKEY_CLASSES_ROOT,"DirectDraw",&hkey)!=ERROR_SUCCESS) {
|
---|
355 | goto initreg_error;
|
---|
356 | }
|
---|
357 | RegSetValueEx(hkey, "", 0, REG_SZ, (LPBYTE)DDRAW_DEFAULT, sizeof(DDRAW_DEFAULT));
|
---|
358 | if(RegCreateKey(hkey,COM_CLASS_ID,&hkey1)!=ERROR_SUCCESS) {
|
---|
359 | RegCloseKey(hkey);
|
---|
360 | goto initreg_error;
|
---|
361 | }
|
---|
362 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)DDRAW_CLASSID, sizeof(DDRAW_CLASSID));
|
---|
363 | RegCloseKey(hkey1);
|
---|
364 | RegCloseKey(hkey);
|
---|
365 |
|
---|
366 | if(RegCreateKey(HKEY_CLASSES_ROOT, COM_CLASS_ID"\\"DDRAW_CLASSID ,&hkey)!=ERROR_SUCCESS) {
|
---|
367 | goto initreg_error;
|
---|
368 | }
|
---|
369 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)DDRAW_DEFAULT, sizeof(DDRAW_DEFAULT));
|
---|
370 | if(RegCreateKey(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
|
---|
371 | RegCloseKey(hkey);
|
---|
372 | goto initreg_error;
|
---|
373 | }
|
---|
374 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)DDRAW_DLL, sizeof(DDRAW_DLL));
|
---|
375 | RegSetValueEx(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
376 | RegCloseKey(hkey1);
|
---|
377 | RegCloseKey(hkey);
|
---|
378 |
|
---|
379 | //HKEY_CLASSES_ROOT\DirectDrawClipper = DirectDraw Clipper Object
|
---|
380 | //HKEY_CLASSES_ROOT\DirectDrawClipper\CLSID = {593817A0-7DB3-11CF-A2DE-00AA00B93356}
|
---|
381 | //HKEY_CLASSES_ROOT\CLSID\{593817A0-7DB3-11CF-A2DE-00AA00B93356} = DirectDraw Clipper Object
|
---|
382 | //HKEY_CLASSES_ROOT\CLSID\{593817A0-7DB3-11CF-A2DE-00AA00B93356}\InprocServer32 = ddraw.dll
|
---|
383 | if(RegCreateKey(HKEY_CLASSES_ROOT,"DirectDrawClipper",&hkey)!=ERROR_SUCCESS) {
|
---|
384 | goto initreg_error;
|
---|
385 | }
|
---|
386 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)DDRAW_CLIPPER_DEFAULT, sizeof(DDRAW_CLIPPER_DEFAULT));
|
---|
387 | if(RegCreateKey(hkey,COM_CLASS_ID,&hkey1)!=ERROR_SUCCESS) {
|
---|
388 | RegCloseKey(hkey);
|
---|
389 | goto initreg_error;
|
---|
390 | }
|
---|
391 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)DDRAW_CLIPPER_CLASSID, sizeof(DDRAW_CLIPPER_CLASSID));
|
---|
392 | RegCloseKey(hkey1);
|
---|
393 | RegCloseKey(hkey);
|
---|
394 |
|
---|
395 | if(RegCreateKey(HKEY_CLASSES_ROOT, COM_CLASS_ID"\\"DDRAW_CLIPPER_CLASSID,&hkey)!=ERROR_SUCCESS) {
|
---|
396 | goto initreg_error;
|
---|
397 | }
|
---|
398 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)DDRAW_CLIPPER_DEFAULT, sizeof(DDRAW_CLIPPER_DEFAULT));
|
---|
399 | if(RegCreateKey(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
|
---|
400 | RegCloseKey(hkey);
|
---|
401 | goto initreg_error;
|
---|
402 | }
|
---|
403 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)DDRAW_DLL, sizeof(DDRAW_DLL));
|
---|
404 | RegSetValueEx(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
405 | RegCloseKey(hkey1);
|
---|
406 | RegCloseKey(hkey);
|
---|
407 |
|
---|
408 | //HKEY_CLASSES_ROOT\DirectSound = DirectSound Object
|
---|
409 | //HKEY_CLASSES_ROOT\DirectSound\CLSID = {47D4D946-62E8-11cf-93BC-444553540000}
|
---|
410 | //HKEY_CLASSES_ROOT\CLSID\{47D4D946-62E8-11cf-93BC-444553540000} = DirectSound Object
|
---|
411 | //HKEY_CLASSES_ROOT\CLSID\{47D4D946-62E8-11cf-93BC-444553540000}\InprocServer32 = dsound.dll
|
---|
412 | if(RegCreateKey(HKEY_CLASSES_ROOT,"DirectSound",&hkey)!=ERROR_SUCCESS) {
|
---|
413 | goto initreg_error;
|
---|
414 | }
|
---|
415 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)DSOUND_DEFAULT, sizeof(DSOUND_DEFAULT));
|
---|
416 | if(RegCreateKey(hkey,COM_CLASS_ID,&hkey1)!=ERROR_SUCCESS) {
|
---|
417 | RegCloseKey(hkey);
|
---|
418 | goto initreg_error;
|
---|
419 | }
|
---|
420 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)DSOUND_CLASSID, sizeof(DSOUND_CLASSID));
|
---|
421 | RegCloseKey(hkey1);
|
---|
422 | RegCloseKey(hkey);
|
---|
423 |
|
---|
424 | if(RegCreateKey(HKEY_CLASSES_ROOT, COM_CLASS_ID"\\"DSOUND_CLASSID ,&hkey)!=ERROR_SUCCESS) {
|
---|
425 | goto initreg_error;
|
---|
426 | }
|
---|
427 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)DSOUND_DEFAULT, sizeof(DSOUND_DEFAULT));
|
---|
428 | if(RegCreateKey(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
|
---|
429 | RegCloseKey(hkey);
|
---|
430 | goto initreg_error;
|
---|
431 | }
|
---|
432 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)DSOUND_DLL, sizeof(DSOUND_DLL));
|
---|
433 | RegSetValueEx(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
434 | RegCloseKey(hkey1);
|
---|
435 | RegCloseKey(hkey);
|
---|
436 |
|
---|
437 | //DirectPlay
|
---|
438 | if(RegCreateKey(HKEY_LOCAL_MACHINE, "Software\\CLASSES\\CLSID\\"DPLAYX_CLASSID ,&hkey)!=ERROR_SUCCESS) {
|
---|
439 | goto initreg_error;
|
---|
440 | }
|
---|
441 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)DPLAYX_DEFAULT, sizeof(DPLAYX_DEFAULT));
|
---|
442 | if(RegCreateKey(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
|
---|
443 | RegCloseKey(hkey);
|
---|
444 | goto initreg_error;
|
---|
445 | }
|
---|
446 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)DPLAYX_DLL, sizeof(DPLAYX_DLL));
|
---|
447 | RegSetValueEx(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
448 | RegCloseKey(hkey1);
|
---|
449 | RegCloseKey(hkey);
|
---|
450 |
|
---|
451 | //DirectPlay Lobby
|
---|
452 | if(RegCreateKey(HKEY_LOCAL_MACHINE, "Software\\CLASSES\\CLSID\\"DPLAYX_LOBBY_CLASSID ,&hkey)!=ERROR_SUCCESS) {
|
---|
453 | goto initreg_error;
|
---|
454 | }
|
---|
455 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)DPLAYX_LOBBY_DEFAULT, sizeof(DPLAYX_LOBBY_DEFAULT));
|
---|
456 | if(RegCreateKey(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
|
---|
457 | RegCloseKey(hkey);
|
---|
458 | goto initreg_error;
|
---|
459 | }
|
---|
460 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)DPLAYX_LOBBY_DLL, sizeof(DPLAYX_LOBBY_DLL));
|
---|
461 | RegSetValueEx(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
462 | RegCloseKey(hkey1);
|
---|
463 | RegCloseKey(hkey);
|
---|
464 |
|
---|
465 | //Quartz.dll keys
|
---|
466 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{CDA42200-BD88-11d0-BD4E-00A0C911CE86}]
|
---|
467 | //@="Filter Mapper2"
|
---|
468 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{CDA42200-BD88-11d0-BD4E-00A0C911CE86}\InprocServer32]
|
---|
469 | //@="G:\\WINNT\\System32\\quartz.dll"
|
---|
470 | //"ThreadingModel"="Both"
|
---|
471 | if(RegCreateKey(HKEY_LOCAL_MACHINE, "Software\\CLASSES\\CLSID\\"QUARTZ_FILTER_CLASSID ,&hkey)!=ERROR_SUCCESS) {
|
---|
472 | goto initreg_error;
|
---|
473 | }
|
---|
474 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)QUARTZ_FILTER_DEFAULT, sizeof(QUARTZ_FILTER_DEFAULT));
|
---|
475 | if(RegCreateKey(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
|
---|
476 | RegCloseKey(hkey);
|
---|
477 | goto initreg_error;
|
---|
478 | }
|
---|
479 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)QUARTZ_DLL, sizeof(QUARTZ_DLL));
|
---|
480 | RegSetValueEx(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
481 | RegCloseKey(hkey1);
|
---|
482 | RegCloseKey(hkey);
|
---|
483 |
|
---|
484 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{CDBD8D00-C193-11D0-BD4E-00A0C911CE86}]
|
---|
485 | //@="CMediaPropertyBag"
|
---|
486 | //
|
---|
487 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{CDBD8D00-C193-11D0-BD4E-00A0C911CE86}\InprocServer32]
|
---|
488 | //@="G:\\WINNT\\System32\\quartz.dll"
|
---|
489 | //"ThreadingModel"="Both"
|
---|
490 | if(RegCreateKey(HKEY_LOCAL_MACHINE, "Software\\CLASSES\\CLSID\\"QUARTZ_MEDIAPROP_CLASSID ,&hkey)!=ERROR_SUCCESS) {
|
---|
491 | goto initreg_error;
|
---|
492 | }
|
---|
493 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)QUARTZ_MEDIAPROP_DEFAULT, sizeof(QUARTZ_MEDIAPROP_DEFAULT));
|
---|
494 | if(RegCreateKey(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
|
---|
495 | RegCloseKey(hkey);
|
---|
496 | goto initreg_error;
|
---|
497 | }
|
---|
498 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)QUARTZ_DLL, sizeof(QUARTZ_DLL));
|
---|
499 | RegSetValueEx(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
500 | RegCloseKey(hkey1);
|
---|
501 | RegCloseKey(hkey);
|
---|
502 |
|
---|
503 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{79376820-07D0-11CF-A24D-0020AFD79767}]
|
---|
504 | //@="DirectSound Audio Renderer"
|
---|
505 | //
|
---|
506 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{79376820-07D0-11CF-A24D-0020AFD79767}\InprocServer32]
|
---|
507 | //@="G:\\WINNT\\System32\\quartz.dll"
|
---|
508 | //"ThreadingModel"="Both"
|
---|
509 | if(RegCreateKey(HKEY_LOCAL_MACHINE, "Software\\CLASSES\\CLSID\\"QUARTZ_DSOUNDREND_CLASSID ,&hkey)!=ERROR_SUCCESS) {
|
---|
510 | goto initreg_error;
|
---|
511 | }
|
---|
512 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)QUARTZ_DSOUNDREND_DEFAULT, sizeof(QUARTZ_DSOUNDREND_DEFAULT));
|
---|
513 | if(RegCreateKey(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
|
---|
514 | RegCloseKey(hkey);
|
---|
515 | goto initreg_error;
|
---|
516 | }
|
---|
517 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)QUARTZ_DLL, sizeof(QUARTZ_DLL));
|
---|
518 | RegSetValueEx(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
519 | RegCloseKey(hkey1);
|
---|
520 | RegCloseKey(hkey);
|
---|
521 |
|
---|
522 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{e436ebb4-524f-11ce-9f53-0020af0ba770}]
|
---|
523 | //@="Filter Graph Control Plug In Distributor"
|
---|
524 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{e436ebb4-524f-11ce-9f53-0020af0ba770}\InprocServer32]
|
---|
525 | //@="G:\\WINNT\\System32\\quartz.dll"
|
---|
526 | //"ThreadingModel"="Both"
|
---|
527 | if(RegCreateKey(HKEY_LOCAL_MACHINE, "Software\\CLASSES\\CLSID\\"QUARTZ_FILTERGRAPHDIST_CLASSID ,&hkey)!=ERROR_SUCCESS) {
|
---|
528 | goto initreg_error;
|
---|
529 | }
|
---|
530 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)QUARTZ_FILTERGRAPHDIST_DEFAULT, sizeof(QUARTZ_FILTERGRAPHDIST_DEFAULT));
|
---|
531 | if(RegCreateKey(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
|
---|
532 | RegCloseKey(hkey);
|
---|
533 | goto initreg_error;
|
---|
534 | }
|
---|
535 | RegSetValueEx(hkey1,"",0,REG_SZ, (LPBYTE)QUARTZ_DLL, sizeof(QUARTZ_DLL));
|
---|
536 | RegSetValueEx(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
|
---|
537 | RegCloseKey(hkey1);
|
---|
538 | RegCloseKey(hkey);
|
---|
539 |
|
---|
540 | //[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion]
|
---|
541 | //"ProgramFilesDir"="C:\Program Files"
|
---|
542 | //"CommonFilesDir"="C:\Program Files\Common Files"
|
---|
543 | //# This is intended for a centrally managed (server) directory where system files and e.g. fonts can reside. Most installs have this set to C:\WINDOWS, though.
|
---|
544 | //"SharedDir"="C:\WINDOWS"
|
---|
545 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion",&hkey)!=ERROR_SUCCESS) {
|
---|
546 | goto initreg_error;
|
---|
547 | }
|
---|
548 | //Create x:\Program Files directory
|
---|
549 | strcpy(shellpath, InternalGetWindowsDirectory());
|
---|
550 | shellpath[2] = 0; //get drive
|
---|
551 | strcat(shellpath, "\\Program Files");
|
---|
552 | CreateDirectory(shellpath, NULL);
|
---|
553 | RegSetValueEx(hkey, DIR_PROGRAM, 0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
|
---|
554 |
|
---|
555 | //Create x:\Program Files\Common Files directory
|
---|
556 | strcat(shellpath, "\\Common Files");
|
---|
557 | CreateDirectory(shellpath, NULL);
|
---|
558 | RegSetValueEx(hkey, DIR_PROGRAM_COMMON, 0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
|
---|
559 |
|
---|
560 | strcpy(shellpath, InternalGetWindowsDirectory());
|
---|
561 | RegSetValueEx(hkey, DIR_SHARED, 0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
|
---|
562 |
|
---|
563 | RegCloseKey(hkey);
|
---|
564 |
|
---|
565 | //[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\VIDEO]
|
---|
566 | //"\\Device\\Video0"="\\REGISTRY\\Machine\\System\\ControlSet001\\Services\\mga64\\Device0"
|
---|
567 | //"\\Device\\Video1"="\\REGISTRY\\Machine\\System\\ControlSet001\\Services\\VgaSave\\Device0"
|
---|
568 | //"VgaCompatible"="\\Device\\Video1"
|
---|
569 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"HARDWARE\\DEVICEMAP\\VIDEO",&hkey)!=ERROR_SUCCESS) {
|
---|
570 | goto initreg_error;
|
---|
571 | }
|
---|
572 | RegSetValueEx(hkey,"\\Device\\Video0",0,REG_SZ, (LPBYTE)HARDWARE_VIDEO_GRADD, sizeof(HARDWARE_VIDEO_GRADD));
|
---|
573 | RegSetValueEx(hkey,"\\Device\\Video1",0,REG_SZ, (LPBYTE)HARDWARE_VIDEO_VGA, sizeof(HARDWARE_VIDEO_VGA));
|
---|
574 | RegSetValueEx(hkey, "VgaCompatible", 0,REG_SZ, (LPBYTE)HARDWARE_VIDEO_COMPATIBLE, sizeof(HARDWARE_VIDEO_COMPATIBLE));
|
---|
575 | RegCloseKey(hkey);
|
---|
576 |
|
---|
577 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\Gradd\\Device0",&hkey)!=ERROR_SUCCESS) {
|
---|
578 | goto initreg_error;
|
---|
579 | }
|
---|
580 | RegSetValueEx(hkey,"Device Description", 0, REG_SZ, (LPBYTE)HARDWARE_VIDEO_GRADD_DESCRIPTION, sizeof(HARDWARE_VIDEO_GRADD_DESCRIPTION));
|
---|
581 | RegCloseKey(hkey);
|
---|
582 |
|
---|
583 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\VgaSave\\Device0",&hkey)!=ERROR_SUCCESS) {
|
---|
584 | goto initreg_error;
|
---|
585 | }
|
---|
586 | RegSetValueEx(hkey,"Device Description", 0, REG_SZ, (LPBYTE)HARDWARE_VIDEO_VGA_DESCRIPTION, sizeof(HARDWARE_VIDEO_VGA_DESCRIPTION));
|
---|
587 | RegCloseKey(hkey);
|
---|
588 |
|
---|
589 | //Software\Microsoft\Multimedia\Sound Mapper
|
---|
590 | if(RegCreateKey(HKEY_CURRENT_USER,"Software\\Microsoft\\Multimedia\\Sound Mapper",&hkey)!=ERROR_SUCCESS) {
|
---|
591 | goto initreg_error;
|
---|
592 | }
|
---|
593 | RegSetValueEx(hkey,"Playback", 0, REG_SZ, (LPBYTE)ODIN_WINMM_PLAYBACK, sizeof(ODIN_WINMM_PLAYBACK));
|
---|
594 | RegSetValueEx(hkey,"Record", 0, REG_SZ, (LPBYTE)ODIN_WINMM_RECORD, sizeof(ODIN_WINMM_RECORD));
|
---|
595 | RegCloseKey(hkey);
|
---|
596 |
|
---|
597 | //Software\Microsoft\DirectX
|
---|
598 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\DirectX",&hkey)!=ERROR_SUCCESS) {
|
---|
599 | goto initreg_error;
|
---|
600 | }
|
---|
601 | RegSetValueEx(hkey,"",0,REG_SZ, (LPBYTE)"", 0);
|
---|
602 | RegSetValueEx(hkey, "RC", 0,REG_SZ, (LPBYTE)DIRECTX_RC, sizeof(DIRECTX_RC));
|
---|
603 | RegSetValueEx(hkey, "Version", 0,REG_SZ, (LPBYTE)DIRECTX_VERSION, sizeof(DIRECTX_VERSION));
|
---|
604 | val = DIRECTX_INSTALLED_VERSION;
|
---|
605 | RegSetValueEx(hkey, "InstalledVersion", 0,REG_BINARY, (LPBYTE)&val, sizeof(DWORD));
|
---|
606 | RegCloseKey(hkey);
|
---|
607 |
|
---|
608 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\DirectDraw",&hkey)!=ERROR_SUCCESS) {
|
---|
609 | goto initreg_error;
|
---|
610 | }
|
---|
611 | //todo
|
---|
612 | RegCloseKey(hkey);
|
---|
613 |
|
---|
614 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Direct3D",&hkey)!=ERROR_SUCCESS) {
|
---|
615 | goto initreg_error;
|
---|
616 | }
|
---|
617 | //todo
|
---|
618 | RegCloseKey(hkey);
|
---|
619 |
|
---|
620 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\DirectPlay",&hkey)!=ERROR_SUCCESS) {
|
---|
621 | goto initreg_error;
|
---|
622 | }
|
---|
623 | //todo
|
---|
624 | RegCloseKey(hkey);
|
---|
625 |
|
---|
626 | #if 0
|
---|
627 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\DirectMusic",&hkey)!=ERROR_SUCCESS) {
|
---|
628 | goto initreg_error;
|
---|
629 | }
|
---|
630 | //todo
|
---|
631 | RegCloseKey(hkey);
|
---|
632 | #endif
|
---|
633 |
|
---|
634 | // [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdfs]
|
---|
635 | // "Type"=dword:00000002
|
---|
636 | // "Start"=dword:00000004
|
---|
637 | // "Group"="File system"
|
---|
638 | // "ErrorControl"=dword:00000001
|
---|
639 | // "DependOnGroup"=hex(7):53,43,53,49,20,43,44,52,4f,4d,20,43,6c,61,73,73,00,00
|
---|
640 |
|
---|
641 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\Cdfs",&hkey)!=ERROR_SUCCESS) {
|
---|
642 | goto initreg_error;
|
---|
643 | }
|
---|
644 | val = 0x2;
|
---|
645 | RegSetValueEx(hkey, KEY_DEVICE_TYPE,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
646 | val = 0x4;
|
---|
647 | RegSetValueEx(hkey, KEY_DEVICE_START,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
648 | val = 0x1;
|
---|
649 | RegSetValueEx(hkey, KEY_DEVICE_ERRORCONTROL,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
650 | RegSetValueEx(hkey, KEY_DEVICE_GROUP,0,REG_SZ, (LPBYTE)DEVICE_GROUP_FILESYSTEM, sizeof(DEVICE_GROUP_FILESYSTEM));
|
---|
651 | //todo dependongroup
|
---|
652 | RegCloseKey(hkey);
|
---|
653 |
|
---|
654 |
|
---|
655 | /*
|
---|
656 | // [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdfs\Enum]
|
---|
657 | // "0"="Root\\LEGACY_CDFS\\0000"
|
---|
658 | // "Count"=dword:00000001
|
---|
659 | // "NextInstance"=dword:00000001
|
---|
660 | */
|
---|
661 | // [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom]
|
---|
662 | // "Type"=dword:00000001
|
---|
663 | // "Start"=dword:00000001
|
---|
664 | // "Group"="SCSI CDROM Class"
|
---|
665 | // "ErrorControl"=dword:00000000
|
---|
666 | // "Tag"=dword:00000002
|
---|
667 | // "DependOnGroup"=hex(7):53,43,53,49,20,6d,69,6e,69,70,6f,72,74,00,00
|
---|
668 | // "Autorun"=dword:00000001
|
---|
669 |
|
---|
670 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\Cdrom",&hkey)!=ERROR_SUCCESS) {
|
---|
671 | goto initreg_error;
|
---|
672 | }
|
---|
673 | val = 0x1;
|
---|
674 | RegSetValueEx(hkey, KEY_DEVICE_TYPE,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
675 | val = 0x1;
|
---|
676 | RegSetValueEx(hkey, KEY_DEVICE_START,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
677 | val = 0x0;
|
---|
678 | RegSetValueEx(hkey, KEY_DEVICE_ERRORCONTROL,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
679 | val = 0x2;
|
---|
680 | RegSetValueEx(hkey, KEY_DEVICE_TAG,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
681 | val = 0x0;
|
---|
682 | RegSetValueEx(hkey, KEY_DEVICE_AUTORUN,0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
683 | RegSetValueEx(hkey, KEY_DEVICE_GROUP,0,REG_SZ, (LPBYTE)DEVICE_GROUP_SCSICDROM, sizeof(DEVICE_GROUP_SCSICDROM));
|
---|
684 | //todo dependongroup
|
---|
685 | RegCloseKey(hkey);
|
---|
686 |
|
---|
687 | /*
|
---|
688 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom\Enum]
|
---|
689 | "0"="Root\\LEGACY_CDROM\\0000"
|
---|
690 | "Count"=dword:00000001
|
---|
691 | "NextInstance"=dword:00000001
|
---|
692 | */
|
---|
693 |
|
---|
694 | //[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\FileSystem]
|
---|
695 | //"Win31FileSystem"=dword:00000000
|
---|
696 | //"NtfsDisable8dot3NameCreation"=dword:00000000
|
---|
697 | //"Win95TruncatedExtensions"=dword:00000001
|
---|
698 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Control\\FileSystem",&hkey)!=ERROR_SUCCESS) {
|
---|
699 | goto initreg_error;
|
---|
700 | }
|
---|
701 | val = 0x0;
|
---|
702 | RegSetValueEx(hkey, "Win31FileSystem",0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
703 | val = 0x0;
|
---|
704 | RegSetValueEx(hkey, "NtfsDisable8dot3NameCreation",0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
705 | val = 0x1;
|
---|
706 | RegSetValueEx(hkey, "Win95TruncatedExtensions",0,REG_DWORD, (LPBYTE)&val, sizeof(DWORD));
|
---|
707 | RegCloseKey(hkey);
|
---|
708 |
|
---|
709 | //[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM]
|
---|
710 | //"Serial1"="COM2"
|
---|
711 | //// if(RegCreateKey(HKEY_LOCAL_MACHINE,"HARDWARE\\DEVICEMAP\\SERIALCOMM",&hkey)!=ERROR_SUCCESS) {
|
---|
712 | //// goto initreg_error;
|
---|
713 | //// }
|
---|
714 | //// RegSetValueEx(hkey, "Serial1",0,REG_SZ, (LPBYTE)"COM2", 5);
|
---|
715 | //// RegCloseKey(hkey);
|
---|
716 |
|
---|
717 |
|
---|
718 | //[HKEY_LOCAL_MACHINE\Software\Microsoft\OLE]
|
---|
719 | //# allow cross-machine calls (RPC) (default Y)
|
---|
720 | //"EnableDCOM"="Y"
|
---|
721 | //# allow incoming connections ? (def. N)
|
---|
722 | //"EnableRemoteConnect"="N"
|
---|
723 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\OLE",&hkey)!=ERROR_SUCCESS) {
|
---|
724 | goto initreg_error;
|
---|
725 | }
|
---|
726 | digbuf[0] = 'Y';
|
---|
727 | digbuf[1] = 0;
|
---|
728 | RegSetValueEx(hkey, "EnableDCOM",0,REG_SZ, (LPBYTE)digbuf, 2);
|
---|
729 | digbuf[0] = 'N';
|
---|
730 | digbuf[1] = 0;
|
---|
731 | RegSetValueEx(hkey, "EnableRemoteConnect",0,REG_SZ, (LPBYTE)digbuf, 2);
|
---|
732 | RegCloseKey(hkey);
|
---|
733 |
|
---|
734 | //Add MS Sans Serif to WarpSans font conversion entry
|
---|
735 | char temp;
|
---|
736 | if(PROFILE_GetOdinIniString(ODINFONTSECTION, "MS Sans Serif", "", &temp,
|
---|
737 | 0) <= 1)
|
---|
738 | {
|
---|
739 | PROFILE_SetOdinIniString(ODINFONTSECTION, "MS Sans Serif", "WarpSans");
|
---|
740 | }
|
---|
741 | //Create system.ini with [mci] section
|
---|
742 | strcpy(shellpath, InternalGetWindowsDirectory());
|
---|
743 | strcat(shellpath, "\\system.ini");
|
---|
744 |
|
---|
745 | if(GetPrivateProfileStringA(szMci, szCDAudio, szMciCDA, &temp, 0, shellpath) <= 1) {
|
---|
746 | WritePrivateProfileStringA(szMci, szCDAudio, szMciCDA, shellpath);
|
---|
747 | }
|
---|
748 |
|
---|
749 | //Font registry keys (not complete)
|
---|
750 | //[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
|
---|
751 | //"Courier 10,12,15 (VGA res)"="COURE.FON"
|
---|
752 | //"MS Sans Serif 8,10,12,14,18,24 (VGA res)"="SSERIFE.FON"
|
---|
753 | //"MS Serif 8,10,12,14,18,24 (VGA res)"="SERIFE.FON"
|
---|
754 |
|
---|
755 |
|
---|
756 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts",&hkey)!=ERROR_SUCCESS) {
|
---|
757 | goto initreg_error;
|
---|
758 | }
|
---|
759 | #define FONT_COURIER "COURE.FON"
|
---|
760 | #define FONT_SANSSERIF "SSERIFE.FON"
|
---|
761 | #define FONT_SERIF "SERIFE.FON"
|
---|
762 | RegSetValueEx(hkey, "Courier 10,12,15 (VGA res)",0,REG_SZ, (LPBYTE)FONT_COURIER, sizeof(FONT_COURIER));
|
---|
763 | RegSetValueEx(hkey, "MS Sans Serif 8,10,12,14,18,24 (VGA res)",0,REG_SZ, (LPBYTE)FONT_SANSSERIF, sizeof(FONT_SANSSERIF));
|
---|
764 | RegSetValueEx(hkey, "MS Serif 8,10,12,14,18,24 (VGA res)",0,REG_SZ, (LPBYTE)FONT_SERIF, sizeof(FONT_SERIF));
|
---|
765 | RegCloseKey(hkey);
|
---|
766 |
|
---|
767 | if(RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Fonts",&hkey)!=ERROR_SUCCESS) {
|
---|
768 | goto initreg_error;
|
---|
769 | }
|
---|
770 | RegSetValueEx(hkey, "Courier 10,12,15 (VGA res)",0,REG_SZ, (LPBYTE)FONT_COURIER, sizeof(FONT_COURIER));
|
---|
771 | RegSetValueEx(hkey, "MS Sans Serif 8,10,12,14,18,24 (VGA res)",0,REG_SZ, (LPBYTE)FONT_SANSSERIF, sizeof(FONT_SANSSERIF));
|
---|
772 | RegSetValueEx(hkey, "MS Serif 8,10,12,14,18,24 (VGA res)",0,REG_SZ, (LPBYTE)FONT_SERIF, sizeof(FONT_SERIF));
|
---|
773 | RegCloseKey(hkey);
|
---|
774 | return TRUE;
|
---|
775 |
|
---|
776 | initreg_error:
|
---|
777 | dprintf((INITREG_ERROR));
|
---|
778 | return FALSE;
|
---|
779 | }
|
---|
780 | //******************************************************************************
|
---|
781 | //******************************************************************************
|
---|
782 | BOOL CreateSystemDirectories()
|
---|
783 | {
|
---|
784 | char dirname[260];
|
---|
785 | HKEY hkey;
|
---|
786 |
|
---|
787 | //Create Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders keys
|
---|
788 | //"Favorites"="C:\WINDOWS\Favorites"
|
---|
789 | //"StartUp"="C:\WINDOWS\Start Menu\Programs\Startup"
|
---|
790 | //"Desktop"="C:\WINDOWS\Desktop"
|
---|
791 | //"Programs"="C:\WINDOWS\Start Menu\Programs"
|
---|
792 | //"Fonts"="C:\WINDOWS\Fonts"
|
---|
793 | //"SendTo"="C:\WINDOWS\SendTo"
|
---|
794 | //"Start Menu"="C:\WINDOWS\Start Menu"
|
---|
795 | //"Templates"="C:\WINDOWS\ShellNew"
|
---|
796 | //"Recent"="C:\WINDOWS\Recent"
|
---|
797 | //"NetHood"="C:\WINDOWS\NetHood"
|
---|
798 | //"Personal"="C:\My Documents"
|
---|
799 |
|
---|
800 | if(RegCreateKey(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",&hkey)!=ERROR_SUCCESS) {
|
---|
801 | dprintf(("InitRegistry: Unable to register system information (3)"));
|
---|
802 | return FALSE;
|
---|
803 | }
|
---|
804 | //system32\drivers dir
|
---|
805 | strcpy(dirname, InternalGetSystemDirectory());
|
---|
806 | strcat(dirname, "\\Drivers");
|
---|
807 | CreateDirectory(dirname, NULL);
|
---|
808 | strcat(dirname, "\\etc");
|
---|
809 | CreateDirectory(dirname, NULL);
|
---|
810 |
|
---|
811 | //SYSTEM dir
|
---|
812 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
813 | strcat(dirname, "\\SYSTEM");
|
---|
814 | CreateDirectory(dirname, NULL);
|
---|
815 |
|
---|
816 | //AppData
|
---|
817 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
818 | strcat(dirname, "\\Application Data");
|
---|
819 | CreateDirectory(dirname, NULL);
|
---|
820 | RegSetValueEx(hkey,"AppData",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
821 | //Cache
|
---|
822 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
823 | strcat(dirname, "\\Temporary Internet Files");
|
---|
824 | CreateDirectory(dirname, NULL);
|
---|
825 | RegSetValueEx(hkey,"Cache",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
826 | //Cookies
|
---|
827 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
828 | strcat(dirname, "\\Cookies");
|
---|
829 | CreateDirectory(dirname, NULL);
|
---|
830 | RegSetValueEx(hkey,"Cookies",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
831 | //Desktop
|
---|
832 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
833 | strcat(dirname, "\\Desktop");
|
---|
834 | CreateDirectory(dirname, NULL);
|
---|
835 | RegSetValueEx(hkey,"Desktop",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
836 | //Favorites
|
---|
837 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
838 | strcat(dirname, "\\Favorites");
|
---|
839 | CreateDirectory(dirname, NULL);
|
---|
840 | RegSetValueEx(hkey,"Favorites",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
841 | //Fonts
|
---|
842 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
843 | strcat(dirname, "\\Fonts");
|
---|
844 | CreateDirectory(dirname, NULL);
|
---|
845 | RegSetValueEx(hkey,"Fonts",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
846 | //History
|
---|
847 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
848 | strcat(dirname, "\\History");
|
---|
849 | CreateDirectory(dirname, NULL);
|
---|
850 | RegSetValueEx(hkey,"History",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
851 | //NetHood
|
---|
852 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
853 | strcat(dirname, "\\NetHood");
|
---|
854 | CreateDirectory(dirname, NULL);
|
---|
855 | RegSetValueEx(hkey,"NetHood",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
856 | //Personal
|
---|
857 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
858 | strcat(dirname, "\\My Documents");
|
---|
859 | CreateDirectory(dirname, NULL);
|
---|
860 | RegSetValueEx(hkey,"Personal",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
861 | //PrintHood
|
---|
862 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
863 | strcat(dirname, "\\PrintHood");
|
---|
864 | CreateDirectory(dirname, NULL);
|
---|
865 | RegSetValueEx(hkey,"PrintHood",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
866 | //Recent
|
---|
867 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
868 | strcat(dirname, "\\Recent");
|
---|
869 | CreateDirectory(dirname, NULL);
|
---|
870 | RegSetValueEx(hkey,"Recent",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
871 | //SendTo
|
---|
872 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
873 | strcat(dirname, "\\SendTo");
|
---|
874 | CreateDirectory(dirname, NULL);
|
---|
875 | RegSetValueEx(hkey,"SendTo",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
876 | //Start Menu
|
---|
877 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
878 | strcat(dirname, "\\Start Menu");
|
---|
879 | CreateDirectory(dirname, NULL);
|
---|
880 | RegSetValueEx(hkey,"Start Menu",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
881 |
|
---|
882 | //Temp directory
|
---|
883 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
884 | strcat(dirname, "\\Temp");
|
---|
885 | CreateDirectory(dirname, NULL);
|
---|
886 |
|
---|
887 | //Programs
|
---|
888 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
889 | strcat(dirname, "\\Start Menu\\Programs");
|
---|
890 | CreateDirectory(dirname, NULL);
|
---|
891 | RegSetValueEx(hkey,"Programs",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
892 | //Startup
|
---|
893 | strcat(dirname, "\\Startup");
|
---|
894 | CreateDirectory(dirname, NULL);
|
---|
895 | RegSetValueEx(hkey,"Startup",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
896 | //ShellNew
|
---|
897 | strcpy(dirname, InternalGetWindowsDirectory());
|
---|
898 | strcat(dirname, "\\ShellNew");
|
---|
899 | CreateDirectory(dirname, NULL);
|
---|
900 | RegSetValueEx(hkey,"Templates",0,REG_SZ, (LPBYTE)dirname, strlen(dirname)+1);
|
---|
901 | RegCloseKey(hkey);
|
---|
902 |
|
---|
903 | return TRUE;
|
---|
904 | }
|
---|
905 | //******************************************************************************
|
---|
906 | //Example:
|
---|
907 | //[HKEY_USERS\.DEFAULT\Control Panel\International]
|
---|
908 | //"Locale"="00000409"
|
---|
909 | //"sLanguage"="ENU"
|
---|
910 | //"sCountry"="United States"
|
---|
911 | //"iCountry"="1"
|
---|
912 | //"sList"=","
|
---|
913 | //"iMeasure"="1"
|
---|
914 | //"sDecimal"="."
|
---|
915 | //"sThousand"=","
|
---|
916 | //"iDigits"="2"
|
---|
917 | //"iLZero"="1"
|
---|
918 | //"sCurrency"="$"
|
---|
919 | //"iCurrDigits"="2"
|
---|
920 | //"iCurrency"="0"
|
---|
921 | //"iNegCurr"="0"
|
---|
922 | //"sDate"="/"
|
---|
923 | //"sTime"=":"
|
---|
924 | //"sShortDate"="M/d/yy"
|
---|
925 | //"sLongDate"="dddd, MMMM dd, yyyy"
|
---|
926 | //"iDate"="0"
|
---|
927 | //"iTime"="0"
|
---|
928 | //"iTLZero"="0"
|
---|
929 | //"s1159"="AM"
|
---|
930 | //"s2359"="PM"
|
---|
931 | //******************************************************************************
|
---|
932 | BOOL SetupControlPanelKeys()
|
---|
933 | {
|
---|
934 | HKEY hkey;
|
---|
935 | LCID lcid;
|
---|
936 | char tmp[128];
|
---|
937 |
|
---|
938 | if(RegCreateKey(HKEY_CURRENT_USER,"Control Panel\\International",&hkey)!=ERROR_SUCCESS) {
|
---|
939 | dprintf(("SetupControlPanelKeys: Unable to create key"));
|
---|
940 | return FALSE;
|
---|
941 | }
|
---|
942 | lcid = GetUserDefaultLCID();
|
---|
943 | sprintf(tmp, "%08X", lcid);
|
---|
944 | RegSetValueEx(hkey,"Locale",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
945 |
|
---|
946 | GetLocaleInfo(lcid, LOCALE_SLANGUAGE, tmp, sizeof(tmp)-1);
|
---|
947 | RegSetValueEx(hkey,"sLanguage",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
948 |
|
---|
949 | GetLocaleInfo(lcid, LOCALE_SCOUNTRY, tmp, sizeof(tmp)-1);
|
---|
950 | RegSetValueEx(hkey,"sCountry",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
951 |
|
---|
952 | GetLocaleInfo(lcid, LOCALE_ICOUNTRY, tmp, sizeof(tmp)-1);
|
---|
953 | RegSetValueEx(hkey,"iCountry",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
954 |
|
---|
955 | GetLocaleInfo(lcid, LOCALE_SLIST, tmp, sizeof(tmp)-1);
|
---|
956 | RegSetValueEx(hkey,"sList",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
957 |
|
---|
958 | GetLocaleInfo(lcid, LOCALE_IMEASURE, tmp, sizeof(tmp)-1);
|
---|
959 | RegSetValueEx(hkey,"sMeasure",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
960 |
|
---|
961 | GetLocaleInfo(lcid, LOCALE_SDECIMAL, tmp, sizeof(tmp)-1);
|
---|
962 | RegSetValueEx(hkey,"sDecimal",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
963 |
|
---|
964 | GetLocaleInfo(lcid, LOCALE_STHOUSAND, tmp, sizeof(tmp)-1);
|
---|
965 | RegSetValueEx(hkey,"sThousand",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
966 |
|
---|
967 | GetLocaleInfo(lcid, LOCALE_IDIGITS, tmp, sizeof(tmp)-1);
|
---|
968 | RegSetValueEx(hkey,"iDigits",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
969 |
|
---|
970 | GetLocaleInfo(lcid, LOCALE_ILZERO, tmp, sizeof(tmp)-1);
|
---|
971 | RegSetValueEx(hkey,"iLZero",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
972 |
|
---|
973 | GetLocaleInfo(lcid, LOCALE_SCURRENCY, tmp, sizeof(tmp)-1);
|
---|
974 | RegSetValueEx(hkey,"sCurrency",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
975 |
|
---|
976 | GetLocaleInfo(lcid, LOCALE_ICURRDIGITS, tmp, sizeof(tmp)-1);
|
---|
977 | RegSetValueEx(hkey,"iCurrDigits",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
978 |
|
---|
979 | GetLocaleInfo(lcid, LOCALE_ICURRENCY, tmp, sizeof(tmp)-1);
|
---|
980 | RegSetValueEx(hkey,"iCurrency",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
981 |
|
---|
982 | GetLocaleInfo(lcid, LOCALE_INEGCURR, tmp, sizeof(tmp)-1);
|
---|
983 | RegSetValueEx(hkey,"iNegCurr",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
984 |
|
---|
985 | GetLocaleInfo(lcid, LOCALE_SDATE, tmp, sizeof(tmp)-1);
|
---|
986 | RegSetValueEx(hkey,"sDate",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
987 |
|
---|
988 | GetLocaleInfo(lcid, LOCALE_STIME, tmp, sizeof(tmp)-1);
|
---|
989 | RegSetValueEx(hkey,"sTime",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
990 |
|
---|
991 | GetLocaleInfo(lcid, LOCALE_SSHORTDATE, tmp, sizeof(tmp)-1);
|
---|
992 | RegSetValueEx(hkey,"sShortDate",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
993 |
|
---|
994 | GetLocaleInfo(lcid, LOCALE_SLONGDATE, tmp, sizeof(tmp)-1);
|
---|
995 | RegSetValueEx(hkey,"sLongDate",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
996 |
|
---|
997 | GetLocaleInfo(lcid, LOCALE_IDATE, tmp, sizeof(tmp)-1);
|
---|
998 | RegSetValueEx(hkey,"iDate",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
999 |
|
---|
1000 | GetLocaleInfo(lcid, LOCALE_ITIME, tmp, sizeof(tmp)-1);
|
---|
1001 | RegSetValueEx(hkey,"iTime",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
1002 |
|
---|
1003 | GetLocaleInfo(lcid, LOCALE_ITLZERO, tmp, sizeof(tmp)-1);
|
---|
1004 | RegSetValueEx(hkey,"iTLZero",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
1005 |
|
---|
1006 | GetLocaleInfo(lcid, LOCALE_S1159, tmp, sizeof(tmp)-1);
|
---|
1007 | RegSetValueEx(hkey,"s1159",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
1008 |
|
---|
1009 | GetLocaleInfo(lcid, LOCALE_S2359, tmp, sizeof(tmp)-1);
|
---|
1010 | RegSetValueEx(hkey,"s2359",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
1011 |
|
---|
1012 | GetLocaleInfo(lcid, LOCALE_ICALENDARTYPE, tmp, sizeof(tmp)-1);
|
---|
1013 | RegSetValueEx(hkey,"iCalendarType",0,REG_SZ, (LPBYTE)tmp, strlen(tmp)+1);
|
---|
1014 |
|
---|
1015 | RegCloseKey(hkey);
|
---|
1016 |
|
---|
1017 | if(RegCreateKey(HKEY_CURRENT_USER,"Control Panel\\International\\Sorting Order",&hkey)!=ERROR_SUCCESS) {
|
---|
1018 | dprintf(("SetupControlPanelKeys: Unable to create key"));
|
---|
1019 | return FALSE;
|
---|
1020 | }
|
---|
1021 | RegCloseKey(hkey);
|
---|
1022 | return TRUE;
|
---|
1023 | }
|
---|