By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

Highly frustrated. Which setup directory should I use that allows me to read/write/create/delete files?

P: n/a
Ive written a small string resource building utility that I send out to our
translators. I have a setup project for each language we support, which
picks
out a group of 12 english resx files plus their paired "foreign" resx for
that language only and installs those resource files in a subdirectory
somewhere.

I'm trying to create a setup project in visual studio 2008. Ive got my
Application Folder set up with my executable. Im now trying to find a place
where my resource subdirectory can be installed.
1) The resource files must be visible to all users so they all work on same
files, and can zip them up
to email them back to me if theyre unable to use my application emailer.
2) My application must have create/delete/write/read access to those
resource files.

In application properties, Icon and Manifest are selected are checked.
"Embed manifest with default settings"
In Security properties. ClickOnce security is enabled, and Full Trust is
selected.
I'm baffled with ClickOnce. I thought that if I created a manifest here with
full
trust then my app would have full control of my files. So what's the point
of it? "Run as administrator" is grayed out in the app shortcut properties
after installation too.
Ive tried to install my resources into subdirectory off the Application
Folder and Common Files Folder. In both cases I received security/rights
violations when my app tried to write the files. The other options offered
to me by vis studio's setup are no good (Fonts, Program Files, System,
System32, any of the users directories)
Environment.SpecialFolder.CommonApplicationData seemed the way to
go(untested), but the setup wizard doesnt offer that directory.

Am I doing something wrong with ClickOnce? Will I have to change the
behaviour of my application to copy the resources from embedded resources to
the common application data directory when its run? (that option seems messy
and likely to all go horribly wrong)? Can I force setup somehow to use
SpecialFolder.CommonApplicationData?

thanks

Jul 23 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Claire,

Well, putting files in the application directory, or the common
directory is a bad idea. Yes, those directories are all shared by the users
on the machine, but they are not really meant for write-access (which is why
typically only administrators have access to them).

If each user is working on their own set of files, then you should write
the files in the users profile directory somewhere. Basically, the
directory returned by a call to the static GetFolderPath method on the
Environment class, passing Environment.SpecialFolder.ApplicationData.

If you want each worker to work on a shared set of files, then you are
better off placing this on a network share which each user has rights to.
However, you are going to have to check to see if another user has a file in
use.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Claire" <ha*@notonyournelly.coomwrote in message
news:44**********************************@microsof t.com...
Ive written a small string resource building utility that I send out to
our
translators. I have a setup project for each language we support, which
picks
out a group of 12 english resx files plus their paired "foreign" resx for
that language only and installs those resource files in a subdirectory
somewhere.

I'm trying to create a setup project in visual studio 2008. Ive got my
Application Folder set up with my executable. Im now trying to find a
place
where my resource subdirectory can be installed.
1) The resource files must be visible to all users so they all work on
same files, and can zip them up
to email them back to me if theyre unable to use my application emailer.
2) My application must have create/delete/write/read access to those
resource files.

In application properties, Icon and Manifest are selected are checked.
"Embed manifest with default settings"
In Security properties. ClickOnce security is enabled, and Full Trust is
selected.
I'm baffled with ClickOnce. I thought that if I created a manifest here
with full
trust then my app would have full control of my files. So what's the point
of it? "Run as administrator" is grayed out in the app shortcut properties
after installation too.
Ive tried to install my resources into subdirectory off the Application
Folder and Common Files Folder. In both cases I received security/rights
violations when my app tried to write the files. The other options offered
to me by vis studio's setup are no good (Fonts, Program Files, System,
System32, any of the users directories)
Environment.SpecialFolder.CommonApplicationData seemed the way to
go(untested), but the setup wizard doesnt offer that directory.

Am I doing something wrong with ClickOnce? Will I have to change the
behaviour of my application to copy the resources from embedded resources
to the common application data directory when its run? (that option seems
messy and likely to all go horribly wrong)? Can I force setup somehow to
use SpecialFolder.CommonApplicationData?

thanks

Jul 23 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.