Solved

How to add a directory to a VS2010 setup project

Posted on 2013-11-11
22
480 Views
Last Modified: 2014-03-07
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
Comment
Question by:bartdsp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 10
22 Comments
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39639678
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
 

Author Comment

by:bartdsp
ID: 39639730
Hi....am able to create the folder from windows explorer.

Comments?
Thanks,
bartj
0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39639769
Try to change the location creation to see if gets created??
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39639784
Also when you create the folder the default location will be C:\ and the replace Custom Folder #1 with Bac1
0
 

Author Comment

by:bartdsp
ID: 39639785
Yes, I have done that ... it does not exist.
0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39639797
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
 

Author Comment

by:bartdsp
ID: 39639803
And yes, I changed the defaultlocation to C:\ and that did not work either.

Comments?
Thanks,
bartj
0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39639810
Change the location to the application folder to see if it works on the application folder and create the folder there ?
0
 

Author Comment

by:bartdsp
ID: 39639818
Correct, I followed the steps you describe and no directory is created. Note I am running this on an XP machine.

Thanks,
Bart
0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39639834
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
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39639837
This XP machine you have admin rights (running as administrator) the installation
0
 

Author Comment

by:bartdsp
ID: 39639844
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
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39639847
0
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39639857
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
 

Author Comment

by:bartdsp
ID: 39639901
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
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39639904
Let me know the result
0
 

Author Comment

by:bartdsp
ID: 39640327
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
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39641866
Did you have another computer where you can try this??
0
 

Author Comment

by:bartdsp
ID: 39641907
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
 

Author Comment

by:bartdsp
ID: 39645813
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
 
LVL 13

Accepted Solution

by:
Jesus Rodriguez earned 500 total points
ID: 39646533
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
 

Author Closing Comment

by:bartdsp
ID: 39913265
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

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question