Solved

How to add a directory to a VS2010 setup project

Posted on 2013-11-11
22
460 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
  • 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
 
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now