Menu

#800 "Exec" doesn't set working directory

2.0 Series
closed-invalid
Scripting (211)
5
2008-09-05
2008-07-28
Anonymous
No

It seems myCreateProcess(), in exehead/util.c, doesn't care about $OUTDIR (== state_output_directory).

######### test script
OutFile "exetest.exe"

Function .OnInit
StrCpy $OUTDIR "C:"
MessageBox MB_OK 'Execshell should open prompt "c:\>"'
ExecShell "" "CMD"
MessageBox MB_OK 'Exec should also open prompt "c:\>" but...'
Exec "CMD"
Quit
FunctionEnd
Section
SectionEnd

Discussion

  • Nobody/Anonymous

    Logged In: NO

    SetOutPath sets the working dir...

     
  • Ryan Schipper

    Ryan Schipper - 2008-08-12

    Logged In: YES
    user_id=1045042
    Originator: NO

    From the documentation:

    4.9.1.9 SetOutPath

    outpath

    Sets the output path ($OUTDIR) and creates it (recursively if necessary), if it does not exist. Must be a full pathname, usually is just $INSTDIR (you can specify $INSTDIR if you are lazy with a single "-").

    SetOutPath $INSTDIR
    File program.exe
    ===

    Clearly, as the script is accurate, setting OUTDIR does not affect the working direct used by Exec

     
  • Amir Szekely

    Amir Szekely - 2008-09-05
    • assigned_to: nobody --> kichik
    • status: open --> closed-invalid
     
  • Amir Szekely

    Amir Szekely - 2008-09-05

    Logged In: YES
    user_id=584402
    Originator: NO

    As said, it's SetOutPath that sets the working directory. Setting $OUTDIR itself with StrCpy is not enough.

     

Log in to post a comment.