472,984 Members | 2,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,984 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 3095
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.