Setup Wizard in VB 2005 Standard SP1
This one is aimed at Matthew Gertz in VB Development Team. Yes, I am aware that the Christmas Holidays are near but I hope your response will be quicker than last time.
First two points and then my query
1. Despite ticking the Alert Me box, I am not getting Alerts when you post responses.
2. The first time, I opened VB2005 after installing SP1, I got the error message "Run Time Error/Program C:\Pro\R6025 - pure function call" and VB closed. The second time I got an Report Error toMicrosoft - which I did. Third time the programme loaded and ran OK. Curious?
QUERY I have read extensively in the help file about using the Setup Wizard but the reality does not match the reporting.
Page bf5cf02e-b0b7-4a99-ba9c-bcf9d383b7db.htm - titled Setup Wizard has the following text in the User Interface Element List as follows
- Choose project outputs to include
Specifies project outputs to be added to the deployment project. You can select one or more outputs from the list of all outputs available in the solution. When an output is selected, theDescription field displays a description of that output.
When I tried using the Wizard, that part was missing completely and is not a lot of use when trying to write a setup for a windows application in MSI format.
Page 02cbce50-6fc2-4b89-bc32-3720a7651087.htm titledWalkthrough: Deploying a Windows-based Application has the text
Select theMy Notepad Installer project inSolution Explorer. In theProperties window, select theProductName property and typeMy Notepad.
in thecreate a deployment project section and the text below in the add the Windows-based application to the installer section
In theAdd Project Output Group dialog box, chooseMy Notepad from theProject drop-down list.
Select thePrimary Output group from the list. In theConfiguration box, select(Active). ClickOK to close the dialog box.
There was no box to enter the ProjectName. There was nothing in the Project dropdown list and the configuration was also blank.
I tried doing things more manually using a Setup Project with the same results. Every direction I tried ended up with the same inability to add my project to the setup files. And I thought ClickOnce was bad in Express (guess why I paid good money to upgrade to the Standard Edition?)
Any ideas on how to make it work?
regards
Colin "patient" Reid
Colin Reid wrote: |
| This one is aimed at Matthew Gertz in VB Development Team. Yes, I am aware that the Christmas Holidays are near but I hope your response will be quicker than last time. |
|
Hey, be nice -- my reponse time was fine -- my failure was getting non-VB dev teams to respond in a timely fashion (that is to say, getting them to respond at all)! 
Colin Reid wrote: |
| First two points and then my query 1. Despite ticking the Alert Me box, I am not getting Alerts when you post responses. |
|
That one I can't help you with, I'm afraid -- I have no oversight on the forum functionality, which is arcane magic to me. I've also noticed that you can't jump to a particular page on a thread from the main forum index -- that's the one that always annoys me.
Colin Reid wrote: |
| 2. The first time, I opened VB2005 after installing SP1, I got the error message "Run Time Error/Program C:\Pro\R6025 - pure function call" and VB closed. The second time I got an Report Error toMicrosoft - which I did. Third time the programme loaded and ran OK. Curious? |
|
Yeah, bizarre. It sounds like a either a problem with the install or a conflict with something already installed. When you reported the error to Microsoft, it went into our "Watson bucket," and those get doled out to the appropriate teams to investigate. In this case, it would have gone to the Visual Studio Environment team, as they own that part of the code (that is, the start-up of VS). If you'd like to track the progress on the bug, you can file a report at the Connect site, and the dev who gets it can link that report to his/her investigation -- progress on the investigation is then linked back thorugh the Connect site. It's also possible that the folks reading the VS setup & installation forum (http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=26&SiteID=1) might be able to shed light on this. Given your experience below, though, I'm wondering if your installation had a hiccup.
Colin Reid wrote: |
| QUERY I have read extensively in the help file about using the Setup Wizard but the reality does not match the reporting. Page bf5cf02e-b0b7-4a99-ba9c-bcf9d383b7db.htm - titled Setup Wizard has the following text in the User Interface Element List as follows - Choose project outputs to include
Specifies project outputs to be added to the deployment project. You can select one or more outputs from the list of all outputs available in the solution. When an output is selected, the Description field displays a description of that output.
When I tried using the Wizard, that part was missing completely and is not a lot of use when trying to write a setup for a windows application in MSI format. |
|
I'm not clear if you're walking through the sample explicitly or not. Did you have another project in the solution at this point? Based on your later comments, it sounds like you have the Notepad project in your solution, but I just want to double-check. If you don't already have other projects in the solution, then that page won't show (since it would of course be blank -- no project outputs are available if no other projects exist), and in such a case you can either add the other projects first, or, if you add them later, you can just right-click on the setup project and choose "Add Project Outputs" to add the project outputs. But, if you do have the notepad project -- or some other language project -- in your solution but are not seeing project outputs, then this is a bug occuring for some odd reason and you should file a Connect bug so that the devs can investigate, if the suggestion I give at the bottomdoesn't work.
Colin Reid wrote: |
| Page 02cbce50-6fc2-4b89-bc32-3720a7651087.htm titled Walkthrough: Deploying a Windows-based Application has the text Select the My Notepad Installer project in Solution Explorer. In the Properties window, select the ProductName property and type My Notepad. in the create a deployment project section and the text below in the add the Windows-based application to the installer section In the Add Project Output Group dialog box, choose My Notepad from the Project drop-down list. Select the Primary Output group from the list. In the Configuration box, select (Active). Click OK to close the dialog box.
There was no box to enter the ProjectName. There was nothing in the Project dropdown list and the configuration was also blank. |
|
Again, as above -- if no projects in the solution indicate that they support project output groups, then this is what you'd see.
Colin Reid wrote: |
| I tried doing things more manually using a Setup Project with the same results. Every direction I tried ended up with the same inability to add my project to the setup files. And I thought ClickOnce was bad in Express (guess why I paid good money to upgrade to the Standard Edition?) Any ideas on how to make it work? regards Colin "patient" Reid |
|
Yes, it would be the same if the projects weren't exposing the appropriate interface (or if there were no projects). Assuming that you do have projects in your solution (such as the notepad sample project, or some other project you've added to your solution) and you're still not seeing project outputs, then the most likely thing is that you had a bad install (which would tend to agree with your other crash-at-startup experience above) where the registration was incomplete. In such a case, you might try re-registering the following DLLs in Visual Studio (using regsvr32, and with all of the normal caveats of backing up your registry, etc.):
program files\microsoft visual studio 8\common7\tools\deployment\vspkgs\dpprj.dll
program files\microsoft visual studio 8common7\tools\deployment\vspkgs\dpdpl.dll
program files\microsoft visual studio 8common7\tools\deployment\dpedt.dll
program files\microsoft visual studio 8common7\tools\deployment\dpplg.dll
vb\msvbprj.dll
and see if that makes a difference (or, there's the reinstall route, which is of course no fun). If this doesn't make a difference, then this would require deeper investigation and you should file a Connect bug so that the setup team can look at it.
--Matt--*
Thank you the indecently swift response and, yes, apologies for the heavy handed irony initially used.
You make an interesting comment in the first part of my query "have other projects in the solution". I am not using the Notepad example but looking to deploy projects that I have built. I am not sure what you mean by projects in the solution but I wonder if the problem is that I do not develop and build projects in the Microsoft default directory (c:\documents and settings\username\my documents\visual studio 2005\projects) as c:\data\programmes suits my backup policy of being able to backup all kinds of my data in one step. Is this why VS cannot see my other projects.
I tried reregistering the DLLs and even reinstalled but without any effect. If I right click the setup SLN written by the Setup Wizard and try to Add Project Outputs, there are no projects registered. As you say the other problems I encountered are related to resolving this.
Should I file a Connect bug?
Nope, this isn't a bug, and I can definitely help you here. Where your projects live on disk is irrelevant, but you need to add them to the solution in order for the setup wizard (or setup projects) to know about their existence. In your case, the project simply needs to be open in VS before the wizard will work.
(Apropos of nothing: note that the solution node is not shown by default when using the VB profile unless you have more than one project in it, and I fear that that's made the existence of solutions less visible to our customers in general. A solution is merely a collection of related projects, like a VB6 workspace. To always see the solution node, go to tools/options, "Projects and Solutions," "General," and check "Always show solution". This has nothing to do with your problem, but I thought I'd mention it anyway.)
Basically, there are two options for deploying stuff using the setup wizard or setup projects:
(1) If the projects are in the same solution as the setup project, then those projects will "advertise" their own existence, as well as the existence of their outputs, to the setup code. This is really the way to go. So, to do this, open VS and load up the project whose outputs you want to deploy, then run the setup wizard in the same VS session -- you'll see that first project's outputs now. Everything should "just work," and you'll get a new setup project (which you can subsequently tweak if you like) added to the solution which consumes the outputs of the first project. You'll even automatically reference any dependent files that those outputs need. Build it, and you'll get an MSI that you can distribute which contains the outputs and its required references.
(2) If you are trying to deploy binaries which do not come from VS projects (and hence cannot load the projects), you can still use the wizard -- just treat the binaries like files (there's a page in the wizard for pointing to files to deploy). The downside is that you won't automatically pick up any dependencies those files may have -- you'd need to do those by hand as well.
This should address your issue fully, I think. If not, let me know -- I'll be in the rest of this week. (I'll be on vacation starting Friday afternoon until January 2.)
--Matt--*
Did the Always Show Solution tweak.
Nearly there? The key is running File\Add\New project\ setup wizard not file\new project\setup. But as I say nearly as I am not out of the woods yet. As the intention is to build the setup file/MSI for standalone computers assuming no internet connection, I have specified "download prerequisites from the same location as my application" and to add a icon/link on the target desktop.
The setup baulks until dotnetfx.exe is in a subdirectory of the source disk called dotnextfx. Similarily, windowsinstaller-kb89380803-v2-x86.exe has to be in a subdirectory called windowsinstaler3_1. Easily overcome but counterintuitive.
Setup then ran OK including the reboot for .NET2 but clicking on the desktop icon opened explorer on the installed directory not ran the programme. Again counterintuitive but overcomeable.
When I ran rhe installed programme, I got the Microsoft reporting error message which I cannot send as I am testing on a standalone machine without an internet connection.
The details of the error message is
Event Type clr203r3 P1 recipe.exe P2 1.02546.24502 P3 458a90bc P4 recipe P5 1.02546.24502 P6 458a90bc P7 12 P8 e9 P9 systeminvalidoperationexception
This means nothing to me. Can you help?
Regardless, have a good Christmas and thanks for the help.
Colin Reid wrote: |
| Did the Always Show Solution tweak. Nearly there? The key is running File\Add\New project\ setup wizard not file\new project\setup. |
|
D'Oh! I should have mentioned that as well. (To other readers: doing it the second way will cause your current project to close.)
Colin Reid wrote: |
| But as I say nearly as I am not out of the woods yet. As the intention is to build the setup file/MSI for standalone computers assuming no internet connection, I have specified "download prerequisites from the same location as my application" and to add a icon/link on the target desktop. The setup baulks until dotnetfx.exe is in a subdirectory of the source disk called dotnextfx. Similarily, windowsinstaller-kb89380803-v2-x86.exe has to be in a subdirectory called windowsinstaler3_1. Easily overcome but counterintuitive. |
|
Hmm. None of that rearrangement should have been necessary. It should be sufficient to choose "install from same location" & be done with it -- that always works for me when I package up my hobby code. (I always choose that option myself because it spares my friends a download, and there's always plenty of room on the CD I end up burning.) My particular expertise in this area is with the setup project editors & project UI, not with the actual install engine. However, there's a clever guy reporting to me who's more knowledgable about the install portion than me, and I believe he'll be in later today -- I'll try and track him down.
Colin Reid wrote: |
Setup then ran OK including the reboot for .NET2 but clicking on the desktop icon opened explorer on the installed directory not ran the programme. Again counterintuitive but overcomeable. |
|
The setup wizard doesn't actually create shortcuts -- you have to add them in the resulting setup project -- so I'm curious how you got the shortcut. Regardless, sounds like you ended up (however it happened) creating a shortcut to the application folder rather then the thing itself. You can use the File System view in the Setup project to create a shortcut to the actual application which will go on the user's desktop or start menu or whatever. Right-click the setup project and choose View\File System. Navigate to the place that you want to have the shortcut (e.g., "User's Desktop"), and in the right pane, right-click blank space and choose "Create Shortcut." In the resulting dialog, navigate to the Application directory and select the project output there. Voila! (You can also just navigate to the Application directory in the File System view, right-click the output there and create a shortcut, and then drag the shortcut to whatever place you want.) Look around the File System view and delete any shortcuts that don't make sense to have (like the one to the application folder). Note that if you want to add other special folders into which you can place the shortcut, just right-click the root node in the left panel and choose "Add Special Folder" -- you'll see lots of choices listed there.
Colin Reid wrote: |
When I ran rhe installed programme, I got the Microsoft reporting error message which I cannot send as I am testing on a standalone machine without an internet connection. The details of the error message is Event Type clr203r3 P1 recipe.exe P2 1.02546.24502 P3 458a90bc P4 recipe P5 1.02546.24502 P6 458a90bc P7 12 P8 e9 P9 systeminvalidoperationexception This means nothing to me. Can you help? Regardless, have a good Christmas and thanks for the help. |
|
Thanks. I think that the .NET installation got messed up -- this is the sort of error I'd expect to see if some piece of it was missing (I assume that recipe.exe is the name of your app, yes?), and given your experience with the installation above, this wouldn't surprise me. Like I say, Ting will likely have a better handle on this than me, so if/when he comes in later today I'll ask him to chime in.
--Matt--*
Colin,
I've tracked down the ever-knowledgeable Dave Guyer, our expert QA guru in this area, who should be weighing in a bit later today.
--Matt--*
If we got to the point where your application installer was run (the .MSI file), then we almost certainly have the .NET Frameworks 2.0 setup properly on your machine. One way to double-check would be to go to Add/Remove programs and make sure it's listed.
You are using setup projects now, and not ClickOnce, right? I think that's what I understood reading the thread but I just want to double-check.
So, that leads me to think that your application is not installed correctly... for example you might be missing an important file.
Can you check the installation folder and check to see if any files you expect are missing? How is your project designed or architected... is it just a single "recipe.exe" file, or are there other files, like databases, or anything that your application code requires to run correctly?
Is there a place where I can get a copy of your application? (you can e-mail me directly @ davguy[at]microsoft[dot]com ). Then I might be able to re-create or dig deeper into the issue.
I'm leaving on vacation myself today, but I will try to check in on this issue from time to time, but my response time might be a little slow...
The objective is to install to a standalone machine without internet access. The setup.msi produced in the setup debug folder installs NET2 and WindowsInstaller3.1, reboots and runs the setup wizard. The prohect is correctly listed in Add/Remove. I am not using ClickOnce as I found that counterintuitive in the extreme.
The project has two Access databases and a manual in PDF format both happily present in the installed version as are three commercial OCX'x and three NET dll files but one is missing and it a UserControl I wrote. It is registered as Copy Local like the other references in the project references/properties but does not appear to have been included in the setup build.
Any ideas how to overcome that?
I am not sure that sending the code will help unless you have the OCX and DLL?
regards
Colin Reid
So the built MSI is missing 2 files... one user control that you wrote.
If the file is a dependency of a something you've included in your setup project, we should be picking it up as a dependency. The way to check that is to take a look at the properties of the assemly or project output group you think references the file. There should be a "dependencies" property that you can open and see all the dependencies of that assembly. See if your file is listed there. If it's not, then that's a clue as to the source of the problem.
The workaround would be to add a project output group from your user control project, or to the file itself, directly.
I hope this helps.
Yes I am building a Setup Project MSI and the two files that are missing on the target computer are the XML and DLL files relating to a User Control that I wrote and built. It works fine in the source project.
The UserControl shows up in the File System (Setup) Dependencies and in the Project Properties/Publish/Application List (not that I am using ClickOnce).
I am afraid that I do not understand what you mean in your workround. Could you spell it out a bit step by step?
Sure, the first workaround to try would be to
- go to the File System Editor
- right-click and select Add -> Project Output
- In the dialog that pops up, select your UserControl project, and the Primary Built Output
If that doesn't work, you can remove that project output and try this
- to to the File System Editor (the folder you want/need the .dll and .xml file to be)
- right click and select Add -> File...
- in the dialog that pops up, navigate to the built output folder of your user control project and select the missing files.
You mentioned an XML file that wasn't being picked up... what is the XML file, and how did you add it to your user control project. If it's not a "built" output, you might need to go to the XML file in the Solution Explorer of the user control project, and check the properties... it might need to switch the "Build Action" property to "Content". This will place it in the Content Project Output Group... then,
you need to go to your setup project and add the Content project output group to your project. Normally XML files are not included in the Primary Built Output group. (This might help negate the need of a workaround).
HTH
I tried the workround but my UserControl does not appear in the pulldown list of projects. It is listed in the Setup Dependencies.
The XML files has the same name as the UserControl DLL and "appeared" in the UserContol Bin directory when I built the control. The XML file does not appear in the UserControl Solution Explorer so I cannot change the Build Action to Content but I suspect it is not relevant to my problem.
So, I rebuilt the Setup project and retested it on a clean computer. The programme installs OK (except for the fact that the Wizard that appears says "Welcome to the Setup Setup Wizard" which is silly not to pick up the project name) but.....
I still get the Windows error message closing the programme with the details as follows
EventType : clr20r3 P1 : recipe.exe P2 : 1.0.2573.24820
P3 : 45ae2996 P4 : recipe P5 : 1.0.2573.24820 P6 : 45ae2996
P7 : 12 P8 : e9 P9 : system.invalidoperationexception
However, the UserControl DLL is included with all the other DLL and Interop OCXs so maybe that was a blind alley
I do hanker for the Setup and Deployment Wizard in VB6 as that always worked.
Any further ideas as I have no idea what the system.invalidoperation exception refers to?
regards
Colin Reid
Okay, it seems you got the setup working correctly.
If I'm inferring things right, the .XML file is not something you added, it was auto-built. If that's right, then I think I know what that file is, and I don't think you need to install it.
You can change the text in the welcome dialog by changing the ProductName property of the setup project. It defaults to the project name.
I'm not sure what the invalidoperationexception is... but you might be able to debug it when this exception comes up and figure out what code is triggering the exception. These kinds of things can be pretty tricky (and are outside my key knowledge area
)
I hope this has helped.