diff --git a/reactos/lib/syssetup/install.c b/reactos/lib/syssetup/install.c index a11cf6ed8a0..91d4aec7b4d 100644 --- a/reactos/lib/syssetup/install.c +++ b/reactos/lib/syssetup/install.c @@ -158,17 +158,48 @@ HRESULT CreateShellLink(LPCTSTR linkPath, LPCTSTR cmd, LPCTSTR arg, LPCTSTR dir, } -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); - p = PathAddBackslash(path); - _tcscpy(p, linkName); + if (!SHGetSpecialFolderPath(0, path, csidl, TRUE)) + return FALSE; - CreateShellLink(path, command, _T(""), NULL, NULL, 0, title); + if (!LoadString(hDllInstance, nID, name, nameLen)) + return FALSE; + + p = PathAddBackslash(path); + _tcscpy(p, name); + + return CreateDirectory(path, NULL) || GetLastError()==ERROR_ALREADY_EXISTS; } @@ -365,6 +396,8 @@ ProcessSysSetupInf(VOID) DWORD STDCALL InstallReactOS (HINSTANCE hInstance) { + TCHAR sAccessories[256]; + # if 0 OutputDebugStringA ("InstallReactOS() called\n"); @@ -397,15 +430,19 @@ InstallReactOS (HINSTANCE hInstance) 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(); diff --git a/reactos/lib/syssetup/resource.h b/reactos/lib/syssetup/resource.h index d7eac37146a..e7b083e19a0 100644 --- a/reactos/lib/syssetup/resource.h +++ b/reactos/lib/syssetup/resource.h @@ -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 */ diff --git a/reactos/lib/syssetup/syssetup_De.rc b/reactos/lib/syssetup/syssetup_De.rc index 153fefcaf90..c2194666660 100644 --- a/reactos/lib/syssetup/syssetup_De.rc +++ b/reactos/lib/syssetup/syssetup_De.rc @@ -188,9 +188,19 @@ BEGIN 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 */ diff --git a/reactos/lib/syssetup/syssetup_En.rc b/reactos/lib/syssetup/syssetup_En.rc index e8089bb5536..86773c59bae 100644 --- a/reactos/lib/syssetup/syssetup_En.rc +++ b/reactos/lib/syssetup/syssetup_En.rc @@ -194,4 +194,14 @@ BEGIN 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 */