473,388 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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

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
1 3120
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Paul | last post by:
Hello, I've been reading up on security in Java Applets and whilst I understand the concept, I can't successfully get my applet to read a file on my local machine. I discovered from...
2
by: MENTAT | last post by:
Hi, I am trying to create an installer for my web application. So I added a web setup project to my solution (I am using VS.NET 2003). Been playing around with it since then and it basically...
9
by: Lyle Fairfield | last post by:
This is test, composed on my laptop while trying to repair my desktop? 1. Which is worse? Choose all that apply. a. Norton Anti-Virus b. A Virus c. Norton Anti-Spam d. Spam e. Norton...
10
by: Don Wash | last post by:
Hi! I'm pretty frustrated learning ASP.NET. I'm learning ASP.NET by downloading samples from various ASP.NET websites and none of the samples worked so far. The SAME error was shown whenever I...
23
by: **Developer** | last post by:
Is there an easy way to copies all files in a directory into another directory? What about coping subdirectories too? Thanks in advance for any info
3
by: Koliber (js) | last post by:
sorry for my bad english when I fire up (from my c# code) a standard "file - save as " dialog, and when chosen location is a shered local network directory, where I do have rights to create...
3
by: =?Utf-8?B?WmlhbmdpIEpvbmVz?= | last post by:
Hi, I m using VS .NET 2003 to create a website. Using the setup package I create a setup as well. But this setup has files with actual code in it & not pre-compiled DLLs. Please let me know...
6
by: Aussie Rules | last post by:
Hi, In my application I need to write an XML file to disk, but am concerned that permission might be a problem. The file only needs to be written out and used for another reason and can then...
6
by: falconsx23 | last post by:
I am trying to write a code for a Phone Directory program. This program is suppose to allow the user to enter a name or directory and then program can either add, save or even delete an entry. Also...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.