metalogic
27th September 2003 09:23 UTC
Get temp folder
Hi all,
I need to create a temp folder. Either that or just use the temp folder that NSIS uses (I'm assuming it uses one anyway).
That's because I'm downloading a file and I need to extract it. Then I want to remove the whole folder when I'm done.
I found a function for getting a temp file name but not one for a temp folder.
Any help appreciated.
TIA,
Santiago
kichik
27th September 2003 10:20 UTC
See $TEMP and $PLUGINSDIR in:
http://nsis.sourceforge.net/Docs/Chapter4.html#4.2
metalogic
27th September 2003 10:37 UTC
Kichik,
Thanks you for your reply.
$TEMP returns the windows temp folder. What I really need is a folder inside of $TEMP which I can delete when I'm done. So this won't work.
$PLUGINSDIR would work I guess, as long as I call InitPluginsDir first (since I need the folder before I call the download plugin). I'll try this.
Thanks again,
Santiago
Afrow UK
27th September 2003 10:51 UTC
Why not "$TEMP\myfolder"
-Stu
metalogic
27th September 2003 10:55 UTC
That's how I initially coded it. But thinking about it further, I couldn’t guarantee that “myfolder” wouldn’t already exist. So I decided that a temp folder would be a safer way to go.
Joost Verburg
27th September 2003 23:51 UTC
Using the plug-ins directory is definately the best solution.
metalogic
29th September 2003 04:30 UTC
Joost,
I agree with you. The plug-ins folder works great for my scenario. So you can consider this thread solved.
Something worth mentioning is that if I wasn't using plug-ins, this solution wouldn't have been feasible. So even though I'm good to go, a GetTempFolder statement could be a good feature to have for the future.
Thanks,
Santiago
Joost Verburg
29th September 2003 07:37 UTC
Why? Using InitPluginsDir, you can always create the plug-in directory, even if you are not using plug-ins.
metalogic
29th September 2003 17:40 UTC
Ah!
I didn't realize that. In that case we're all good to go.
Case closed.
Thanks,
Santiago