Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# deployment creating a porject folder

C# deployment creating a porject folder

Scheduled Pinned Locked Moved C#
csharpsysadmintutorialquestionworkspace
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    classy_dog
    wrote on last edited by
    #1

    For the installation of a C# desktop 2010 application, I am using the traditional setup and deployment template. As part of this template, I want to make certain that a folder is created in a directory path that looks like C:\log_files. Thus can you tell me how to have the setup and deployment project create the directory path for me, if the directory path does not exist?

    N 1 Reply Last reply
    0
    • C classy_dog

      For the installation of a C# desktop 2010 application, I am using the traditional setup and deployment template. As part of this template, I want to make certain that a folder is created in a directory path that looks like C:\log_files. Thus can you tell me how to have the setup and deployment project create the directory path for me, if the directory path does not exist?

      N Offline
      N Offline
      NickPace
      wrote on last edited by
      #2

      I'm not sure about VS2010 as I am still using VS2008, however in the setup project, open the primary output file and click on the 'File System on Target Machine'. There you can add a 'Custom Folder' through the right-click menu. Name the new folder whatever you want, and then click on properties for the new folder and set the default location to the directory path you want to use. Having said that, if this is a folder that your application is going to use during runtime, I would highly recommend that your application check for the existence of the folder and create it if needed before writing the "log files" to it (see the System.IO.Directory class). For instance, will your application crash if after it is installed the user then deletes the "log files" folder? Also, keep in mind that not all users may have permissions to create folders on the C:\ drive. I've run into that issue with Windows7 several times and the permissions we use. You may need to come up with a work-around or use a user's folder instead.

      -NP Never underestimate the creativity of the end-user.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups