Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

a customer's I have some applications that are installed with plain xcopy. I know those applications will write some data into their installed directory at runtime. Now I want this application to be available for all users on my PC from the start menu. Where do I put these app under windows 7? Is it still "c:\Program Files" ? If so wouldn't the apps need admin rights to write to that directory? Is this where roaming kicks in? If so, how can I prevent the app from writing to a special per-user roaming folder and instead make it write to the ONE folder the exe is in?

Update (rephrasing the question):

What is the suggested/preferred/official way to deploy an application (just a folder with an exe and some extra files) to a customer's Windows 7 PC, so that:

  1. it will be available to all users (everybody can doubleclick the exe or a shortcut to it)
  2. there is only one instance of the files (not a copy for each user)
  3. the exe can read and write to the same physical folder it resides in (so that it reads the same files, no matter what user is running the app)
  4. no UAC dialog asking for privileged rights pops up when the exe is run (the exe iteself doesn't do anything that'd require this)
share|improve this question
    
Please don't just downvote. Explain (in the comments) why you downvoted this question, so I can improve it. –  bitbonk Aug 20 '13 at 12:50
    
Are these applications you've written or commercial products? –  Dave Aug 20 '13 at 13:08
    
This question reads like an XY problem. Can you explain why you're trying to achieve this please, there may be another solution for you. –  Dave Aug 20 '13 at 13:14
    
Can these simply live on a network share? This way you can control permissions from the server and all you have to do is copy shortcuts to public startmenu and/or desktop –  MDT Guy Aug 27 '13 at 18:28

4 Answers 4

up vote 3 down vote accepted
+100

If you want an application to be accessible for all users, it should be installed in the Program Files directory (Program Files (x86) where applicable.)

The application will not be able to write to the folder it is installed in though, unless started with elevated privileges (which you don't want). And doing so would be a bad idea anyway. You should never want to do this.

Instead, you'll want to write user-specific files to their profile folders. Depending on what you want, you would either write the data to the Roaming or Local user data folders. If you don't know, then ask yourself how the application should behave in a domain environment. Generally, the Roaming profile (as the name implies) travels with the user to other workstations. If that isn't desirable for your application, use the Local profile.

If you absolutely need to have shared data that all users need to be able to read and write, then simply don't place it in the installation directory (for writing). Upon startup of your application, check if the file exists in the local profile of the Public user. If it doesn't, copy the file there from your installation directory and then use the copy from thereon.

share|improve this answer
    
The problem is that I have no control over the application source code and and the exe will try to write files to the folder it resides in. It is required that the exe will always write to the same physical folder and the data is shared across all users. –  bitbonk Aug 20 '13 at 14:16
1  
@bitbonk: In such a case I would probably install it directly into the public, local profile (aka C:\ProgramData). superuser.com/questions/405097/… You're probably going to have to adjust the write permissions for all users on that folder though (probably using icacls in your installation batch file). serverfault.com/questions/335625/… –  Oliver Salzburg Aug 20 '13 at 14:55
    
This sounds smartest to me. If you're using MDT, you can use a script to modify permissions using the command line –  MDT Guy Aug 27 '13 at 18:29

What is the suggested/preferred/official way to deploy an application (just a folder with an exe and some extra files) to a customer's Windows 7 PC, so that:

The suggest/preferred/official way is not do what you are wanting to do. The prefered way to install 32-bit programs that are accessible by all users is to install into the 32-bit Program Files folder. The guidance is that any app data should be written to the CommonAppDataFolder folder.

Your requirements are contradictory to the official guidance and you should reconsider your requirements. Here is the official guidance from Microsoft:

share|improve this answer

It is better in such cases to stay out of C:\Program Files, or C:\Program Files (x86) for 32-bit programs, because of the special permissions in force on these folders.

It is much simpler to copy the application to some other folder and give the Users group all the necessary permissions on that folder.

It is easy enough to create a shortcut to the exe, that you could either :

  • leave in the directory
  • copy to the user's desktop
  • drop onto the user's Start menu
  • copy to the all-users Start menu that is normally found in
    C:\ProgramData\Microsoft\Windows\Start Menu.

The last option might be the simplest to put in place.

share|improve this answer

You could leave it in C:\Program Files, just change permissions on the program's folder to give the other users the appropriate access rights in the ACL. You'll want to turn off inheritance from the parent folder and manually add the user "Everyone" with the permissions you want everyone to have.

share|improve this answer
    
turn off inheritance from the parent folder and manually add the user "Everyone" <-- wich parent folder do you mean? –  bitbonk Feb 21 '10 at 20:08
    
When editing the permissions for your program's folder under Program Files, there is a checkbox to turn off inheritance for that folder as shown here: symantec.com/connect/sites/default/files/images/reg.GIF –  John T Feb 21 '10 at 20:12
    
One big problem with putting programs in c:\Program Files\ is that the program itself does not have the right to write to its own folder. It will use the roaming folder wich leads to application data spread across the harddrive. –  bitbonk Jul 25 '10 at 20:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.