- move shortcut comment texts into string resources
- add error handling
- create new "Accessories" folder in programs start menu
Modified: trunk/reactos/lib/syssetup/install.c
Modified: trunk/reactos/lib/syssetup/resource.h
Modified: trunk/reactos/lib/syssetup/syssetup_De.rc
Modified: trunk/reactos/lib/syssetup/syssetup_En.rc
_____
Modified: trunk/reactos/lib/syssetup/install.c
--- trunk/reactos/lib/syssetup/install.c 2005-10-17 09:44:17 UTC
(rev 18507)
+++ trunk/reactos/lib/syssetup/install.c 2005-10-17 11:03:30 UTC
(rev 18508)
@@ -158,17 +158,48 @@
}
-static VOID
-CreateShortcut(int csidl, LPCTSTR linkName, LPCTSTR command, LPCTSTR
title)
+static BOOL
+CreateShortcut(int csidl, LPCTSTR folder, LPCTSTR linkName, LPCTSTR
command, UINT nIdTitle)
{
TCHAR path[MAX_PATH];
+ TCHAR title[256];
+ LPTSTR p = path;
+
+ if (!SHGetSpecialFolderPath(0, path, csidl, TRUE))
+ return FALSE;
+
+ if (folder)
+ {
+ p = PathAddBackslash(p);
+ _tcscpy(p, folder);
+ }
+
+ p = PathAddBackslash(p);
+ _tcscpy(p, linkName);
+
+ if (!LoadString(hDllInstance, nIdTitle, title, 256))
+ return FALSE;
+
+ return SUCCEEDED(CreateShellLink(path, command, _T(""), NULL, NULL,
0, title));
+}
+
+
+static BOOL
+CreateShortcutFolder(int csidl, UINT nID, LPTSTR name, int nameLen)
+{
+ TCHAR path[MAX_PATH];
LPTSTR p;
- SHGetSpecialFolderPath(0, path, csidl, TRUE);
+ if (!SHGetSpecialFolderPath(0, path, csidl, TRUE))
+ return FALSE;
+
+ if (!LoadString(hDllInstance, nID, name, nameLen))
+ return FALSE;
+
p = PathAddBackslash(path);
- _tcscpy(p, linkName);
+ _tcscpy(p, name);
- CreateShellLink(path, command, _T(""), NULL, NULL, 0, title);
+ return CreateDirectory(path, NULL) ||
GetLastError()==ERROR_ALREADY_EXISTS;
}
@@ -365,6 +396,8 @@
DWORD STDCALL
InstallReactOS (HINSTANCE hInstance)
{
+ TCHAR sAccessories[256];
+
# if 0
OutputDebugStringA ("InstallReactOS() called\n");
@@ -397,16 +430,20 @@
CoInitialize(NULL);
- /* desktop shortcuts */
- CreateShortcut(CSIDL_DESKTOP, _T("Command Prompt.lnk"),
_T("cmd.exe"), _T("Open command prompt"));
+ /* create desktop shortcuts */
+ CreateShortcut(CSIDL_DESKTOP, NULL, _T("Command Prompt.lnk"),
_T("cmd.exe"), IDS_CMT_CMD);
- /* program startmenu shortcuts */
- CreateShortcut(CSIDL_PROGRAMS, _T("Command Prompt.lnk"),
_T("cmd.exe"), _T("Open command prompt"));
- CreateShortcut(CSIDL_PROGRAMS, _T("explorer.lnk"),
_T("explorer.exe"), _T("Launch Explorer"));
- CreateShortcut(CSIDL_PROGRAMS, _T("winefile.lnk"),
_T("winefile.exe"), _T("Launch Winefile"));
- CreateShortcut(CSIDL_PROGRAMS, _T("notepad.lnk"),
_T("notepad.exe"),
_T("Launch Text Editor"));
- CreateShortcut(CSIDL_PROGRAMS, _T("regedit.lnk"),
_T("regedit.exe"),
_T("Launch Registry Editor"));
+ /* create program startmenu shortcuts */
+ CreateShortcut(CSIDL_PROGRAMS, NULL, _T("Command Prompt.lnk"),
_T("cmd.exe"), IDS_CMT_CMD);
+ CreateShortcut(CSIDL_PROGRAMS, NULL, _T("explorer.lnk"),
_T("explorer.exe"), IDS_CMT_EXPLORER);
+ CreateShortcut(CSIDL_PROGRAMS, NULL, _T("winefile.lnk"),
_T("winefile.exe"), IDS_CMT_WINEFILE);
+ /* create and fill Accessories subfolder */
+ if (CreateShortcutFolder(CSIDL_PROGRAMS, IDS_ACCESSORIES,
sAccessories, 256)) {
+ CreateShortcut(CSIDL_PROGRAMS, sAccessories, _T("notepad.lnk"),
_T("notepad.exe"), IDS_CMT_NOTEPAD);
+ CreateShortcut(CSIDL_PROGRAMS, sAccessories, _T("regedit.lnk"),
_T("regedit.exe"), IDS_CMT_REGEDIT);
+ }
+
CoUninitialize();
/* Create the semi-random Domain-SID */
_____
Modified: trunk/reactos/lib/syssetup/resource.h
--- trunk/reactos/lib/syssetup/resource.h 2005-10-17 09:44:17 UTC
(rev 18507)
+++ trunk/reactos/lib/syssetup/resource.h 2005-10-17 11:03:30 UTC
(rev 18508)
@@ -85,6 +85,14 @@
#define IDS_ACKPROJECTS 3100
+#define IDS_ACCESSORIES 3200
+
+#define IDS_CMT_CMD 3210
+#define IDS_CMT_EXPLORER 3211
+#define IDS_CMT_WINEFILE 3212
+#define IDS_CMT_NOTEPAD 3213
+#define IDS_CMT_REGEDIT 3214
+
#define IDR_GPL 4000
#endif /* RESOURCE_H */
_____
Modified: trunk/reactos/lib/syssetup/syssetup_De.rc
--- trunk/reactos/lib/syssetup/syssetup_De.rc 2005-10-17 09:44:17 UTC
(rev 18507)
+++ trunk/reactos/lib/syssetup/syssetup_De.rc 2005-10-17 11:03:30 UTC
(rev 18508)
@@ -188,9 +188,19 @@
IDS_LOCALETITLE "Regionale Einstellungen"
IDS_LOCALESUBTITLE "Sie k÷nnen ReactOS auf unterschiedliche
Regionen und Sprachen einstellen."
IDS_DATETIMETITLE "Datum und Uhrzeit"
- IDS_DATETIMESUBTITLE "SSetzen Sie das korrekte Datum und Uhrzeit
f³r ihren Computer."
+ IDS_DATETIMESUBTITLE "Setzen Sie das korrekte Datum und Uhrzeit f³r
ihren Computer."
IDS_PROCESSTITLE "Process page title"
IDS_PROCESSSUBTITLE "Process page subtitle"
END
+STRINGTABLE
+BEGIN
+ IDS_ACCESSORIES "Zubeh÷r"
+ IDS_CMT_CMD "Íffne Kommandozeilenfenster"
+ IDS_CMT_EXPLORER "Starte Explorer"
+ IDS_CMT_WINEFILE "Starte Winefile"
+ IDS_CMT_NOTEPAD "Starte Texteditor"
+ IDS_CMT_REGEDIT "Starte Registry Editor"
+END
+
/* EOF */
_____
Modified: trunk/reactos/lib/syssetup/syssetup_En.rc
--- trunk/reactos/lib/syssetup/syssetup_En.rc 2005-10-17 09:44:17 UTC
(rev 18507)
+++ trunk/reactos/lib/syssetup/syssetup_En.rc 2005-10-17 11:03:30 UTC
(rev 18508)
@@ -194,4 +194,14 @@
IDS_PROCESSSUBTITLE "Process page subtitle"
END
+STRINGTABLE
+BEGIN
+ IDS_ACCESSORIES "Accessories"
+ IDS_CMT_CMD "Open command prompt"
+ IDS_CMT_EXPLORER "Launch Explorer"
+ IDS_CMT_WINEFILE "Launch Winefile"
+ IDS_CMT_NOTEPAD "Launch Text Editor"
+ IDS_CMT_REGEDIT "Launch Registry Editor"
+END
+
/* EOF */