Archive: Proper DIR for downloaded file


Proper DIR for downloaded file
Hello, Bit of a noob here, so I apologize in advance for anything stupid I may ask :)


I'm using NSIS to create an updater. Basically sends user to a webpage if update is detected.

I'd like this app to be for all users. I'm installing it to Program Files, but because it downloads a file for comparison, that file needs to be placed in a directory writable for all users.

I was going to go with $TEMP, but am not sure if that is the best practice. I also considered having the program create a folder in $APPDATA when run, but that would leave folders/files upon uninstall.

Also if $TEMP is the proper location, should it be "$TEMP\my.ini or "$TEMP\MyProg\my.ini

I appreciate any help offered. Thanks


SetShellVarContext all + $APPDATA

or

use the accesscontrol plugin to give write access for everyone to the .ini $programfiles


Thanks for the response.

SetShellVarContext all + $APPDATA is writing to common app data correct? If so, the docs state IE5+ is required. Thats something I may want to avoid.

Is there something dangerous or a problem with using $TEMP?

Again, thanks for the help. Its greatly appreciated.


$temp is per user, you said writeable for all users


I saw in the Docs "$TEMP The system temporary directory (usually C:\Windows\Temp but detected at runtime)." and thought this was a common area.

Ok, so I can use common app data to make sure everything is uninstalled but only if IE5+ is present.

Or I can use $TEMP, or $APPDATA (IE4+ needed to detect $APPDATA) and possibly leave a folder and a file behind on uninstall.

I'm not keen on making a dir in Program files writable to all users, seems risky.

Is there some other option I'm overlooking? I don't like the idea of leaving a file behind, but opening a security hole bothers me more.


you don't have to give write access to the whole dir, just the .ini. But why do all users need access to the file you download? Why not just download to $temp, check version and tell the user to upgrade or whatever if needed. Or, download to $temp, extract whatever info you need from that file and save it in the HKLM part of the registry


I think you described what I am doing. Here's the code I'm using.

InetLoad::load "http://someserver.com/New_Version.ini" "$TEMP\New_Version.ini"

ReadINIStr $4 "$EXEDIR\Old_Version.ini" Version version
ReadINIStr $5 "$TEMP\New_Version.ini" Version version
${VersionCompare} $4 $5 $R0
;then do something based on returned value


I just want to make sure that what I am doing is correct. The only problem is see here is that New_Version.ini will not be uninstalled if the App is removed.

Again, thanks for your time and patience


leaving a small text file behind in $temp is not a big deal, but you could put it in $pluginsdir instead and it will get auto deleted, or delete it from $temp after you use ReadInistr


Thanks Anders. The $PLUGINSDIR sounds ideal.