Author: mjmartin
Date: Mon Apr 6 00:05:40 2009
New Revision: 40377
URL:
http://svn.reactos.org/svn/reactos?rev=40377&view=rev
Log:
- Create Common Files directory when creating Program Files to match windows fresh install
and add registry key for CommonFilesDir.
This prevents the key from being incorrectly set using an environment variable.
Modified:
trunk/reactos/dll/win32/userenv/lang/bg-BG.rc
trunk/reactos/dll/win32/userenv/lang/cs-CZ.rc
trunk/reactos/dll/win32/userenv/lang/de-DE.rc
trunk/reactos/dll/win32/userenv/lang/el-GR.rc
trunk/reactos/dll/win32/userenv/lang/en-US.rc
trunk/reactos/dll/win32/userenv/lang/es-ES.rc
trunk/reactos/dll/win32/userenv/lang/fi-FI.rc
trunk/reactos/dll/win32/userenv/lang/fr-FR.rc
trunk/reactos/dll/win32/userenv/lang/hu-HU.rc
trunk/reactos/dll/win32/userenv/lang/id-ID.rc
trunk/reactos/dll/win32/userenv/lang/it-IT.rc
trunk/reactos/dll/win32/userenv/lang/ja-JP.rc
trunk/reactos/dll/win32/userenv/lang/lt-LT.rc
trunk/reactos/dll/win32/userenv/lang/nl-NL.rc
trunk/reactos/dll/win32/userenv/lang/no-NO.rc
trunk/reactos/dll/win32/userenv/lang/pl-PL.rc
trunk/reactos/dll/win32/userenv/lang/ru-RU.rc
trunk/reactos/dll/win32/userenv/lang/sk-SK.rc
trunk/reactos/dll/win32/userenv/lang/sv-SE.rc
trunk/reactos/dll/win32/userenv/lang/th-TH.rc
trunk/reactos/dll/win32/userenv/lang/uk-UA.rc
trunk/reactos/dll/win32/userenv/resources.h
trunk/reactos/dll/win32/userenv/setup.c
Modified: trunk/reactos/dll/win32/userenv/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/bg-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/bg-BG.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/bg-BG.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "Ìåñòíè íàñòðîéêè\\Ïîñåòåíè"
IDS_COOKIES "Êóðàáèéêè"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/cs-CZ.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/cs-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/cs-CZ.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/cs-CZ.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -45,4 +45,5 @@
IDS_HISTORY "Local Settings\\History"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/de-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/de-DE.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "Lokale Einstellungen\\Verlauf"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Programme"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/el-GR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/el-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/el-GR.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/el-GR.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "Local Settings\\History"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/en-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/en-US.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "Local Settings\\History"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/es-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/es-ES.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -50,4 +50,5 @@
IDS_HISTORY "Configuración local\\Historial"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Archivos de programa"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/fi-FI.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/fi-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/fi-FI.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/fi-FI.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,5 +44,6 @@
IDS_HISTORY "Paikalliset Asetukset\\Historia"
IDS_COOKIES "Keksit"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/fr-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/fr-FR.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "Local Settings\\Historique"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/hu-HU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/hu-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/hu-HU.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/hu-HU.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -45,4 +45,5 @@
IDS_HISTORY "Local Settings\\History"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/id-ID.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/id-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/id-ID.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/id-ID.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "Local Settings\\History"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/it-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/it-IT.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/it-IT.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -38,4 +38,5 @@
IDS_HISTORY "Impostazioni locali\\Cronologia"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Programmi"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/ja-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/ja-JP.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/ja-JP.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -26,4 +26,5 @@
IDS_HISTORY "Local Settings\\History"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/lt-LT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/lt-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/lt-LT.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/lt-LT.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -46,4 +46,5 @@
IDS_HISTORY "Local Settings\\History"
IDS_COOKIES "Slapukai"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/nl-NL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/nl-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/nl-NL.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/nl-NL.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "Local Settings\\Geschiedenis"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/no-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/no-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/no-NO.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/no-NO.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -47,4 +47,5 @@
IDS_HISTORY "Lokale innstillinger\\Logg"
IDS_COOKIES "Informasjonkapsel"
IDS_PROGRAMFILES "%SystemDrive%\\Programfiler"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/pl-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/pl-PL.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -49,4 +49,5 @@
IDS_HISTORY "Ustawienia lokalne\\Historia"
IDS_COOKIES "Ciasteczka"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/ru-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/ru-RU.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "Local Settings\\History"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/sk-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/sk-SK.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/sk-SK.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -48,4 +48,5 @@
IDS_HISTORY "Local Settings\\History"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/sv-SE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/sv-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/sv-SE.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/sv-SE.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "Lokala inställningar\\Tidigare"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/th-TH.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/th-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/th-TH.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/th-TH.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "¡ÒõÑ駤èÒµÑ駵é¹\\»ÃÐÇѵÔãªé§Ò¹"
IDS_COOKIES "¤Ø¡¡Õé"
IDS_PROGRAMFILES "%SystemDrive%\\â»Ãá¡ÃÁä¿Åì"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/uk-…
==============================================================================
--- trunk/reactos/dll/win32/userenv/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/lang/uk-UA.rc [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -44,4 +44,5 @@
IDS_HISTORY "Local Settings\\History"
IDS_COOKIES "Cookies"
IDS_PROGRAMFILES "%SystemDrive%\\Program Files"
+ IDS_COMMONFILES "Common Files"
END
Modified: trunk/reactos/dll/win32/userenv/resources.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/resource…
==============================================================================
--- trunk/reactos/dll/win32/userenv/resources.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/resources.h [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -49,5 +49,6 @@
#define IDS_HISTORY 22
#define IDS_COOKIES 23
#define IDS_PROGRAMFILES 24
+#define IDS_COMMONFILES 25
/* EOF */
Modified: trunk/reactos/dll/win32/userenv/setup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/setup.c?…
==============================================================================
--- trunk/reactos/dll/win32/userenv/setup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/userenv/setup.c [iso-8859-1] Mon Apr 6 00:05:40 2009
@@ -109,6 +109,7 @@
{
WCHAR szProfilesPath[MAX_PATH];
WCHAR szProfilePath[MAX_PATH];
+ WCHAR szCommonFilesDirPath[MAX_PATH];
WCHAR szBuffer[MAX_PATH];
DWORD dwLength;
PFOLDERDATA lpFolderData;
@@ -584,6 +585,14 @@
return FALSE;
}
+ if (!LoadStringW(hInstance,
+ IDS_COMMONFILES,
+ szCommonFilesDirPath,
+ MAX_PATH))
+ {
+ DPRINT1("Warning: %lu\n", GetLastError());
+ }
+
/* Expand it */
if (!ExpandEnvironmentStringsW(szBuffer,
szProfilesPath,
@@ -591,6 +600,17 @@
{
DPRINT1("Error: %lu\n", GetLastError());
return FALSE;
+ }
+
+ wcscpy(szBuffer, szProfilesPath);
+ wcscat(szBuffer, L"\\");
+ wcscat(szBuffer, szCommonFilesDirPath);
+
+ if (!ExpandEnvironmentStringsW(szBuffer,
+ szCommonFilesDirPath,
+ MAX_PATH))
+ {
+ DPRINT1("Warning: %lu\n", GetLastError());
}
/* Store it */
@@ -621,6 +641,18 @@
return FALSE;
}
+ dwLength = (wcslen(szCommonFilesDirPath) + 1) * sizeof(WCHAR);
+ Error = RegSetValueExW(hKey,
+ L"CommonFilesDir",
+ 0,
+ REG_SZ,
+ (LPBYTE)szCommonFilesDirPath,
+ dwLength);
+ if (Error != ERROR_SUCCESS)
+ {
+ DPRINT1("Warning: %lu\n", Error);
+ }
+
RegCloseKey (hKey);
/* Create directory */
@@ -630,6 +662,15 @@
{
DPRINT1("Error: %lu\n", GetLastError());
return FALSE;
+ }
+ }
+
+ /* Create directory */
+ if (!CreateDirectoryW(szCommonFilesDirPath, NULL))
+ {
+ if (GetLastError () != ERROR_ALREADY_EXISTS)
+ {
+ DPRINT1("Warning: %lu\n", GetLastError());
}
}