1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved Can portable software use the %TEMP% folder?

Discussion in 'Software Development' started by AlomWare-com, Feb 8, 2015.

Thread Status:
Not open for further replies.
Advertisement
  1. AlomWare-com

    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.
     
  2. foxidrive

    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.
     
  3. AlomWare-com

    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?
     
  4. foxidrive

    foxidrive Banned

    Joined:
    Oct 20, 2012
    Messages:
    793
    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.
     
  5. AlomWare-com

    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.
     
  6. foxidrive

    foxidrive Banned

    Joined:
    Oct 20, 2012
    Messages:
    793
    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.
     
  7. draceplace

    draceplace

    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.
     
  8. AlomWare-com

    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?
     
  9. foxidrive

    foxidrive Banned

    Joined:
    Oct 20, 2012
    Messages:
    793
    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.
     
  10. Ent

    Ent Trusted Advisor

    Joined:
    Apr 11, 2009
    Messages:
    5,467
    First Name:
    Josiah
    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.
     
  11. AlomWare-com

    AlomWare-com Thread Starter

    Joined:
    Jan 10, 2015
    Messages:
    83
    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! :)
     
  12. Sponsor

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 733,556 other people just like you!

Loading...
Similar Threads - portable software %TEMP%
  1. surfnets
    Replies:
    0
    Views:
    230
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1142697

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice