From 1c694b55bcd0f661e10b8bf65ae082883977db4e Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Wed, 11 Jul 2007 19:43:57 +0000 Subject: [PATCH] Fix checking the file's existence svn path=/trunk/; revision=27599 --- reactos/dll/win32/syssetup/install.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/reactos/dll/win32/syssetup/install.c b/reactos/dll/win32/syssetup/install.c index 9a6db519817..ef7e8990dbd 100644 --- a/reactos/dll/win32/syssetup/install.c +++ b/reactos/dll/win32/syssetup/install.c @@ -146,24 +146,11 @@ CreateShortcut(int csidl, LPCTSTR folder, UINT nIdName, LPCTSTR command, UINT nI TCHAR title[256]; TCHAR name[256]; LPTSTR p = path; - TCHAR szSystemPath[MAX_PATH]; - TCHAR szProgramPath[MAX_PATH]; TCHAR szWorkingDir[MAX_PATH]; LPTSTR lpWorkingDir = NULL; LPTSTR lpFilePart; DWORD dwLen; - if (bCheckExistence) - { - if (!GetSystemDirectory(szSystemPath, sizeof(szSystemPath)/sizeof(szSystemPath[0]))) - return FALSE; - _tcscpy(szProgramPath, szSystemPath); - _tcscat(szProgramPath, _T("\\")); - if ((_taccess(_tcscat(szProgramPath, command), 0 )) == -1) - /* Expected error, don't return FALSE */ - return TRUE; - } - if (ExpandEnvironmentStrings(command, path, sizeof(path) / sizeof(path[0])) == 0) @@ -172,6 +159,13 @@ CreateShortcut(int csidl, LPCTSTR folder, UINT nIdName, LPCTSTR command, UINT nI command); } + if (bCheckExistence) + { + if ((_taccess(path, 0 )) == -1) + /* Expected error, don't return FALSE */ + return TRUE; + } + dwLen = GetFullPathName(path, sizeof(szWorkingDir) / sizeof(szWorkingDir[0]), szWorkingDir,