• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

Problem creating folders at install

I have a setup project for my vb.net application.
I added a few folders to the setup project that I need to put on the C:\ drive during install that are necessary for the program. ie.

Main
     My Photos
     My Music
     My Junk

I clicked on the 'Main' folder and set its 'DefaultLocaton' to 'C:\' and its 'Always Create' to 'True'

Problem is when I install it doesn't make the folder structure in the C drive, (or anywhere else.)

How would I make a file structure on the C: drive during install?
0
Matrix1000
Asked:
Matrix1000
  • 2
  • 2
2 Solutions
 
softplusCommented:
Which installer are you using?
Regardless of that, how about just creating the subdirectories when you first start the application(or if they're missing)? I do it this way, with the .net "xcopy-deployment" (he he) it'll save you some errors to troubleshoot...
0
 
Matrix1000Author Commented:
I'm just using the default Visual Studio installer...could you give me a code example? (I'm a noob:)

Thanks!
0
 
heintalusCommented:
I think softplus means something like this

If System.IO.Directory.Exists("C:\Main\My Photos") = False Then

System.IO.Directory.CreateDirectory("C:\Main\My Photos")

End If



HTH
Andy
0
 
heintalusCommented:
Ok, I've just run a quick test to find out how you can do what you want from a setup project.

1  Right click on 'File System on Target Machine' & select Add Special Folder Name it whatever you like but I suggest something like 'Root of C drive'
2  Set the DefaultLocation property to C:\
3  Right click on your newly created special folder & select 'Add Folder' & name it Main then right click Main & select 'Add Folder' for each of the subfolders you want within there.
4  You can now add files to these directories & when you run the install the directories will be created where you want them & the files copied to them.

One other thing I doid was set Always Create = True

HTH
Andy
0
 
Matrix1000Author Commented:
Works Great Thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now