Groups > Application developers > Community Server Source discussions > Re: Is the source code for the fantastic MSI installer available?




Is the source code for the fantastic MSI installer
available?

Is the source code for the fantastic MSI installer available?
Thu, 7 Sep 2006 12:58:38 +0000
Using the latest MSI installer v2.1 for .NET2.0 i was immediately impressed by
the ease of the community server.

Many users could benefit from the ability to install a database and create user
accounts during the installation phase.  

Do you use the builtin Visual Studio 2005 installer or use a 3rd party product.

I beleive it would be a great asset to the .NET community as a whole if u could
share your SQL installation techniques.

Thanks...
Post Reply
Re: Is the source code for the fantastic MSI installer available?
Thu, 7 Sep 2006 18:02:51 +0000
Sweet talker 

It's all built using the Visual Studio tools. The MSI is fairly simple to
create, although there are a few trouble areas to watch out for:

 1. The easiest way to package the files from your other project(s) is to
include the MSI project in the same solution. But you have to be careful because
if there are files on disk that aren't referenced in the project or if they have
a Build Action of None they won't make it into the MSI. I always check that all
None are changed to Content - and with as many files as CS has you need to write
a script to do these checks.

2. If there are any files referenced in the project that don't exist on disk the
MSI will fail to build and won't give you any hints why. So, you can look for
those yellow exclamation icons next to missing files, or again if you have a
huge project that becomes impractical. We have a little console app that checks
for this for us. The basics being:

   static void Main(string[] args)
  {
   string folder = Environment.CurrentDirectory;
   string project = "CommunityServerWeb.csproj";
  
   if(args != null && args.Length > 0)
   {
    folder = args[0];
   }
  
   if(args != null && args.Length > 1)
   {
    project = args[1];
   }
  
   string path = Path.Combine(folder,project);
   int count = 0, missing = 0;
  
   XmlDocument doc = new XmlDocument();
   doc.Load(path);
  
   XmlNode node =
doc.SelectSingleNode("/VisualStudioProject/CSHARP/Files/Include" );
   if(node != null)
   {
    foreach(XmlNode fileNode in node.ChildNodes)
    {
     if(fileNode.Name == "File" )
     {
      count++;
      FileInfo fi = new
FileInfo(Path.Combine(folder,fileNode.Attributes["RelPath"].Value)) ;
      if(!fi.Exists)
      {
       missing++;
       Console.WriteLine(fi.FullName + " is missing...developers asleep
again" );
      }
     }
    }
   }
   else
   {
    //try looking for VS 2005 format
    node = doc["Project"];
    if(node != null)
    {
     foreach(XmlNode itemNode in node.ChildNodes)
     {
      if(itemNode.Name == "ItemGroup" )
      {
       foreach(XmlNode fileNode in itemNode.ChildNodes)
       {
        if(fileNode.Name == "Compile" || fileNode.Name ==
"Content" )
        {
         count++;
         string f =
System.Web.HttpUtility.UrlDecode(fileNode.Attributes["Include"].Value)
;
         FileInfo fi = new FileInfo(Path.Combine(folder,f));
         if(!fi.Exists)
         {
          missing++;
          Console.WriteLine(fi.FullName + " is missing...developers asleep
again" );
         }
        }
       }
      }
     }
    }
   }
  
   Console.WriteLine(count + " checked, " + missing + "
missing" );
  
   Console.ReadLine() ; 
  }


All of the web.config, IIS and database goodness is done in an executable
CommunityServerWizard.exe that is spawned by the MSI in a custom action (right
click on the MSI project and you can have lots of fun with adding files,
folders, custom actions, ui, etc). That's a lot more complex than I can quickly
explain here - and keeps getting more complex as we try to handle more
combinations of XP/Win2k3 32bit/64bit, SQL 2000/2005/Express, IIS5/6/7, etc,
etc. I don't know of any plans to release that code, but I'll pass on your
question. 

 Suffice it to say that it's not a simple, out-of-the-box solution anyway, and
if we published it you'd still have to continually update it.
Post Reply
Re: Is the source code for the fantastic MSI installer available?
Thu, 7 Sep 2006 18:07:49 +0000
..and one more thing - try to always test install/uninstall in a VPC, not your
real o/s. After not very many installations you'll notice that the uninstall
custom actions will being fired. I spent many hours on the phone with MSFT about
this - with their MSI developers no less - and it's a known bug that is unlikely
to get fixed. Your registry basically gets messed up after x installations of
the same product ID. 

No-one knows the true number, but developers at Telligent who didn't notice this
behaviour during CS 2.0 testing hit that limit during 2.1 testing and all
starting whining to me that the uninstall didn't work any more. 

It's unlikely that customers will see this behaviour of course.
Post Reply
Re: Is the source code for the fantastic MSI installer available?
Mon, 2 Oct 2006 14:08:53 +0000
Thanks for the informative and interesting answers.

I am particularly interested in the application you use to to install and
configure SQL , IIS and create users/groups etc.  I would be much obliged if you
could ask the team members if they would serioulsy consider releasing the code -
it would make a great starting point for all of us struggling developers who
need this kind of functionality in an application installer.

I have only seen these done as well as this in commercial packages.

Thanks for all the effort you put into the response previoulsy.
Post Reply
Re: Is the source code for the fantastic MSI installer available?
Mon, 2 Oct 2006 14:50:06 +0000
I'm sorry, the word is that the source code for the Config Wizard isn't likely
to be released.
Post Reply
about | contact