deployment and setup project
Hi,
I am using visual studio.net 2005 to develop a project, now I want to make a deployment and setup package for my project. I have some problems on that. First of all, in my project properties, the section "publish" includes many options for publishing a project. Now in my project, I need to have some prerequisites, and some third party dll components. when I publish in my project, it works very well, however, when I bulid setup project to do that, I don't find any entry to insert these requirements; Secondly, when I build setup project, and add project into my setup project, I notice I can make shortcut in desktop and start menu, but I don't know how to make connection between the shortcut and application or helps file; thirdly, when I try to install setup package, it works, but after I remove this setup package through uninstallation function, it remove my some dll files and registry keys as well without any warn notice. Could anybody give me some helps? Thank you very much!
[1018 byte] By [
yhong] at [2007-12-22]
the only help I can give you is to wish you good luck, Every time I've tried to use Setup projects I've given up in sheer head-banging frustration a few hours later
Hi, Yhong,
You can specify the prerequisites in the setup project's properties. Right-click the setup project, choose "properties," and then click the Prerequisites button. That will take you to a dialog essentially the same as the one you're used to for publishing.
Regarding shortcuts: you can make a shortcut to just about anything that you include in the project. First of all, you need to make sure that everything is in the project that you want. Start by right-clicking the project and choosing "View->File System." The file system editor should appear. Now, under "Project," choose "Add -> Project Output." Choose the project you're interested in including stuff from, and select what you want -- "Primary Output" is generally the executable, "Content Files" might include help files that the project exposes, etc. By default, references to these go into the "Application Folder," but you can drag them to other folders in the File System editor. You can also right-click any folder to add project outputs directly to it. If you want to add files which aren't part of a project's outputs, you can do that as well (just choose "Add -> File" instead of "Add -> Project Output.") You can also create sub-folders as well. By right-clicking on the root node in the left-hand pane, you can also add other special windows folders as well (Fonts Folder, Program Files Folder, etc.) so that you can have your installer put items in those folders on the user's machines.
Now that you've got your objects in the editor in various fodlers, select anything that you've added, right-click, and choose "Create shortcut to..." This will create a shortcut to that thing. Initially, it will be in the same folder as the thing it references; just drag it to the folder that you want it to be in (Desktop, for example). The connection will be maintained automatically, unless you delete the thing that the shortcut references (in which case you'll get a validation error).
Finally, if there's DLLs or registration keys that you need to remain on the machine after uninstalling even if nothing else is using them, then select the object in the File System editor or Registry editor (View->Registry), select the item, go the to property grid and change the "Permanant" flag for outputs/files or the "DeleteAtUninstall" value for registry values. (BTW, I do not recommend this -- when an application is uninstalled, it should clean up after itself it no other project is using the resources.)
I hope this helps. There's more information on this at msdn.microsoft.com -- just do a search for "Setup Projects" there.
--Matt--*
Hi, Matt:
Very appreciate your answer, they are very helpful. I still have other questiones.
1) in my last post, I said I would like to keep registry for some files. Actually, I hope to try to install this application into my computer, when I uninstall them, some of my applications on my computer don't work properly, I am not sure in deployment application, whether there exists a simulation function for installation?
2) When I try to add some assembly files, for example .dll into file system, deployment always asks me there are in the c:/program files/common files/merge modules/, I am not sure whether they will be add into the deployment application or not if my application needs these dll files.
3) after I build deployment application, whether I can use some tools to check which files include my application?
Thank you very much!
Hi, yhong,
(1) I'm not aware of any simulation functionality for deployment. You could try using VirtualPC to test it out -- that way, you wouldn't lose any "real" state on your machine.
(2) Some DLLs should not be installed by themselves, because they are part of a set. For example, system.dll should not be installed by itself, because it's a part of .NET. Setup projects have a list of known DLLs which map to known merge modules, and if you try adding a DLL on that list, we'll suggest using the merge module instead (so you get the whole set). We'll "merge" the whole merge module into the MSI (hence the name) and will only install it on the user's machine if they aren't already there.
(3) Yes -- see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/orca_exe.asp. It will tell you exactly which files are in your MSI.
Hope this helps,
--Matt--*
Is there a tutorial for doing Setup Projects?
I have a C# project in VS2005. I did a Deploy and run the Setup.exe generated, and the program basically works. When I copied the Deploy files to another computer I get the program on the Start menu and it runs. I was surprised that there was no entry in C:/Program Files/program name, and the Help file (chm) and some other content files where no-where to be found. Researching MSDN I stumbled on the Setup Project topics but am lost.
- Is OneClick Deploy in addition to, or instead of, the Setup project?
- Do I add the results of the "Deploy" or my whole solution (project)?
- The File Editor (Setup Project) seems to have the right stuff I'm looking for - to get the associated files setup on the target computer - so I guess this is what I want. But why is Setup a different project - I thouhgt "Deploy" was for deploying a project.
- When I try to Build the Setup Project the compile fails reporting that something is missing (a third party DLL) but I added that and it is there. It is one of the References in the base project and now it is also listed in the files going into the target Application Directory - what more does the Setup project need to recognise this DLL?
- What is the Registry, or do I care about that?
- What is supposed to be the output of a Setup Project - MS Installer stuff?
- I noticed there was a Setup Wizard project template in the Setup template types - what is that?
I'm guessing on everything associated with the Setup project. There must be a Walkthrough or Tutorial out there in the ether somewhere but I can't find it. I can't be the only person to have this problem.
Any help will be welcome.
Thanks
So, in order then:
1. Click-Once deployment and Setup projects are two different ways to deploy your application. They don't rely on each other.
2. I'm not sure what you mean here. If we're talking about setup projects, then you want to add Project Output groups to them (we refer to these as "POGs" internally), and occasionally stand-alone files as needed. You add POGs by right-clicking the setup project, selecting "Add\Project Outputs," selecting the project you want to add outputs from (the project(s) must be part of your solution), and then the type of outputs your interested in (executables, content, etc.)
3. See my answer to #1. Setup & Deployment projects are indeed separate projects from your applications project. Setup projects give you a way to customize the installation experience and create an installer exe, and they "consume" the outputs of other projects to create the installer exe -- they're what you'd consider to be "traditional" installers, and customers get the resulting installer exe from you by traditional means. Click-Once deployment, on the other hand, doesn't require a separate project, as all it does is package up files in the current project and bundles them over to some central location, from which your customers can then install your app and get automated updates of your app. In this case, the deployed application can be more of a "living" thing, which makes it ideal for IT deployment scenarios or other cases where the distribution is centrally-driven -- the trade-off is that customization of the installation is harder to do (for now, that is).
4. I would need more information to diagnose this. However, when you add Project Outputs to the setup project, you should be getting the references along with them.
5. The registry is a really deep topic to cover, and I would suggest you start with MSDN. At it's core, the Registry is just a repository on your machine which stores commonly used data -- where controls live, default settings for apps, etc. Unless you understand it well, you shouldn't mess with it. There's no requirement to have registry settings for an arbitrary app, and in fact it's really best not to do so unless there's a really compelling need.
6. The output is an MSI file. You can also (in the project properties) change the outputs to several different formats.
7. This just automates the process of creating a setup project, making it slightly easier to create one if you're starting out from scratch. It gets you past a couple of steps that you would otherwise have to do by hand.
--Matt--*
Thanks for the info.
It took me two days, but I did find a Walkthrough from microsoft that solved my problem. The walkthough is at: http://msdn2.microsoft.com/en-us/library/k3bb4tfd The article takes you through adding a Setup Project to a simple (Notepad) project resulting in files you take to another computer and execute the Setup.exe to install. This is exactly what I was looking for.
Now that I have broken the code, it makes perfect sense and I probably wont have this problem again. I just had a problem with the concept and terminology. Like looking up a word in the dictionary to check spelling - if you don't know the proper spelling it is difficult to locate.
I suggest Microsoft make this topic easier to find. Or enhance the VS 2005 Publish/Deployment logic to something akin to a Wizard that accommodates the various methods or schemes. ClickOnce is one option, Setup Project as a component of your Solution is another. Or just update the Help system to include links within ClickOnce topics to other alternatives for Deployment.
Thanks, again
Hello,I'm using this thread to ask a somehow simple question ...
I'm using Visual Studio 2005 and writing in VB.Net.
I'd like to write a library of routines that I can Imports into my or others applications in my organization. This means that I have to compile and distribute it separately from the applications themselves. It should look like the external references that I use. What kind of Project should it be and how is the deployment of such a library?
Thanks much,
Marcelo