Have a look at this recent topic:
There's no standard insructions for what you want.
To stop it deleting the temp folder at the end you could open a txt file in the folder and not close it:
FileOpen $R0 "$PLUGINSDIR\file.tmp" w
Why though do you need these things?