size optimization - SetOutPath already sets the working directory so there's no need to pass $OUTDIR to myCreateProcess
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5104 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9bcbddcd83
commit
3ab94d5029
4 changed files with 6 additions and 9 deletions
|
@ -201,6 +201,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
|
||||
mystrcat(state_temp_dir,"~nsu.tmp");
|
||||
CreateDirectory(state_temp_dir,NULL);
|
||||
SetCurrentDirectory(state_temp_dir);
|
||||
|
||||
if (!state_install_directory[0])
|
||||
mystrcpy(state_install_directory,state_exe_directory);
|
||||
|
@ -233,7 +234,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
|
|||
MoveFileOnReboot(state_temp_dir,NULL);
|
||||
#endif
|
||||
GetNSISString(buf2,g_header->str_uninstcmd); // '"$TEMP\$1" $0 _?=$INSTDIR\'
|
||||
hProc=myCreateProcess(buf2,state_temp_dir);
|
||||
hProc=myCreateProcess(buf2);
|
||||
if (hProc)
|
||||
{
|
||||
CloseHandle(hProc);
|
||||
|
|
|
@ -865,7 +865,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
log_printf2("Exec: command=\"%s\"",buf0);
|
||||
update_status_text(LANG_EXECUTE,buf0);
|
||||
|
||||
hProc=myCreateProcess(buf0,state_output_directory);
|
||||
hProc=myCreateProcess(buf0);
|
||||
|
||||
if (hProc)
|
||||
{
|
||||
|
|
|
@ -50,16 +50,12 @@ NSIS_STRING g_usrvars[1] __attribute__((section (NSIS_VARS_SECTION)));
|
|||
# endif
|
||||
#endif
|
||||
|
||||
HANDLE NSISCALL myCreateProcess(char *cmd, char *dir)
|
||||
HANDLE NSISCALL myCreateProcess(char *cmd)
|
||||
{
|
||||
DWORD d;
|
||||
PROCESS_INFORMATION ProcInfo;
|
||||
static STARTUPINFO StartUp;
|
||||
StartUp.cb=sizeof(StartUp);
|
||||
d=GetFileAttributes(dir);
|
||||
if (d == INVALID_FILE_ATTRIBUTES || !(d&FILE_ATTRIBUTE_DIRECTORY))
|
||||
dir=0;
|
||||
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, dir, &StartUp, &ProcInfo))
|
||||
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &StartUp, &ProcInfo))
|
||||
return NULL;
|
||||
CloseHandle(ProcInfo.hThread);
|
||||
return ProcInfo.hProcess;
|
||||
|
|
|
@ -72,7 +72,7 @@ extern char g_log_file[1024];
|
|||
#define LogData2Hex(x1,x2,x3,x4)
|
||||
#endif
|
||||
|
||||
HANDLE NSISCALL myCreateProcess(char *cmd, char *dir);
|
||||
HANDLE NSISCALL myCreateProcess(char *cmd);
|
||||
int NSISCALL my_MessageBox(const char *text, UINT type);
|
||||
|
||||
void NSISCALL myDelete(char *buf, int flags);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue