Click here to Skip to main content
Click here to Skip to main content

Visual Studio Windows Application Setup Project

By , 29 Dec 2005
 

Introduction

I noticed that there are several articles on using Web Setup projects, but no articles could be found for Windows Setup projects. So I decided to share what I know about the VS Windows Setup Projects. I will be using the RunOnlyOnceCS.exe demo app I created for another CodeProject article, as the application we are creating the setup for.

Background

Sooner or later, you need to create a setup project for an application. Personally, I am not a big fan of this type of distribution for an application. Still it has its uses. Using a setup project can be a good solution for a Windows application that has many dependencies on other assemblies / DLLs. The setup will figure out what the dependencies are for the application and automatically include them.

Note: This does not include the .NET framework.

Creating a Setup Project

This article is going to rely on screen prints since there really isn’t any code for this. The output will be a *.msi file that will install the application file(s), and add a shortcut to the desktop and to the Programs menu.

Note: if the user does not have admin rights to their box, they will not be able to run the MSI script or install new applications on their box.

After you have created a new setup project, the first thing you will want to do is change the ProductName property on the setup project to match the application you are creating the setup for. I would also suggest changing the RemovePreviousVersion property to true. This is helpful when you want to release your next version of your app through this setup project.

Next, click on the "Application folder", then right click, and click on Add/File. At this point, you will be able to add the Exe you are trying to create the setup for.

Note: if you make changes to the Exe, you will need to re-compile the setup project as well. It might be a good choice to add a setup project to your Windows project solution. Then you can choose the project output option instead of the file.

Note: if you know what a merge module is and want to add one to the setup project, you need to right click on the setup project and click Add Merge Module.

Note: you must also add any config or icon files you may need for this solution, here:

Next, I always set the Always Create for the Program Directory to true. This is done by clicking on the "Application Folder" and then going to the properties.

Note: the DefaultLocation property will always be: [ProgramFilesFolder] [Manufacturer]\[ProductName]. If you want it to be something else, this is where to change it. Notice that the solution explorer has recognized the dependency or need for the .NET Framework for this app to run.

Note: this does not mean that the setup will install the .NET re-distributable framework. That is its own setup. The setup file is around 24 MB in size and can be downloaded from here.

Note: the setup can not install a .NET application without the .NET Framework already installed.

Next, we want to create a shortcut to our application on the desktop. First, click on the "User's desktop" folder. Then right click and click on "Create New Shortcut".

Next, you will see a dialog box to choose the application you want to create a shortcut to. Go to "Application folder" and add the exe you added in the previous step.

If you click on the "User's desktop" and go to the Properties window, you will see some options. Something I normally add to the shortcut is a check to see if it already exists. This is an example of what little coding you can do in a setup project. I have turned on AlwaysCreate on the shortcut property. In doing this, I need to have a condition or I will multiply my desktop shortcuts with every new release. So I set the Transitive property to True and I set the condition to FILEEXISTS1<>"Shortcut to RunOnceOnlyCS.exe", where what is in the "" needs to match the name of the shortcut.

Note: if you want your shortcut to have your application's icon, you need to add your icon file to the "Application folder". Next, click on the shortcut you just created in your "User's desktop". There is an icon property. Click the down arrow to get the dialog box. Navigate to the "Application folder" and select the icon file you just added.

Next, if you want to create a shortcut in the Start/All Programs menu, it is very similar to creating a shortcut on the "User's desktop". First, click on the "User's programs menu", then right click and add a folder. Name the folder the same as whatever your company or manufacturer name would be. Then, click on that newly created folder and add a shortcut just like we did in the step above.

Finally, when you need to create a new setup for the next release of your application, you need to go to the setup project properties and change the version before you re-compile the setup project.

Once you click off the version property, you will get a prompt to update the GUID for the ProductCode.

Note: if you do not click the Yes button in the dialog, you must manually get a new GUID for the ProductCode for the setup to properly remove the old program and install the new program.

Note Do Not: change the UpgradeCode GUID. If you do, the user will have to uninstall the old program manually before the new version can be installed.

One last note

One thing that is really nice about the Setup Project is that it automatically adds your Windows application you are trying to install to Add/Remove Programs. So once this has been installed, you can go to Add/Remove Programs and remove the app, and it will clean up all the files and folders that were created. I guess this is in part why you might be using a setup project in the first place.

Conclusion

I hope this article has given you a taste of how to use the VS Setup Project. It is not the perfect solution for distributing Windows applications, but it is useful in certain situations where this solution fits the need.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

kubben
Web Developer
United States United States
I started my programmer career over 16 years ago doing COBOL and SAS on a MVS mainframe. It didn't take long for me to move into windows programming. I started my windows programming in Delphi (Pascal) with a Microsoft SQL server back end. I started working with vb.net when the beta 2 came out in 2001. After spending most of my programming life as a windows programmer I started to check out asp.net in 2004. I achieved my MCSD.net in April 2005. I have done a lot of MS SQL database stuff. I have a lot of experience with Window Service and Web services as well. I spent three years as a consultant programing in C#. I really enjoyed it and found the switch between vb.net and C# to be mostly syntax. In my current position I am programming in both vb.net and C#. Lately I have been using VS2012 and writing a Windows 8 app. You can search for the app it is called ConvertIT.
 
On a personal note I am a born again Christian, if anyone has any questions about what it means to have a right relationship with God or if you have questions about who Jesus Christ is, send me an e-mail. ben.kubicek[at]netzero[dot]com You need to replace the [at] with @ and [dot] with . for the email to work. My relationship with God gives purpose and meaning to my life.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionHas this explanation and sample been upgraded for VS 2010memberkentuckyjoe13-May-12 14:31 
I have a project for which I would like to build a setup/deployment project. And I have VS 2010; using Visual Basic. The presentation is excellent but I'm having trouble following it and I believe it's because it was written for VS 2005. And guidance and help would be appreciated.
AnswerRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben14-May-12 1:37 
You know the windows setup project has not really changed for VS2010.   It is kind of complicated, but I think this article does a pretty good job of step by step directions.   How far do you get before you get lost?
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe14-May-12 2:05 
I think the article does an excellent job. I think maybe my concentration wasn't what it should have been and if it had been I may have been able to follow it thru. There is something specific I need to know and can't seem to find out. If I find out that the setup project does what I would like it to my concentration level will be as good as it can be (which is never very good).
 
My app needs Crystal Reports. And it needs some specific thing that I cannot find and thus cannot install. The client machine has the Crystal Reports runtime for .net framework 4 so you would think it would work; but it doesn't. My question is this. Does the VS 2010 setup installer somehow sense what the project requires and automatically include it? even things it may have to go elsewhere to get?
 
I manually cannot include it because I can't even find it. But maybe the setup project can find what the app requires. Can you give me any guidance on this. Thank you so much. And thank you for such an excellent piece. The number of responses to the thread is a great indicator of how much a presentation like this is needed.
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben14-May-12 2:42 
If your windows app references Crystal reports, then those dlls should show up in the detected dependencies.   When you setup your windows setup project you should add the setup project to your current solution that your windows app is in.   This way when you point to what you are creating your setup for you can point to primary output from your windows project.
 
It has been a while since I have worked with Crystal reports, but I believe you can in fact just include the dlls needed and install them along with your windows app.   It may take a little googling to figure out which Crystal dlls you need, but once you figure that out you can just include them by copying them into your bin directory of your windows app and then point the reference to the dlls in the bin directory.
 
Hope that helps.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe14-May-12 3:30 
Ben, thank you. It helps a lot. I'm understanding better and better. I am going to do just as you suggest.
 
I can see that my Crystal Reports problem will not be solved though. I have googled and searched and even though I see others have had the same problem it is almost impossible for me to resolve. I need to find the Crystal .dll that is needed and for some reason, for me, that is proving to be extremely difficult. But, I now know, that the setup project will not find it on it's own. When I do find it I will follow the suggestions you've made here. Thanks for your help Ben.
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben14-May-12 4:11 
Glad to be of help.   You know some of the Crystal dlls might be in the GAC (Global Assembly Cache).   That folder is c:\windows\assembly\
 
So it is very possible you will find the dlls there.   Other wise they would be under c:\program files\
 
Good luck.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe14-May-12 5:14 
Ben, thanks so much for your help. Let me give you some more information and see if you have any ideas or suggestions. I publish my project to a CD and take the CD to a client computer and click setup. The install begins but quickly fails with the following error message.
Unable to install or run the application. The application requires that assembly CrystalDecisions.ReportAppServer.CommonObjectModel Version 13.0.2000.0 be installed in the Global Assembly Cache (GAC) first. Please contact your system administrator.
 
I looked where you pointed me to (C:\windows\assembly\) and see that the file the error message they say is missing is on both my development computer and on the target, client computer. In other words - on both computers, it's there. Why it says it isn't, and why it isn't letting the install proceed is a mystery. Is there anything you can think of?
 
Thanks for your interest in my problem as I'm sure you have many other things to be doing on this Monday. jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben14-May-12 5:21 
I would be very suprised if that crystal dll actually has to be installed in the GAC.   I would guess you are just missing it in your bin directory.   With the .net model it will always check the folder the exe is in first, then it check the GAC later.   So the biggest question is where can you find that dll.   Have you tried using windows search to find it?   I would guess it is on your computer, the question is just where.   Once you find it you will want to copy it to your bin directory for your windows app and point the reference to it in the bin directory.   Once it is included in your windows application it will automatically come into your setup project since it will be part of the primary output of your windows app.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe14-May-12 5:27 
Thank you Ben. I'm going looking for that little bugger right now. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe14-May-12 6:28 
Ben, the only place I could find this file, on both computers, is in the Windows Assembly folder.
 
Right now I have to be very cautious because I'm such a rookie I don't know what I'm doing. The app will install fine on the three or our other computers that I need to install it on and I'm afraid that if I start copying things to other places and trying to point references in different places I'll screw the thing up so bad it won't even install on the computers that it's currently having success on.
 
The computer I am trying to get it to work on is a brand new HP, Windows 7, 64 bit computer. This is the first time trying to put the app on such a computer. I haven't tried a Windows 7, 64 bit computer so maybe there is some incompatibility there.
 
I can code in VB okay but I'm a total dunce when it comes to setup projects, references, .dlls, dependencies, etc. I really want to learn how things work and how they're put together but I've got so far to go.
 
Thanks for your help and guidance and I'll keep studying and maybe I'll get to a point where I can, with confidence, do your suggestions and fix this thing and make it work on this new HP.
 
Thanks Ben. jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben14-May-12 6:43 
Jack,
 
You know it could be as simple as you need to run a Crystal redistrubutable that is for 64bit.
 
You can copy dlls out of the GAC, but you can't use windows explorer.   You can use a dos command.   I don't know how familiar you are with dos commands, but if you go to start\ run then type in cmd.   A command window will pop up.   Type in:
cd\
cd windows
cd assembly
cd gac_msil
 
At this point you will need to find the directory that the crystal reports dlls are in.   I would guess they will be called something with crystal.   You can do
dir
 
for a list of directories.   Once you get into the correct directory you can do the copy
something like:
copy yourcrystaldllnamehere.dll c:\temp
 
Once you have the dll out of the GAC you can install it on the other computer manually.
Putting things into the GAC is a lot simpler.
 
You can just open windows explorer to the windows assembly and then drag the dll into it.
 
Hope that helps.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe14-May-12 7:33 
Ben, I'm pretty good with the dos commands but I'm very confused about what I see. If I use Windows and open C:\Windows\Assembly I see lots of files listed that I assume are .dll files. But, when I use dos commands and go to C:Windows\Assembly I see only directories and not files. Using Windows I see only files but no directories, using DOS I see directories but no files. That's wacky. The directories I see using the dos prompt include GAC, GAC_32, and GAC_MSIL. However, in none of them do I see the files that showed up using Windows and those files included all of the Crystal Reports .dlls. That's wacky too.
 
I'm going to give you a break and take the dog to the vet. My brain needs a little airing out as well.
 
I do think this problem has to do with the 32 bit vs 64 bit. Since things work okay on the 32 bit computers it makes me believe this has something to do with it.
 
Let me ask one last question. Which computer should I be looking at; my development computer or the target installation computer. Thanks so much Ben. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben14-May-12 7:36 
Jack,
 
You will want to be looking at your computer where you know the crystal dll has been install in the GAC.   The folder structure is quite a mess, but I am sure the dll is there.   I am pretty sure it is under gac_msil.   I think you should find a crystal folder in the gac_msil folder, but I am not sure.   Like I said before it has been a while since I have worked with crystal reports.   Now I do all my reports with reporting services.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe14-May-12 10:39 
Ben, later I will go on a search and destroy mission for that file. Right now I only see it in C:\windows\assembly\. But what I really need to do is move the two reports I have to reporting services just like you did. I've been working on this project for five years or so and it seems like every problem I've had has been related to Crystal Reports. I would love to consign Crystal Reports to the ash heap of history.
 
And soon I'll return to the main subject of this thread and I apologise for getting you so far afield. I thank you so much for your help and guidance and you'll probably see me back again. Quite possibly in the setup thread. Thanks Ben. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben14-May-12 10:46 
Jack,
 
I hope you are able to get everything sorted and working.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe14-May-12 15:57 
Thank you Ben. I greatly appreciate the help you gave me today and I want to give you the highest ratings that I can. I'm not very familiar with the Code Project and how it works. If you can tell me how to do this I will appreciate it. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben15-May-12 1:37 
You are welcome Jack.   At the bottom of the article there is a place to vote for the article.   The highest you can give it is a 5 or excellent.   I hope you have a great day.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe15-May-12 2:03 
Ben, I hope I did it right. Thanks for all of your help. I've decided that my future health and happiness depends in large degree to getting Crystal Reports as far from my application, and me, as is humanly possible. My plan to try next is to write a text file and then use Microsoft Word to manipulate it to produce a report. My two reports are very simple and this may be a good solution. I've got 'some learning' to do but in the end whatever I end up with will be preferable to Crystal Reports. Thanks much Ben. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben15-May-12 2:37 
Jack,
 
I found the same.   Crystal is a real pain.   It is even worse if you are using it on a web site because you have to buy a license for each web site.   I hope your plan for removing them works out.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe16-May-12 15:11 
Thanks Ben.
 
I'm going to put up a post in the next day or two asking for input about the best way to proceed to get rid of CR; reporting services, automating Word, or maybe something else. If you see it please weigh in; I greatly respect your opinion. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben17-May-12 1:09 
Hi Jack,
 
I have an article on Word automation, but it has been a while since I have used word automation.   Unfortunatly, I only monitor the forums on my articles.   So if you have specific question you can post it here and I will respond.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe17-May-12 1:14 
Ben, I know very little about Word automation, just that it exists. It seems to me that this would be a viable option. Do you think that it is an idea worth exploring? Thx. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben17-May-12 1:28 
My suggection if you want to use word automation and do printing you will probably need to export what you are trying to print to a PDF format.   This is the most consistant format to print.   It should print the same on pretty much any printer.   Of course, tying printing the word automation makes it a requirement that your users have word (office) installed.   When I was doing word automation you had to install the .net hooks from office to get it to work in visual studio.   These are not ususally installed with a default install of office.   Of course, things may have changed since it has been 6 or 7 years since I have done word automation.
 
Currently I do all my reports in reporting services.   I mainly do web programming now with only a few windows apps here and there.   Anyway, there is a way to do a local reporting services report so you don't need a report server.   In this way you manually connect a dataset to a local reporting services report you can then export the report to pdf.   So a pdf would pop up for your user.   They just have to click the print button.   Anyway, I do this on web sites all the time.   I am pretty sure you can do it with windows apps, but I haven't tried it.   Normally, you just need to use the reporting services viewer control and create a reporting services rdl or rdlc report file.
 
Hope that helps.
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe17-May-12 2:10 
Ben, I have to go out and will be gone most of the day. You have given me a lot of good information here and a lot to think about. Which is exactly what I'll be doing when I return. I'll reread and digest and I may have another question or two. The .pdf popup and print button sound perfect. Thanks for this guidance. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben17-May-12 2:43 
Sounds good.   Let me know if you have more questions.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe17-May-12 15:16 
Hi Ben,
I think I'm going to give the reporting services a try. I've got some 'book learning' to do but I like doing that. Another person advised me that that would be the best way to go.
 
My users do have Word as the database the app uses is Access and some of it's functions involve Excel so they have MS Office Pro. That wouldn't be a problem. But, it involves another product (Word) and that alone means more complexity. So, I think I'll try reporting services and I think it works just as you described. A viewer control and then the report itself.
 
Ben, one more question. One of my reports that I currently have in Crystal Reports is comprised of about 4 subreports. I assume I can put subreports into the reporting services methodology. Is this correct?
 
Thanks Ben. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben17-May-12 16:03 
Hi Jack,
 
To answer you question, if you mean sub reports in that you can have a plus and minus sign that allows the report to "drill down" into more detailed data, then yes you can do this in reporting services.   Sadly, reporting services doesn't do it as well as crystal.   I am not sure if that drill down works with a local report, at least I have not done it.   I have done some complicated reporting services reports and often the data behind the scenes is not very pretty.   That is one thing I wish reporting services did better.
 
If you have a more simple (no subreport) report I would do that one first.   It will give you a feel for how reporting services works.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe18-May-12 5:31 
Thanks Ben,
 
I don't have any drill downs so that will simplify things. I have one report that has 4 other separate reports (that I'm calling subreports) embedded in it but none of them are drill down. The report is on the health of animals in an animal shelter. There is one report for procedures (like spaying/neutering, ear cleaning, etc), one report for vaccinations, one for reminders; that sort of thing. I put these reports into a 'parent' report called 'Animal Health'. It's kind of hard to explain but I'm almost positive reporting services will accomodate it. And, the only other report is much, much simpler; there is nothing fancy about it. It just gives stuff like the name, breed, age, how acquired, etc. of the animal. Just individual data elements out of one Access table. I'll do that one first and learn a lot about reporting services in the process.
 
Thanks much for your advice and help Ben. I'll let you know how it goes. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe24-May-12 14:15 
Ben, let me ask you a question. When you do a report do you use either the reportViewer control or the printDocument control? I'm still struggling on printing and I was wondering if you use either or both of those controls to produce your reports. Thanks Ben. jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben24-May-12 14:59 
Jack,
 
I use the report viewer control.   I just use it so I can export the report to PDF.   Once the PDF comes up the user still has to click the print button on the PDF.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe24-May-12 15:25 
Beautiful, got it. It's been like pulling teeth for me but I'm finally starting to make some progress. I can see a way out of the darkness. I think this printing is going to be a lot of fun. Once I get the reports done I'll do away with Crystal Reports and then use your deployment package instructional to put together the methodology for deploying the app and I'll be in business. Thanks so much Ben. jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben24-May-12 15:31 
I hope it works out well.   Let me know if you run into problems.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe24-May-12 15:52 
Thank you Ben. Will do. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe30-May-12 3:19 
Ben, I've got a problem that maybe you can help me with. But first let me tell you that I'm making progress on using MS Reporting Services. I'm glad you told me about this. It's tedious and detail oriented but I love that kind of work. And, I can at least understand what I'm doing; something I could never say about Crystal Reports. And I'm able to use VB constructs like 'if then else'. Have you ever seen Crystal Reports 'if then else'? Believe me; you don't even want to. So, I'm loving life right now with Reporting Services.
 
Well, almost. I can't deploy my revised software to a user computer. When I try to install I get an error message that says something like (I'm working from memory here) 'Microsoft ReportViewer 10.0.0.0 must first be installed in the GAC (Global Assembly Cache).
 
I thought that maybe I needed to add a reference and I found this in the reference list and added it to the project. It still would not install. Maybe I need to install something more than just my project on the client computer. I just don't know what it is that I need to do and I'm hoping maybe you can give me some guidance.
 
Thanks for your consideration Ben and happy Wed. to you. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben30-May-12 4:29 
Hi Jack,
 
I am glad Microsoft reporting is working out for you.   Like I said before I did do crystal reports a number of years ago and it was a mess.
 
Anyway, you will need to include up to 4 dlls.   One is Microsoft.ReportViewer.WinForms, another is Microsoft.ReportViewer.Common.   Those two you should be able to find.   Now when I do Microsoft reporting from the a website I need two other dlls.   Microsoft.ReportViewer.ProcessingObjectModel and Microsoft.ReportViewer.DataVisualization.   These two are only found in the GAC.   So you will have to follow the previous instructions to copy them from there.   Once you have the 4 dlls you need to add them to your install, then it should work fine.
 
Hope that helps.
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe30-May-12 5:01 
Ben, I did find the first two references and I added then to the project. I tried to do an install and if failed so I now want to find and add the ProcessingObjectModel and DataVisualization. I'm very new to this but I intend to just copy them from C:\Windows\assembly on my development computer and copy them to the same location on the target install computer. Is that the correct way to get them there? Thanks so much Ben. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben30-May-12 5:06 
Jack,
 
You will need to use a command prompt to navigate the GAC.   Once you find the correct dll, you will need to copy it someplace like c:\temp
Once you have done that you can copy the two dlls from c:\temp to your projects bin directory.   Then reference the two dlls.   Once you do that the setup project should see them and bring them over like the other two references dlls.
 
If you are having trouble.   I do have those two dlls and could email them to you, just let me know what your email address is.   You will probably want to post it something like:
jackATcompanyDOTcom
Then I will replace the AT with @ and the DOT with .
Other wise your email will get grabbed by spammers.
 

Hope that helps.
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe30-May-12 5:34 
Ben, thanks a lot for these excellent instructions. I'm going to give them a try right now. Back to you in a bit. jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe30-May-12 5:46 
Ben, I have to go home from the user site where I currently am so it will be a while before I let you know if things worked. Thanks Ben. jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe30-May-12 7:28 
Ben, I found the files just where you said they would be (c:\windows\assembly\gac_msil) and I'm in that directory. I can see them. But, when I try
 
copy Microsoft.ReportViewer.ProcessingObjectModel.dll c:\temp
 
I get a 'file not found' message.
 
Do you see anything wrong with that copy command?
 
My command prompt window is not very wide and for some reason I cannot drag the right edge to make it bigger. Thus I'm not able to see the complete file name. I tried without the .dll and with it. Could the extension be something different?
 
Sorry to keep bugging you but you've got me so close to getting this working. Thanks Ben. jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben30-May-12 8:08 
Jack,
 
You need to go a few directories further in.
cd C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel\10.0.0.0__b03f5f7f11d50a3a
 
Then you will find one of the dlls.
 
cd
C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.DataVisualization\10.0.0.0__b03f5f7f11d50a3a
 
For the other dll.
 
The reason you couldn't copy them is because they are directories.
 
Hope that helps.
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe30-May-12 8:49 
you da man Ben!!
 
Ben, I now have them copied to my project bin folder and compiled into my project. I'm headed over to my user site to see if I can now deploy this bugger.
 
I think I could have figured out all of this on my own. Sometime by the year 2050. But even that is in serious doubt. It's a lot more likely that I could have never figured it out without you.
 
Thanks Ben and I'll let you know if this thing loads up. jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben30-May-12 8:51 
Jack,
 
Glad you got it figured out.   I hope it works out well.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe30-May-12 10:49 
Ben, sad to report the install was a failure. It told me I needed Microsoft.ReportViewer.Common. That was the same thing I got, and added, earlier. I tried adding it again and it told me it was already added. Very strange. And here is something just as strange, if not more so. I went to references in project properties and asked to see unused references and it found everyone of these that I've added. Is there any reason you can think of that I would be told I needed to add a reference(s) and then, after I add them, it tells me they are unused? This thing is a mystery. Thx Ben. jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben30-May-12 11:58 
Jack,
 
Where did you add the reference?   In your windows project?   You need to make sure it is included.   You might need to be careful where you put the dlls.   Some directories get deleted when you do a build.
 
The Installer needs to put those four dlls right next to the exe of your windows app.   So it should be easy enough to test that.   Another thing you need to be careful of is making sure you have the correct version.   That would be my guess with the common dll.   You probably have one, but it isn't the version 10.0 or whatever version you are referencing in your windows app.
 
You should be able to test your installer on your PC first before you go to the client.
 
Hope that helps.
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe30-May-12 13:22 
Thanks for fighting thru this thing with me Ben and not giving up.
 
I did add the reference in the windows project. But I'm not sure what you mean when you say to make sure it is included. Should I see those files somewhere on the CD-ROM that I use to deploy the app. Maybe I've put the dlls in the wrong place. I put them in a folder called dllFiles in the bin folder of my project.
 
I think a big part of the problem is that I don't fully understand the build and deploy process. The way I've always done it is called the one click method (I think). I just click Build/Publish from inside the project and that's what it does; builds and publishes. It puts three things (a folder of Application Files, a manifest, and a Setup thingy) on a CD-ROM. I think this setup thingy on the CD-ROM is called the installer.
 
I then take the CD-ROM to the client computer, insert it, and then click Setup. It's at this point that the install begins and where it either succeeds or fails. Recently I've gotten nothing but fails.
 
The way I add these files to the project is to click Project/Add Reference. I was able to find two of them in the list under .NET (I think) and the others I used Browse to navigate to my project bin folder and the to a folder I put in there called dllFiles. It is in this folder where I put the ones I copied out of the c:\windows\assembly\gac_msil... folder.
 
I'm not sure what you mean when you say 'The Installer needs to put those four dlls right next to the exe of your windows app.' Maybe I've put them in the wrong place. I don't even know where the .exe of the app is located. I notice on the CD-ROM, in the Application Files folder I have something called the exe.manifest. Maybe that's it. But I don't see how to put anything next to it.
 
Maybe I need to do more than just add a reference. Maybe I need to make sure those same files are on the target computer.
 
Ben, if you would give me an email address for yourself I would like to send you a few bucks for helping me. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben30-May-12 16:38 
Jack,
 
It sounds like you added the dlls ok to the windows app.   Did you make sure they are the correct version?   The common dll could have multiple versions.
 
The exe.manifest is something that describes the exe.   The exe should exist somewhere in the application folder.   If you have a shortcut to your exe you can right click on it and go to properties and it will tell you where the exe is located.
 
From what you are describing I am guessing that the four dlls are ending up in a folder next to the bin directory.   The issus is that if the exe and the dlls aren't next to each other, it won't know where to find them.
 
So in the setup project you can maually add the four dlls to the application files folder and they should get copied there.
 
I would test run the setup on a computer and verify the dlls are there.
 
You don't need to worry about paying for anything.   I choose to help people because I enjoy helping and being helpful.
 
Ben
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe30-May-12 17:03 
Ben, it may be a version problem. I took time out to watch Hatfields and McCoys but am now am back on the job but probably not for long as I'm getting sleepy. I just noticed that it wants Microsoft.ReportViewer.Common Version 10.0.0.0 and I have referenced 10.0.30319.1. This could be the problem.
 
I did move the dlls from the subfolder dllFiles to the bin folder. That didn't help.
 
Tomorrow I'll locate that exe and see if those files are with it. That will be my next angle of attack; to make sure those dlls are where they should be.
 
Thanks for all your help today Ben. Even though I haven't gotten this problem resolved I feel like I've learned a lot today. Tomorrow may well be a good day and everything will work. We'll remain optimistic. Sleep well Ben. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkentuckyjoe31-May-12 5:21 
Ben, I'm back. I'll make you sorry you ever put up this post. I thought of this though; at least we're away from printing and back on a more closely related subect of the original thread - deployment.
 
I've been going over things since 7 AM. I think that maybe for success to occur I just need to gain a deeper understanding of how this deployment thing works. I've been going over all of your mails trying to make sure I understand and have followed your instructions. And guess what, I've got some questions. You may be busy and not able to respond and that will be okay; don't jeapordize your work.
 
I think I have the correct versions now. Here is my first question. Should I see those .dll files on the CD-ROM that I use for deployment? I don't see them anywhere. I made a list of the contents of the CD-ROM and I may copy it into the body of another message so that you can see exactly what is there But for now, those files don't appear anywhere. On my development computer I have them in the bin folder of my project. So, I'm guessing that they are compiled into the .exe. Which brings me to my next thing. I don't even see an .exe file on the CD-ROM. I do though see an .application file which is probably the .exe file by another name.
 
When you say the .exe and the .dll files have to be next to each other what does 'next to each other' mean? In the same folder?
 
Ben, maybe it is time for me to bite the bullet and fergettabout the click once deal and try to work thru your tutorial on how to make an install package. Right now I don't have an install package and maybe having one would help.
 
Ben, thanks for your help. If you get tired of me don't be afraid to say so; it would be perfectly understandable. Jack
GeneralRe: Has this explanation and sample been upgraded for VS 2010 Pinmemberkubben31-May-12 5:33 
Usually installers include the dlls in the install exe.   So you wouldn't see the dlls in the CD ROM.   You should see them after the install.   Dot net apps will always check the local directory that the exe is in for needed references.   So yes the four dlls need to be next two or in the same directory as the exe.
 
So when you run the install on your pc, you should be able to see if the dlls were installs properly or not.
 
Ben

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130619.1 | Last Updated 29 Dec 2005
Article Copyright 2005 by kubben
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid