Archive for the ‘server’ tag
Windows 2008 & Visual Studio Web Setup: The installer was interrupted before ApplicationName could be installed
Although how much I hate creating setup packages, I had to create a few setups for some of my projects recently. While I was working on setup projects, I found that, the capabilities of Visual Studio Setup & Deployment projects are shockingly limited, and not to mention I faced a lot of issues while creating setup projects in Visual Studio. Few people suggested me to use WiX. WiX certainly is good and far more flexible solution for building Windows Installer Setup Packages, but it has got a very steep learning curve.
I will be making few posts in future about the problems, that I faced during my experience creating setup packages using Visual Studio. So, here you go. Here is the first problem.
The Problem
I was working on a simple Web Setup project in Visual Studio 2008. The setup worked fine in XP & Windows 2003 server. But, when I tried installing the setup in Windows Server 2008, I got this nice error message that said. “The installer was interrupted before <MyApplicationName> could be installed. You need to restart the installer to try again.”
Having faced many problems earlier with msi packages, I at least knew how to start the msi package in verbose mode to create the log files.
Launch your msi in verbose mode:
msiexec /i yoursetup.msi /lv "C:\yourdirectory\logfile.txt"
I searched for terms like “ERROR” & “FATAL” in the log file
. I got this.
Action ended 15:57:43: WEBCA_MYSETUPTARGETVDIR. Return value 1. MSI (c) (8C:20) [15:57:43:204]: Doing action: WEBCA_SetTARGETSITE Action start 15:57:43: WEBCA_SetTARGETSITE. MSI (c) (8C:20) [15:57:43:206]: Note: 1: 2235 2: 3: ExtendedType 4: SELECT `Action`,`Type`,`Source`,`Target`, NULL, `ExtendedType` FROM `CustomAction` WHERE `Action` = 'WEBCA_SetTARGETSITE' MSI (c) (8C:A0) [15:57:43:226]: Invoking remote custom action. DLL: C:\Users\ADMINI~1\AppData\Local\Temp\1\MSI4225.tmp, Entrypoint: SetTARGETSITE INFO : [03/31/2010 15:57:43:286] [SetTARGETSITE ]: Custom Action is starting... INFO : [03/31/2010 15:57:43:287] [SetTARGETSITE ]: CoInitializeEx - COM initialization Apartment Threaded... ERROR : [03/31/2010 15:57:43:290] [SetTARGETSITE ]: FAILED: -2147221164 ERROR : [03/31/2010 15:57:43:291] [SetTARGETSITE ]: Custom Action failed with code: '340' INFO : [03/31/2010 15:57:43:293] [SetTARGETSITE ]: Custom Action completed with return code: '340' Action ended 15:57:43: WEBCA_SetTARGETSITE. Return value 3. MSI (c) (8C:20) [15:57:43:297]: Doing action: FatalErrorForm Action start 15:57:43: FatalErrorForm.
I could see that the action WEBCA_SetTARGETSITE was failing. But I had not idea what was wrong, except that the term itself said Set Target Site failed. So I turned up to Google and landed on this blog post.
So the real problem is that my setup is unable to get the “Default Web Site” from IIS7.
The Solution
I installed the “IIS6 Metabase Compatibility” role using Role Manager as mentioned in the blog post and my setup started working. Existing software & scripts can interface with IIS7 only if the Metabase compatibility component is installed in IIS7.
Thanks to Galin Iliev.
C# Obtain List Of SQL Server Instances
Yesterday in a project I had to build a feature where use can change the sql server connection while deployment. I wanted to build something exactly like the sql server management studio login dialog box. So first thing I had to do is retrieve a list of sql server instances on a network. After a little bit of googling I found two solutions.
1) Enumerate SQL Server Instances Using SQLDMO:
To do this you have to add reference to SQLDMO.dll in your Program Files\Microsoft SQL Server\80\Tools\Binn
[csharp]public static List GetAllSqlServerInstances() {
/* Enumerate sql server instances using SQLDMO */
NameList sqlList = null;
Application sqlApp = null;
var sqlServers = new List();
try {
sqlApp = new ApplicationClass();
sqlList = sqlApp.ListAvailableSQLServers();
foreach (string server in sqlList)
sqlServers.Add(server);
return sqlServers;
} catch {
return null;
} finally {
if (sqlList != null)
sqlList = null;
if (sqlApp != null)
sqlApp = null;
}
}[/csharp]
If you choose to do it with SQLDMO then you have to bundle SQLDMO dependencies with your package or the client computer should have sql server tools installed.
2) Obtain List of SQL Server Instances Using ODBC (SQLBrowseConnect):
Fortunately the second method that I used uses ODBC’s SQLBrowseConnect and which is probably installed by default on all windows operating system. The article that I found on CodeProject was exactly what I was looking for after facing the SQLDMO dependency problem.
To obtain a list of sql server instances using SQLBrowseConnect add the SQLInfoEnumerator.cs to your project and put do something like this:
[csharp]public static List GetAllSqlServerInstances() {
/* Enumerates sql server instances using ODBC */
var sie = new SQLInfoEnumerator();
return sie.EnumerateSQLServers().ToList();
}[/csharp]
And to obtain a list of databases in a particular sql server instance do this:
[csharp]public static List GetAllDataBases(string server, string userName, string password) {
SQLInfoEnumerator sie = new SQLInfoEnumerator();
sie.SQLServer = server;
sie.Username = userName;
sie.Password = password;
return sie.EnumerateSQLServersDatabases().ToList();
}[/csharp]
Links: