The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Installer Best Practices - Part II

So, I started up this discussion below:
http://discuss.joelonsoftware.com/default.asp?design.4.617619.14

I can't thank everyone enough for their help.
I am going to take the majorities sound advice, and stick to the standards.

Install the program in the "Program Files" area, and put all of the folder:
c:\Documents and Settings\All Users\Documents\"MY FOLDER NAME"

Now that I'm going this route, I'm just wondering what other issues I should be aware of (if there are any).

1. Does this "c:\Documents and Settings\All Users\Documents\" folder exist on all versions of Windows since Windows 98, or is this just an XP/Vista thing?

2. Is this folders default to read/write, or am I going to face security issues in here?

3. Anything else I may want to know?


Thanks a bunch!
Randy Send private email
Sunday, April 27, 2008
 
 
It's not clear from your post, but I assume that you're talking about where to place changeable information that is not user-specific. If my assumption isn't true, then what follows may not make much sense.

>> 1. Does this "c:\Documents and Settings\All Users\Documents\" folder exist on all versions of Windows since Windows 98, or is this just an XP/Vista thing? <<

Never use a hard-coded folder like this. In Win2K and XP, use the constant "CSIDL_COMMON_APPDATA". In Vista, this is the KNOWNFOLDERID constant "FOLDERID_ProgramData".

>> 2. Is this folders default to read/write, or am I going to face security issues in here? <<

A typical path is C:\Documents and Settings\All Users\Application Data. This folder is normally read-only to non-admin non-power users. The recommended approach is to make a sub-folder under CSIDL_COMMON_APPDATA for your app at install-time, and then make that sub-folder explicitly read-write for public use.

>> 3. Anything else I may want to know? <<

Your installer will need admin privileges to run.
Mark Pearce Send private email
Sunday, April 27, 2008
 
 
"The recommended approach is to make a sub-folder under CSIDL_COMMON_APPDATA for your app at install-time, and then make that sub-folder explicitly read-write for public use."

Agreed. Keep in mind that there are two main aspects to Windows security: privilege and ownership. An admin can create folders in the shared folders area. But if the admin creates files then those files belong to the admin (the admin owns them). This was just fine back when everyone ran as admins because all admins were still able to change files that were owned by another person. But technically if an admin creates a file then a limited user can't modify it because it is owned by the admin. Likewise, any files created by a limited user cannot be modified by another limited user. So you will want to test these scenarios to make sure that you are covered.
dood mcdoogle
Sunday, April 27, 2008
 
 
Doesnt Win98 maintain a "Profiles" folder. or was that win95. dont remember exactly
Midhat Ali Send private email
Monday, April 28, 2008
 
 
What if I just have the installer create this folder though?

I guess my question is, where should this folder be...
Some people say the "Executables should be in "Program Files" and user data should be in their profile"...

My question is maybe an amatuer one, but:
Where is "their profile"?

Is it in the "c:\Documents and Settings\All Users\Documents\"...Or are people referring to the "c:\ProgramData" hidden folder?

Thanks
Randy Send private email
Monday, April 28, 2008
 
 
http://msdn2.microsoft.com/en-us/library/bb762584(VS.85).aspx

See the above topic for the location of the special folders. Below are the values of the associated environment variables on my Vista machine. The values will be different on XP.

ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\<User Name>\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
HOMEDRIVE=C:
HOMEPATH=\Users\<User Name>
LOCALAPPDATA=C:\Users\<User Name>\AppData\Local
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
PUBLIC=C:\Users\Public
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\User\AppData\Local\Temp
TMP=C:\Users\User\AppData\Local\Temp
USERPROFILE=C:\Users\<User Name>
windir=C:\Windows
uggh
Monday, April 28, 2008
 
 
>> The values will be different on XP. <<

They may also be different on different machines, regardless of OS.
Mark Pearce Send private email
Monday, April 28, 2008
 
 
"They may also be different on different machines, regardless of OS. "

And that's why you use the operating system calls described in the link posted instead of guessing.
dood mcdoogle
Monday, April 28, 2008
 
 
There are really application design considerations that manifest/impact Installer design.    Consider what your application does,  stage the files by hand if you have to, and test your application in a locked down / non-priv environment.  If all works well, go ahead and start working on your installation package.

If you are already comfortable with installs then do both in uninson, but don't let the learning curve of Setup keep you from first laying your application out correctly.  This is the easist fruit to grab first and will postively effect the outcome when it comes time to write the install.
Christopher Painter Send private email
Tuesday, April 29, 2008
 
 
Installer creation programs should provide you with a way to retrieve the appropriate directories for app data.

Inno Setup for example has placeholders that you can use in the installer script and will find the correct location on the machine where the software is installed at runtime.
Axel Send private email
Wednesday, April 30, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz