mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 09:03:25 +00:00
[SYSSETUP] Add support for shortcut arguments
This commit is contained in:
parent
9d06e79373
commit
7b33915adc
1 changed files with 8 additions and 3 deletions
|
@ -121,7 +121,8 @@ CreateShortcut(
|
||||||
LPCWSTR pszCommand,
|
LPCWSTR pszCommand,
|
||||||
LPCWSTR pszDescription,
|
LPCWSTR pszDescription,
|
||||||
INT iIconNr,
|
INT iIconNr,
|
||||||
LPCWSTR pszWorkingDir)
|
LPCWSTR pszWorkingDir,
|
||||||
|
LPCWSTR pszArgs)
|
||||||
{
|
{
|
||||||
DWORD dwLen;
|
DWORD dwLen;
|
||||||
LPWSTR Ptr;
|
LPWSTR Ptr;
|
||||||
|
@ -170,7 +171,7 @@ CreateShortcut(
|
||||||
/* Create the shortcut */
|
/* Create the shortcut */
|
||||||
return SUCCEEDED(CreateShellLink(szPath,
|
return SUCCEEDED(CreateShellLink(szPath,
|
||||||
pszCommand,
|
pszCommand,
|
||||||
L"",
|
pszArgs,
|
||||||
pszWorkingDir,
|
pszWorkingDir,
|
||||||
/* Special value to indicate no icon */
|
/* Special value to indicate no icon */
|
||||||
(iIconNr != -1 ? pszCommand : NULL),
|
(iIconNr != -1 ? pszCommand : NULL),
|
||||||
|
@ -188,6 +189,7 @@ static BOOL CreateShortcutsFromSection(HINF hinf, LPWSTR pszSection, LPCWSTR psz
|
||||||
WCHAR szName[MAX_PATH];
|
WCHAR szName[MAX_PATH];
|
||||||
WCHAR szDescription[MAX_PATH];
|
WCHAR szDescription[MAX_PATH];
|
||||||
WCHAR szDirectory[MAX_PATH];
|
WCHAR szDirectory[MAX_PATH];
|
||||||
|
WCHAR szArgs[MAX_PATH];
|
||||||
|
|
||||||
if (!SetupFindFirstLine(hinf, pszSection, NULL, &Context))
|
if (!SetupFindFirstLine(hinf, pszSection, NULL, &Context))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -213,9 +215,12 @@ static BOOL CreateShortcutsFromSection(HINF hinf, LPWSTR pszSection, LPCWSTR psz
|
||||||
if (dwFieldCount < 5 || !SetupGetStringFieldW(&Context, 5, szDirectory, ARRAYSIZE(szDirectory), NULL))
|
if (dwFieldCount < 5 || !SetupGetStringFieldW(&Context, 5, szDirectory, ARRAYSIZE(szDirectory), NULL))
|
||||||
szDirectory[0] = L'\0';
|
szDirectory[0] = L'\0';
|
||||||
|
|
||||||
|
if (dwFieldCount < 6 || !SetupGetStringFieldW(&Context, 6, szArgs, ARRAYSIZE(szArgs), NULL))
|
||||||
|
szArgs[0] = L'\0';
|
||||||
|
|
||||||
wcscat(szName, L".lnk");
|
wcscat(szName, L".lnk");
|
||||||
|
|
||||||
CreateShortcut(pszFolder, szName, szCommand, szDescription, iIconNr, szDirectory);
|
CreateShortcut(pszFolder, szName, szCommand, szDescription, iIconNr, szDirectory, szArgs);
|
||||||
|
|
||||||
} while (SetupFindNextLine(&Context, &Context));
|
} while (SetupFindNextLine(&Context, &Context));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue