Installer folders & best practices

E

eschneider

Hello,

I would like to see some guidance on the usage of common installer folders.
Example ( Common Files Folder, All Users Folder, Application Folder ).

For example where do you put files shared by multiple users? What if each
user (through the app) needs to modify a file inside the folder?

The MSDN info I have seen on these folders is very limited and causes
confusion.

Also what works vs. what should be done is nice to know also.

The version of windows and user rights seem to affect this logic also.

Thanks,
Schneider
 
H

Hongye Sun [MSFT]

Hi Schneider,

Thanks for your post.

I was unable to find such a guidance on usage of installer common folders.
The best one is what you have mentioned in MSDN library: Special Folders
and Custom Folders (http://msdn.microsoft.com/en-us/library/s2esdf4x.aspx).
It lists all the special folders and what they represent.

However, there are some guidances to specific deployment senario. For
example:
User Data and Settings Management in Windows Server 2003
(http://technet.microsoft.com/en-us/library/cc781516.aspx)
Persisting Application Settings in the .NET Framework
(http://msdn.microsoft.com/en-us/library/ms973902.aspx)

In order to better help you, can you tell us what your deployment senario
is in real?

I mentioned that your example questions are possibly what your confusion
is, so I answer it here:

#1: where do you put files shared by multiple users?
If the files are setting files, they are likely to be application settings.
They are recommended to be placed into Application Folder.

#2: What if each user (through the app) needs to modify a file inside the
folder?
That depends on what the usage of the file is. If the file is specific to
each user and is setting file, it is recommended to place to User's
Application Data Folder. If it is shared by multiple user, as described
before, it is recommended to be in Application Folder.

#3: The version of windows and user rights seem to affect this logic also.
The answer is yes. You must make sure that user has rights to write to the
common folder.
Deployment In Windws Vista is a little different: Windows Installer
Deployment on Windows Vista
(http://msdn.microsoft.com/en-us/library/bb384154.aspx)
Vista also supports roaming user data. Here is the guide: Managing Roaming
User Data Deployment Guide
(http://technet.microsoft.com/en-us/library/cc766489.aspx)

Hope it helps.

Please let us know if there is anything unclear.

Regards,
Hongye Sun ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
 
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

eschneider

Hello,

I think then information needs more detail, there has been many cases in the
past where it's difficult to determine what to do. But here is my current
case:

I have a list of developer assemblies which use a plugin design. There are
default plugins which all end-users use by default, and each end-user could
override the default plugins to use a custom set. These plugin settings are
considered system-wide for each end-user. All end-user applications that use
these assemblies will need to discover the settings and use the correct
plugin set.

To complicate things more, the specific users plugin settings needs to be
discoverable with-in a VS environment and also runtime.

Also seems I need my own "Control Panel" application where the user could
modify settings assuming they are an admin. Can I create a "Control Panel"
application?

Any thoughts?

Thanks,
Schneider


"Hongye Sun [MSFT]" said:
Hi Schneider,

Thanks for your post.

I was unable to find such a guidance on usage of installer common folders.
The best one is what you have mentioned in MSDN library: Special Folders
and Custom Folders
(http://msdn.microsoft.com/en-us/library/s2esdf4x.aspx).
It lists all the special folders and what they represent.

However, there are some guidances to specific deployment senario. For
example:
User Data and Settings Management in Windows Server 2003
(http://technet.microsoft.com/en-us/library/cc781516.aspx)
Persisting Application Settings in the .NET Framework
(http://msdn.microsoft.com/en-us/library/ms973902.aspx)

In order to better help you, can you tell us what your deployment senario
is in real?

I mentioned that your example questions are possibly what your confusion
is, so I answer it here:

#1: where do you put files shared by multiple users?
If the files are setting files, they are likely to be application
settings.
They are recommended to be placed into Application Folder.

#2: What if each user (through the app) needs to modify a file inside the
folder?
That depends on what the usage of the file is. If the file is specific to
each user and is setting file, it is recommended to place to User's
Application Data Folder. If it is shared by multiple user, as described
before, it is recommended to be in Application Folder.

#3: The version of windows and user rights seem to affect this logic also.
The answer is yes. You must make sure that user has rights to write to the
common folder.
Deployment In Windws Vista is a little different: Windows Installer
Deployment on Windows Vista
(http://msdn.microsoft.com/en-us/library/bb384154.aspx)
Vista also supports roaming user data. Here is the guide: Managing Roaming
User Data Deployment Guide
(http://technet.microsoft.com/en-us/library/cc766489.aspx)

Hope it helps.

Please let us know if there is anything unclear.

Regards,
Hongye Sun ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support
Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
 
H

Hongye Sun [MSFT]

Hi Schneider,

Thanks for your reply.

Do you mean that each end-user can customize his plugin set and the
customizing information is persisted in setting files? Different users may
have different settings. When the application starts, it will first
discover the setting file for current user and use the setting information
to load corresponding plugin assemblies. The setting file can be used both
in design time in VS or running time. Please correct me if I missed
something here.

Based on above, User-scoped settings is a good option. From a deployment
view, the user settings' default value are persisted in the application
folder, so when each end-user runs the application for the first time the,
default setting will be the same. Whenever a user changed its plugin
settings in runtime, the changed settings will be persisted in the user
application data folder. The folder path will be automatically generated to
"%AppData%\CompanyName\ApplicationName_<EvidenceType>_<HashCode>".

.NET Framework has wrapped user-scoped settings' API and you do not need to
worry about it in the deployment project. The user setting files will be
generated by .NET Framework in runtime. At design time, you can change its
default settings.

Here are the reference:

Using Application Settings and User Settings
http://msdn.microsoft.com/en-us/library/bb397750.aspx

How To: Read Settings at Run Time With C#
http://msdn.microsoft.com/en-us/library/bb397759.aspx

How To: Write User Settings at Run Time with C#
http://msdn.microsoft.com/en-us/library/bb397755.aspx

For Control Panel application, this is replated to window shell
programming. I will provide you some useful references here.

Control Panel Items
http://msdn.microsoft.com/en-us/library/cc144185(VS.85).aspx

Registering Control Panel Items
http://msdn.microsoft.com/en-us/library/bb776843(VS.85).aspx

Creating Control Panel items using the .NET Framework
http://www.codeproject.com/KB/system/cplnet.aspx?fid=437762&df=90&mpp=25&noi
se=3&sort=Position&view=Quick&select=2382639

Please do not hesitate to contact me if anything unclear. It is my pleasure
to work with you. Have a nice day.

Regards,
Hongye Sun ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

eschneider

Sounds like you understand what I want, I will need some time to review all
the info you sent.

Thanks,
Schneider


"Hongye Sun [MSFT]" said:
Hi Schneider,

Thanks for your reply.

Do you mean that each end-user can customize his plugin set and the
customizing information is persisted in setting files? Different users may
have different settings. When the application starts, it will first
discover the setting file for current user and use the setting information
to load corresponding plugin assemblies. The setting file can be used both
in design time in VS or running time. Please correct me if I missed
something here.

Based on above, User-scoped settings is a good option. From a deployment
view, the user settings' default value are persisted in the application
folder, so when each end-user runs the application for the first time the,
default setting will be the same. Whenever a user changed its plugin
settings in runtime, the changed settings will be persisted in the user
application data folder. The folder path will be automatically generated
to
"%AppData%\CompanyName\ApplicationName_<EvidenceType>_<HashCode>".

NET Framework has wrapped user-scoped settings' API and you do not need to
worry about it in the deployment project. The user setting files will be
generated by .NET Framework in runtime. At design time, you can change its
default settings.

Here are the reference:

Using Application Settings and User Settings
http://msdn.microsoft.com/en-us/library/bb397750.aspx

How To: Read Settings at Run Time With C#
http://msdn.microsoft.com/en-us/library/bb397759.aspx

How To: Write User Settings at Run Time with C#
http://msdn.microsoft.com/en-us/library/bb397755.aspx

For Control Panel application, this is replated to window shell
programming. I will provide you some useful references here.

Control Panel Items
http://msdn.microsoft.com/en-us/library/cc144185(VS.85).aspx

Registering Control Panel Items
http://msdn.microsoft.com/en-us/library/bb776843(VS.85).aspx

Creating Control Panel items using the .NET Framework
http://www.codeproject.com/KB/system/cplnet.aspx?fid=437762&df=90&mpp=25&noi
se=3&sort=Position&view=Quick&select=2382639

Please do not hesitate to contact me if anything unclear. It is my
pleasure
to work with you. Have a nice day.

Regards,
Hongye Sun ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no
rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top