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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Claire

    #1

    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.Spe cialFolder.Comm onApplicationDa ta 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.C ommonApplicatio nData?

    thanks



  • Nicholas Paldino [.NET/C# MVP]

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

    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.Spe cialFolder.Appl icationData.

    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]
    - mvp@spam.guard. caspershouse.co m

    "Claire" <hah@notonyourn elly.coomwrote in message
    news:44EC68EF-A907-4F18-949B-3219AAFFE5A2@mi crosoft.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.Spe cialFolder.Comm onApplicationDa ta 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.C ommonApplicatio nData?
    >
    thanks
    >
    >
    >

    Comment

    Working...