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

How to add a directory to a VS2010 setup project

Hello,

I am attempting to create a setup program(msi) for a vb.net program in VS2010. I am able to create the basic install package but I need to include a directory tree in the installation and I have been unable to do so.

I have tried 2 methods:

1) Drag and drop the directory structure into the project explorer and set the directory to "Include in project"

2) In the project setup area I right click on "File system on Target Machine" and click on "Add special folder" and select custom folder. I then set the folders defaultlocation property to "C:\bac1". I then add the various files and sub directories  I also set the "Always Create" property to true.

In both cases it fails to create the directory C:\bac1 when the msi package is run.

Any suggestions?

Thanks,
Bartj
0
bartdsp
Asked:
bartdsp
  • 12
  • 10
1 Solution
 
Jesus RodriguezIT ManagerCommented:
The second one will be fine. Check if you can create this folder by windows explorer. Looks like is a permission issue at the time that have to write on the c drive
0
 
bartdspAuthor Commented:
Hi....am able to create the folder from windows explorer.

Comments?
Thanks,
bartj
0
 
Jesus RodriguezIT ManagerCommented:
Try to change the location creation to see if gets created??
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
Jesus RodriguezIT ManagerCommented:
Also when you create the folder the default location will be C:\ and the replace Custom Folder #1 with Bac1
0
 
bartdspAuthor Commented:
Yes, I have done that ... it does not exist.
0
 
Jesus RodriguezIT ManagerCommented:
Let's review this for a second

You want a folder created on C:\ or under c:\bac1

If you want on C:\ then try again, Add a Custom Folder to the Target Machine Directory, Rename the name to bac1 and add the Default Location to C:\. Compile the project and the from the debug/release folder get the installer and try to install to see what happened
0
 
bartdspAuthor Commented:
And yes, I changed the defaultlocation to C:\ and that did not work either.

Comments?
Thanks,
bartj
0
 
Jesus RodriguezIT ManagerCommented:
Change the location to the application folder to see if it works on the application folder and create the folder there ?
0
 
bartdspAuthor Commented:
Correct, I followed the steps you describe and no directory is created. Note I am running this on an XP machine.

Thanks,
Bart
0
 
Jesus RodriguezIT ManagerCommented:
I really do not understand why failed when all the steps are fallowed but anyway I can give you another solution for it. Created the folder under you application folder and add all the files and then in the custom actions add a batch for moving the files from your application folder to the C:\
0
 
Jesus RodriguezIT ManagerCommented:
This XP machine you have admin rights (running as administrator) the installation
0
 
bartdspAuthor Commented:
Hello,

The folder [app location]\bac is created if I set its location to the application folder. Any ideas on how to get it to C:\?

Thanks,
Bartj
0
 
Jesus RodriguezIT ManagerCommented:
0
 
Jesus RodriguezIT ManagerCommented:
If the folder is created on the application folder then is permission issues at the time that you try to install on the C:\. Go to the C:\ on the Windows Explorer and click on Properties\Security and check that the administrator or the user that is logged and you're using for install in has right to write on c:\
0
 
bartdspAuthor Commented:
I am the admin. I have not been setting anything explicit in terms of permissions. I have been launching the installer via ztree which does not allow the option to elevate permissions. I tried running from win explore and attempted to up the permissions as "admin" but it fails as I do not have an explicit password set up.

Sounds like this is the root of the problem.

Will investigate.

Thanks,
Bartj
0
 
Jesus RodriguezIT ManagerCommented:
Let me know the result
0
 
bartdspAuthor Commented:
Hi,

I added a password to my account and confirmed its an admin account. But still no luck getting the dir to show up.

Is this just a fundamental limitation of the windows setup program?

I have VS2008 also installed on this machine. I may give its installer a try tomorrow.

Comments?
Bartj
0
 
Jesus RodriguezIT ManagerCommented:
Did you have another computer where you can try this??
0
 
bartdspAuthor Commented:
I will have another computer with win 7 around later today or tomorrow. Also, I created a setup in VS2008 with the same results (no C:\bac).

I will post my results on this thread.

Thanks for your help.
bartj
0
 
bartdspAuthor Commented:
Hi,

Also no luck with win 7 running as admin creating a dir C:\bac from the setup program.

This must be a fundamental limitation of the setup/distribution program.

Comments?
Bartj
0
 
Jesus RodriguezIT ManagerCommented:
Try to Setup the Defaultlocation=[WindowsVolume] to see if can do it??

If windows is installed on C will be created on C:\ and  will display as C:\bac after installed
0
 
bartdspAuthor Commented:
Sorry to have taken so long to get back to you.  I have been shifted to another project. Thank you for all your efforts!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

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