What folder should a Single User app be installed in?

ralvy

New member
Local time
11:30 PM
Messages
5
I'm considering reconfiguring the installer for an application I develop. In the past, it allowed for All Users installs. If I want it to only be installed as a Single User, what user folder does best practices use as the install target? I can think of a few possibilities:

c:\Users\UserName\My Documents\
c:\Users\
c:\Users\Program Files\

Of course I'd have to have my installer created that last one on the above list.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 32-bit
While none of those really convinces me, I would think the best would be to use either %LOCALAPPDATA% or %APPDATA% environment variables as the base folder, which in particular in Windows 7 maps to c:\users\<username>\appdata\local and c:\users\<username>\appdata\roaming respectively. Creating a folder right there and dumping the program, and afterwards its data, there is not a bad option for a portable program. Alternatively, using %USERPROFILE% (c:\users\<username>) is possible.

Installing to documents folder is not a good choice because that's a frequent place for user data, and extraneous folders there may get in the way while using another programs. Some programs (including MS ones) fall into that bad practice. The other two options are simply unacceptable, because users don't normally have write permissions there, unless the installer tampers with them, which is not recommended at all for built-in system locations.

Any choice you made, just make sure to give the user a choice to change it to anything he wants, and remember to always use those environment variables, or even better API calls to retrieve those paths, don't hardcode them.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
What I ended up doing was using the following, at the suggestion made at the Inno Setup forum:

%LOCALAPPDATA%\Programs

So when the user runs the installer, they end up with

<system volume>\users\<username>\appdata\local\Programs\MyProg\

as the folder that houses the app. Inno Setup has a constant {userpf} that, when chosen as the default directory to install the app, places the app in

<sytem volume>\users\<username>\appdata\local\Programs\

In the case of this particular app, I do not want the user to change the install target, so I configured the install package to force the above on them.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 32-bit
If your install is just a simple application install involving no global system changes then in your .iss file you should set the following value:

PrivilegesRequired=lowest

This will have the effect of bypassing the UAC privilege escalation prompt (on protected systems) that accompanies almost every installation, even though half the time administrative access is not required.

You might also want to include on your download page, instructions on how to "Unblock" the install program after downloading it (another idiotic default).

It is not in anyone's interest to have users getting into the habit of granting special permission every time they install a program. It renders the security system ineffective when a real threat comes along.
 
Last edited:

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Acer
OS
Windows 7 Ultimate 32 bit
CPU
Pentium P6200 dual core@1GHz
Motherboard
Acer Aspire 5742Z
Memory
2 Gig
Graphics Card(s)
Intel
Hard Drives
1
Antivirus
MS Security Essentials
Browser
Chrome
Back
Top