Index: dll/win32/syssetup/install.c =================================================================== --- dll/win32/syssetup/install.c (revision 71048) +++ dll/win32/syssetup/install.c (working copy) @@ -143,13 +143,13 @@ LPCTSTR pszName, LPCTSTR pszCommand, LPCTSTR pszDescription, - INT iIconNr) + INT iIconNr, + LPCTSTR pszWorkingDir) { TCHAR szPath[MAX_PATH]; TCHAR szExeName[MAX_PATH]; LPTSTR Ptr; TCHAR szWorkingDirBuf[MAX_PATH]; - LPTSTR pszWorkingDir = NULL; LPTSTR lpFilePart; DWORD dwLen; @@ -177,18 +177,22 @@ /* Save the file name */ _tcscpy(szExeName, lpFilePart); - /* We're only interested in the path. Cut the file name off. - Also remove the trailing backslash unless the working directory - is only going to be a drive, ie. C:\ */ - *(lpFilePart--) = _T('\0'); - if (!(lpFilePart - szWorkingDirBuf == 2 && szWorkingDirBuf[1] == _T(':') && - szWorkingDirBuf[2] == _T('\\'))) + if (pszWorkingDir == NULL || pszWorkingDir[0] == '\0') { - *lpFilePart = _T('\0'); + /* We're only interested in the path. Cut the file name off. + Also remove the trailing backslash unless the working directory + is only going to be a drive, ie. C:\ */ + *(lpFilePart--) = _T('\0'); + if (!(lpFilePart - szWorkingDirBuf == 2 && szWorkingDirBuf[1] == _T(':') && + szWorkingDirBuf[2] == _T('\\'))) + { + *lpFilePart = _T('\0'); + } + pszWorkingDir = szWorkingDirBuf; } - - pszWorkingDir = szWorkingDirBuf; } + else if (pszWorkingDir && pszWorkingDir[0] == '\0') + pszWorkingDir = NULL; _tcscpy(szPath, pszFolder); @@ -208,6 +212,8 @@ WCHAR szName[MAX_PATH]; WCHAR szDescription[MAX_PATH]; INT iIconNr; + WCHAR szDirectory[MAX_PATH]; + DWORD dwFieldCount; if (!SetupFindFirstLine(hinf, pszSection, NULL, &Context)) return FALSE; @@ -214,7 +220,7 @@ do { - if (SetupGetFieldCount(&Context) < 4) + if ((dwFieldCount=SetupGetFieldCount(&Context)) < 4) continue; if (!SetupGetStringFieldW(&Context, 1, szCommand, MAX_PATH, NULL)) @@ -229,9 +235,12 @@ if (!SetupGetIntField(&Context, 4, &iIconNr)) continue; + if (dwFieldCount < 5 || !SetupGetStringFieldW(&Context, 5, szDirectory, MAX_PATH, NULL)) + szDirectory[0] = '\0'; + _tcscat(szName, L".lnk"); - CreateShortcut(pszFolder, szName, szCommand, szDescription, iIconNr); + CreateShortcut(pszFolder, szName, szCommand, szDescription, iIconNr, szDirectory); }while (SetupFindNextLine(&Context, &Context)); Index: media/inf/shortcuts.inf =================================================================== --- media/inf/shortcuts.inf (revision 71048) +++ media/inf/shortcuts.inf (working copy) @@ -14,7 +14,7 @@ GamesShortcuts=2, %GAMES% [DesktopShortcuts] -%SystemRoot%\system32\cmd.exe, %CMD_TITLE%, %CMD_DESC%, 0 +%SystemRoot%\system32\cmd.exe, %CMD_TITLE%, %CMD_DESC%, 0, %HOMEDRIVE%%HOMEPATH% %SystemRoot%\system32\rapps.exe, %RAPPS_TITLE_SHORT%, %RAPPS_DESC%, 0 [ProgramShortcuts]