Archive: Running a command line option - ExecDos?


Running a command line option - ExecDos?
I am trying to run a command to zip up certain files after an installation. I have included 7zip into the install folder and am now looking for a way to run the command.....

7za a -tzip tester.zip


I have been looking at using ExecDos::exec but haven't had any luck. I tried the command...

ExecDos::exec /TOFUNC '"7za a -tzip tester.zip"'

But it isn't working for me, is there an easier way to do it or am I on the right tracks with ExecDos?

Why not just call it using ExecWait or nsExec::Exec?


I have tried using...

ExecWait '"7za a -tzip tester.zip tester.txt"'

This still doesn't appear to run the command, or at least the zip file isn't created. If I run that command from the command prompt the zip is created so I'm sure the command is ok..


You need to give ExecWait a proper path.


Ok I have changed the line to....

ExecWait '""$INSTDIR\7za a -tzip $INSTDIR\tester.zip $INSTDIR\tester.txt'


Looking at the output from the installer it executes the command which reads

Execute: "C:\testfolder\7za a -tzip c:\testfolder\tester.zip c:\testfolder\tester.txt"


The zip file still doesn't get created :(

Try

ExecWait '"$INSTDIR\7za.exe" a -tzip "$INSTDIR\tester.zip" "$INSTDIR\tester.txt"'

This work fine for me

ExecDos::exec '"C:\Program Files\7-Zip\7z.exe" a -tzip "$EXEDIR\tester.zip" "C:\Program Files\7-Zip\Lang"' "" "$EXEDIR\stdout.txt"
Pop $0 ;

You had your quotes wrong. The quotes go around the file path only.

Stu


Thanks, all working now :)