Solved Can portable software use the %TEMP% folder?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

AlomWare-com

Thread Starter
Joined
Jan 10, 2015
Messages
83
Need an opinion... we're working on a product that uses a lot of temporary data files, but want our app to be portable, because our mantra is that our apps don't modify files outside their own folder.

However, it seems to make sense that we store this temp data in the %TEMP% folder of the current user. Does that make our app non-portable? Would it be misleading to advertise it as portable in this case? Or is %TEMP% an exception?

Thanks for your thoughts.
 

foxidrive

Banned
Joined
Oct 20, 2012
Messages
793
A question I would ask is: does your app clean up these temp files?

If it needs them in a subsequent launch then there is no guarantee that the temp files will not have been cleaned by the user or by a tool used to clean the drive.
 

AlomWare-com

Thread Starter
Joined
Jan 10, 2015
Messages
83
The files are not kept. When the app launches, it deletes any existing ones first, then does its business. On closing, it also deletes them.

But I'm more worried that this means the app isn't portable in the true sense? Say if the user has it on a USB stick and runs it in a public library, the files won't be stored on his stick, but rather in the host PC's %TEMP% folder. That may be a privacy issue?
 

foxidrive

Banned
Joined
Oct 20, 2012
Messages
793
That may be a privacy issue?
If your app creates files that have personal info in them then I'd create them in the home folder, using a folder for it.

The %temp% folder is a free-for-all and any app can write files and folders there though,
so IMO a portable app can use it as legitimately as a statically installed app.
 

AlomWare-com

Thread Starter
Joined
Jan 10, 2015
Messages
83
Thanks for your thoughts. I've decided it's best that we put the temporary files into the user's own personal folder (CSIDL_PERSONAL, aka "My Documents"). A lot of other apps seem to do that, so it should be fine.
 

foxidrive

Banned
Joined
Oct 20, 2012
Messages
793
I've decided it's best that we put the temporary files into the user's own personal folder (CSIDL_PERSONAL, aka "My Documents")
Is this the "My Documents" user folder of the logged in user at the Library?
That folder is no better than the %temp% folder - in fact it's worse because it's public and in plain view.

Some libraries use "Deep Freeze" or similar to restore the OS to a default state between users, but not all do.
 
Joined
Jun 8, 2001
Messages
2,583
I'll agree with Foxdrive, feeling it would be intrusive to use My Documents. I hate the folder (try not to use it) but when I go there I expect to see stuff I put there not stuff from an App. I might delete them not sure what they where. The way you describe you app I think Temp would be fine.
 

AlomWare-com

Thread Starter
Joined
Jan 10, 2015
Messages
83
But if I use %Temp%, what's to stop an app like CCleaner wiping out the files while they're in use?
 

foxidrive

Banned
Joined
Oct 20, 2012
Messages
793
But if I use %Temp%, what's to stop an app like CCleaner wiping out the files while they're in use?
Only by people realising that CCleaner removes unlocked temp files of open programs too.

You could create a brand new folder in "%userprofile%" which is the logged in users home folder, and a folder in that place can be a name that you choose, and it is persistent too in a regular users PC.

It does seem to me though that a portable app should be using the folder where the app is, even if it's a new folder inside it.

Portable apps like the modified Thunderbird store everything in the same place AFAIK.
 

Ent

Josiah
Retired Trusted Advisor
Joined
Apr 11, 2009
Messages
5,467
I think it depends on what your purpose is in making it portable, and just as importantly what expectations others will have about it.
If you just want portability for convenience, so long as it starts up quickly and easily on whatever computer it's run on and keeps its settings, then I don't think it should matter all that much and might even be inclined to say that temp is the right place for these files. As for CCleaner being annoying, that's no less of an issue than a user manually deleting them. It's up to you as a programmer to make sure that the files in question are (a) hard to accidentally delete or (b) don't matter if they get accidentally deleted.

On the other hand I might have certain privacy expectations if I were running a portable app. I know that if the computer in question is infected with spyware there's nothing to hope for, but in general if I'm using portable firefox for example I expect that once I walk away the computer owner can't work out what I've been browsing. If your users have that kind of concern, then it is probably preferable to store any even potentially sensitive data in the same folder as, and implicitely on the same device as,
the main app.
 

AlomWare-com

Thread Starter
Joined
Jan 10, 2015
Messages
83
It does seem to me though that a portable app should be using the folder where the app is
You're right... we'll go instead with the local folder where the exe is, after all. Probably best all-round. Thanks for the discussion and points of view! :)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top