Archive: Direct command to copy, execute and delete files


Direct command to copy, execute and delete files
I wanna know whether there is a direct command to do following things instead of doing them separately:
- Copy files including an executable file to a temp folder
- Run that executable file
- Delete the temp folder

Thanx..


I think you'll have to use multiple commands, eg:

File ".."
File ".."
ExecWait "ExeInTempFolder.exe"
RMDir /r /REBOOTOK "$TEMP"

In .Net theres "Code Snippets" and there's the MY keyword in VB.Net for more of a LOP feel, but not in NSIS. If you want a one command solution, say for re-usability.. then you could wrap the calls up in a macro or function and issue one direct command that way. Anyway thats my 2 cents...


use the following


InitPluginsDir ; this creates a temporary directory for the installer to work
File "$PLUGINSDIR\ExeInTempFolder.exe"
; more "File" instructions if you need to extract more temporary stuff
ExecWait '"$PLUGINSDIR\ExeInTempFolder.exe"'
; $PLUGINSDIR directory is automatically cleaned-up at the end of installer