Deployment FAQ
Q: I am now getting the following error when I build: "Unable to update the dependencies of the project. The dependencies for the object 'name.dll' cannot be determined"
A:
Workaround: Try to adjust the order of the Projects in the Solution and leave the Database project to the end.
We can either edit the Solution (*.sln) file with notepad OR remove and add the Database Project back in the solution. (This also isn’t a great work-around as the addition of a project later in the development cycle will cause the corruption to re-appear).HotFix:Contact PSS and ask for the Hotfix for KBB917036: http://support.microsoft.com/default.aspx scid=kb%3Ben-us%3B917036
Q: Is it possible (in a VS.net 2003 deployment project) to make the installation of a desktop shortcut conditional (on the value of CHECKBOXA1 for example)
A: It is not possible to conditionally install shortcuts. However, it is possible to conditionally install files. The work-around is to add 2 copies of the file you would want to add a shortcut to. Set the condition on each of these files to be based on your check box dialog result, and create your shortcut to point to this file.
Q: How do I install MSDE with my application
A1: You should download MSDE Merge Modules from: http://www.microsoft.com/sql/downloads/2000/sp3.asp and then use this FAQ for more information: http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnsql2k/html/sql_embeddingmsde.asp and this link provides some more information… http://msdn.microsoft.com/library/default.asp url=/library/en-us/distsql/distsql_8yeq.asp
A2: If you are using VS 2005, then you should consider using SQL Server Express instead. In order to include SQL Server Express with your application, you just need to open the Prerequisites dialog (on the Setup project property pages) and select SQL Server Express in the list.
Q: How do I turn off repair for a file that I expect my users to modify
A: There is a solution if you are willing to edit the .msi file after its
built.
For each file that you don't want automatically repaired, use ORCA or the
Windows Installer Automation to edit the Component table and delete the
Keypath entry. You'll need to use the File table to determine the Component
value for the rows to edit in the Component table.
If you do this, the repair will only execute if the parent folder is
missing.
Q: How do I modify security on a machine during installation
A: See this MSDN Article on Deploying Security: http://msdn.microsoft.com/library/en-us/dnforms/html/winforms11122002.asp
Q: Where can I find some examples of using setup projects
A: The Deployment Walkthroughs can be found online at: http://msdn2.microsoft.com/en-us/library/tw8kdk75.aspx
Q: Where can I find an overview to help me plan deployment of a .NET based application
A: The following http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnbda/html/dalgroadmap.asp
Q: Where can I download the Windows Installer SDK (which includes the Orca table editor)
Q: Where can I get help/updates for Crystal Reports
A: Updated merge modules can be installed from: http://support.crystaldecisions.com/updates/ and Crystal provides support for their software and merge modules.
Q: Where can I get a bootstrapper that will help me install the .NET Frameworks with my application
A: For Visual Studio 2005: It’s built-in. Go to the Prerequisites dialog on project properties.
A: For Visual Studio 2003: http://msdn.microsoft.com/library/en-us/dnnetdep/html/dotnetframedepguid.asp
Everett Bootstrapper AddIn: http://www.gotdotnet.com/community/workspaces/workspace.aspx ID=2F8F0A23-F529-4158-8E0A-D187D16F41F1
http://workspaces.gotdotnet.com/vsboot
Q: "This Setup Does Not Contain the .NET Framework" Error Message During Visual Studio .NET Deployment
A: http://support.microsoft.com/default.aspx scid=kb;en-us;320426
Or… http://workspaces.gotdotnet.com/vsboot for the Everett Bootstrapper plug-in
Q: I’m getting an “Unrecoverable Build Error” building a setup project.
A: http://support.microsoft.com/ id=329214
Q: I’m getting An error occurred when validating. HRESULT = '80040155'
A: http://support.microsoft.com/ id=329214 and do the steps for “Missing Registrations”
if that doesn't work, then try the help in this post: http://support.installshield.com/kb/view.asp articleid=q106194
Q: How do I modify the settings for an IIS folder that aren’t available on a Web Folder in the File System Editor.
A: See the following whitepaper on how to modify IIS settings using a custom action: http://msdn.microsoft.com/library/default.asp url=/library/en-us/dv_vstechart/html/vbtchUsingCustomActionsToModifyInternetInformationServerDuringDeployment.asp frame=true
Q: How do I deploy a Hybrid VB6 and VB.NET application
Q: What changes are there in deploying Visual Studio.NET applications compared to VB6 applications
Q: Where can I find more information about “No Touch Deployment”
A: http://msdn.microsoft.com/library/en-us/dv_vstechart/html/vbtchno-touchdeploymentinnetframework.asp . You should also look at it’s successor in Visual Studio 2005 / .NET Frameworks 2.0, ClickOnce at: http://msdn.microsoft.com/vbasic/learning/clickonce/
Q: How do I deploy ASP.NET applications
A: http://msdn.microsoft.com/library/default.asp url=/msdnmag/issues/02/11/ASPColumn/TOC.asp
Q: How do I debug a custom action / installer class
A: You can use one of three methods:
- Add a call in your code: System.Diagnostics.Debugger.Launch which will open the Just In Time Debugging window and allow you to attach or open a new debugger to your code.
- Add a call in your code MessageBox.Show(“Debug Me”). When it is shown, use a copy of Visual Studio.NET to attach to the MessageBox process. Then “Break” into the debugger.
- Set your debugging preferences to start InstalUtil.exe (its in \winnt\Microsoft.net\Framework\version) and pass it your assembly as a parameter. When you F5, you’ll hit your breakpoint. InstallUtil will run your custom actions the same way MSI does so you should be okay.
Q: A Windows Installer Repair Dialog Box Appears When You Start Visual Studio .NET
A: http://support.microsoft.com/default.aspx scid=kb;en-us;313900
Q: How do I create shortcuts for a Visual Studio .NET Setup project
A: http://support.microsoft.com/default.aspx scid=kb;en-us;307358
Q: "Error Installing ODBC Driver" Error Message When You Use the Vfpodbc.msm Merge Module in a Visual Studio .NET Setup and Deployment Project
A: http://support.microsoft.com/default.aspx scid=kb;en-us;814700
Q: "Unable to build custom action" Error When You Build a Setup Project
A: http://support.microsoft.com/default.aspx scid=kb;en-us;814744
Q: Deploy a Visual Basic .NET Application That Uses ADO Interop
A: http://support.microsoft.com/default.aspx scid=kb;en-us;321688
Q: Error 1619 When You Install a Package That Uses Web Bootstrapper
A: http://support.microsoft.com/default.aspx scid=kb;en-us;313498
Q: Deploy an Assembly to the Target Computer Global Assembly Cache (GAC)
A: http://support.microsoft.com/default.aspx scid=kb;en-us;324168
Q: In Visual Studio 2003, how do I build a Web Setup that I can install on a server that has multiple web sites, especially one using IP addresses or Host Headers.
A: http://support.microsoft.com/ id=821335
Q: Registering Assemblies with Com interfaces doesn’t work, RegAsm bug…
A: If your assembly has a dependency, like on another class library, and you are trying to use RegisterCOM, it might not work. This is because we call RegAsm to get the registration information, but RegAsm is called in the obj directory. As a result, the dependency isn’t found and the RegAsm fails, but doesn’t tell us it fails… The best workaround is to add the assembly by hand from the bin directory. Another workaround is to use RegisterSelfReg.
Hope that helps. Also, make sure you manually register using RegAsm /Codebase… if your assembly isn’t in a shared location, it won’t be found unless it’s in the same directory as the calling code (I think, maybe not even then)… /codebase enters the directory into the registry
Q: Is it possible to (conditionally) launch the installed application when the installation has completed
A: As of this time, there is no good solution to doing this.
Q: How do I get a log file for my install
A: There are two good ways.
1. Run from the command line with the logging switch
misexec /i mysetup.msi /l*v mylog.txt
2. Save the following as a .reg file and load it into your registry.
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer]
"Logging"="voicewarmup"
"Debug"=dword:00000007
Then, go to your temp directory, and sort on date. The most recent msi*.log file is from the most recent install or uninstall.
Q: Installing to a subdirectory of an already installed product.
A:
1. Product 1 is installed and has a file named MyFile.txt.
2. You use ORCA (from the Windows Installer SDK) to view the File table, and find the row that represents MyFile.txt.
3. You get the value of the Component_ column and then open the Component Table
4. In the Component Table you find the row that has the Component_ value in the Component column, and get the ComponentID. Copy this value into clipboard. Close ORCA
5. In your setup project, open the Launch Conditions Editor and add a Windows Installer Component Search. For the ComponentID property of the new search, paste the ComponentID.
6. Copy the Property property. It should be something like COMPONENTEXISTS1
7. Open the File System Editor and select the Application Folder
8. Edit the DefaultLocation property to be somethig like [COMPONETNEXISTS1]MySubFolder (since the path in COMPONENTEXISTS1 includes a trailing \)
Note: After step 6 above, you might want to add a Condition to the Launch Conditions Editor to check if the component was found, and to block install and show a message if it wasnt. The condition would be COMPONENTEXISTS1 (which means, it's okay to run the installer if COMPONENTEXISTS1 is not empty).
Q: Installing Custom Web Folders to a non-default port
A: So, there is a way to do this... You need to know the Property property values for each of your Web Custom Folders. Typically, they are something like NEWWEBPROPERTY1.
Then, you need to run your install from the command line. Let's say your web server is on port 20 instead. You also need to include TARGETPORT for the Web Application Folder. So, your command line would look like this for just one web folder, add more PROPERTY=VALUE pairs for each web folder...
msiexec /i mywebsetup.msi TARGETPORT=20 NEWWEBPROPERTY1PORT=20
That should redirect each listed folder's port to the specified port.
You might want to remove the Installation Address dialog, since if someone changes the port in the UI during install time, the Custom Web Folders will use the command line value.
Q: Install to the root of a web site, c:\inetpub\wwwroot…
A: Set the VirtualDirectory to an empty string, either in the Web Setup project, or during install.
Q: I am trying to find the least painful way to install a ServicedComponent into the GAC and configure it in the COM+ catalog.
I tried to add an Installer class to my serviced component and overrode the Install(Idictionary stateSaver) method. Next I added the assembly to a merge module, put the serviced component in the GAC, and added a custom action to the MSM. I received the following error when I compiled:
"Unable to build custom action named 'Primary output from RegServer (Active)' because the file's Folder property is set to Global Assembly Cache."
A: It is not supported. The primary reason is that assemblies in the GAC are not always available (i.e. committed to the GAC) when the custom actions are run.
There is a workaround, and it is basically to put your code into different files, and put your custom action code into a file that is not going to the GAC, if possible. Sometimes it's not possible to spread these out.
I'm pretty certain, that even though there is some documentation that says that COM+ files must go into the GAC, that they really don't if they are registered correctly... but I'm not 100% sure.
Q: How do I automatically run my program after installation
A: There is a way that might work, but it also might not work the way you expect.
1. Create a .vbs file with the following code.
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """" & Property("CustomActionData") & """",7,False
Set WshShell = Nothing
2. Open your setup project and go to the Custom Actions Editor
3. Select the Commit Node and right-click, add a new Custom Action
4. Browse the filesystem to add the .vbs file from step 1
5. Edit the CustomActionData property and add the following:
[TARGETDIR]YourApp.exe
6. Change “YourApp.exe” to whatever your startup app file name is.
Q: How do I create an uninstall link on my shortcut:
A:
1. In your setup project’s directory, create a new uninstall.bat file.
2. In your Setup project, copy the ProductCode property (something like [12345678-1234-1234-1234-123412341234]
3. Edit the uninstall.bat so that it has one line that says:
Msiexec /x [insert product code here]
4. Add the uninstall.bat to your setup project’s application folder.
5. Right-click on the uninstall.bat to create a shortcut, and then put it in the Start menu folder you want it in (in the setup project).
6. Rename the Shortcut to something like “Uninstall MyApplication”
That should do it.
Q: How do I turn off dependency resolving/searching
A: Unfortunately, there's no direct way to turn off dependency analysis. However, there is a workaround: you can uncheck the "Include standard search paths" option in the dialog that comes up from the SearchPath property. However, there are a few additional points to consider: (1) You need to add your files using Add -> File. If you use Add -> Project Output then dependencies reported from the code project will be included. (2) When you build, you may see one or more "Unable to find dependency" warnings, but these can be ignored in this case. (3) If you only want to turn off dependency analysis for some files, then you can put those files in a merge module project with standard search paths turned off. Then use Add -> Merge Module to include the .msm in a regular setup project with standard search paths turned on.
Q: Is there a way to turn off Dependency detection
A: Unfortunately, there's no direct way to turn off dependency analysis. However, there is a workaround:
You can uncheck the "Include standard search paths" option in the dialog that comes up from the SearchPath property.
However, there are a few additional points to consider:
(1) You need to add your files using Add -> File. If you use Add -> Project Output then dependencies reported from the code project will be included.
(2) When you build, you may see one or more "Unable to find dependency" warnings, but these can be ignored in this case.
(3) If you only want to turn off dependency analysis for some files, then you can put those files in a merge module project with standard search paths turned off. Then use Add -> Merge Module to include the .msm in a regular setup project with standard search paths turned on.

Setup and Deployment Project FAQ
kingy0489
Hi there,
I'm facing a small problem while creating a web setup project in VS 2005. When I select Add>Project Output> I see only "content Files" but I dont know where are the rest like "Primary Output,Localized resources,debug symbols,documentation files, etc." But this is the not the case when I want to create a windows setup. Can anyone tell me why I'm facing this problem for web setup
Thanks
Mukhthar
Monique555
Sean Lively
Could you tell me where I can find the ProductCode Is it the ProductCode of VS .NET 2003 or the Application I am creating
Thanks a lot!
---------------------------------------------------
Q: How do I create an uninstall link on my shortcut:
A:
1. In your setup project’s directory, create a new uninstall.bat file.
2. In your Setup project, copy the ProductCode property (something like [12345678-1234-1234-1234-123412341234]
3. Edit the uninstall.bat so that it has one line that says:
Msiexec /x [insert product code here]
4. Add the uninstall.bat to your setup project’s application folder.
5. Right-click on the uninstall.bat to create a shortcut, and then put it in the Start menu folder you want it in (in the setup project).
6. Rename the Shortcut to something like “Uninstall MyApplication”
That should do it.
Koray Bahar
Q: How do I create an uninstall link on my shortcut:
A:
1. In your setup project’s directory, create a new uninstall.bat file.
2. In your Setup project, copy the ProductCode property (something like [12345678-1234-1234-1234-123412341234]
3. Edit the uninstall.bat so that it has one line that says:
Msiexec /x [insert product code here]
4. Add the uninstall.bat to your setup project’s application folder.
5. Right-click on the uninstall.bat to create a shortcut, and then put it in the Start menu folder you want it in (in the setup project).
6. Rename the Shortcut to something like “Uninstall MyApplication”
That should do it.
and how exactlyu do i get the productcode i cant seem to get it right.
Kiran Karnati
the setup project worked at the very first time when I added the setup project.
after that I updated my main project. but when I build my setup project it does not reflect my
updates.
how can I make the setup project updatable
please help me
or tell me where should I talk about this.
Thank You
swatib
"Never create two components that install a resource under the same name and target location. ... Note that the previous rule means that two components must not have the same key path file."
http://msdn.microsoft.com/library/en-us/msi/setup/organizing_applications_into_components.asp
"Desktop Engine (MSDE 2000) SP3a provides merge modules to support existing applications that use merge modules. The Setup utilities for new applications should be written to call the MSDE 2000 Setup utility instead of directly consuming the MSDE 2000 merge modules."
http://support.microsoft.com/default.aspx scid=kb;en-us;889551
Victor_Acosta
The product code of the MSI you are building. It's in the ProductCode property of the setup project properties.
maestro49m
meet_kuldeep
I am having a problem with an application which is a NTD(No-touch deployment). The application cannot see the Config file, inspite of the config file being downloaded. I checked the GACUTIL to see the download cache all the necessary dlls are downloaded. I checked to Temp Internet files, it had all the necessary files including the Config file, but the application comes back with an error which indicates that I could not read the config file. Can anyone tell me what is happening.
Also the security policy was deployed from the web server. The application is deployed on the MACHINE Level with FULL TRUST access.
Please help
akabir
Yes, take a look at the second question/Answer in the FAQ, it has links for how to do MSDE.
Jesse Beder
Hi David,
Can you take a look at this
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=926538&SiteID=1
Regards
Mohan
stf-developer
Regards,
GlenAtMotorola
This seems very dangerous to me:
"Q: How do I turn off repair for a file that I expect my users to modify
A: There is a solution if you are willing to edit the .msi file after its
built.
For each file that you don't want automatically repaired, use ORCA or the
Windows Installer Automation to edit the Component table and delete the
Keypath entry. You'll need to use the File table to determine the Component
value for the rows to edit in the Component table.
If you do this, the repair will only execute if the parent folder is
missing."
The KeyPath entry is a requirement for many items to work correctly. The Class table is an example. The class table has a Component_ entry that is the "External key into the Component specifying the component whose key file provides the COM server." If you take away the KeyPath, that linkage is gone. The documentation that references the key file of a component says it's used with Windows File Protection, with updating files based on version, with the TypeLib table.
Entity_X