locked
source code RRS feed

  • Question

  •  

    hi all,

     

    in the future, Will setup project (for install StockTrader redistributable)  be available for download ??

     

    I think, setup project with source code, and all code for stocktrader is very interesenting.

     

    We need all code for we  have a full sample using wCF, WPF, etc...

     

     

    Thanks.

    Thursday, January 22, 2009 9:07 PM

All replies

  • What aspects of setup are you interested in?

     

    I will be perfectly honest in that I do not want to publish the full setup project.  It is complex, currently not partitioned into manageable chunks as it should be, and hence is a bit of a beast to work with right now.  I did use Visual Studio 2005 (and now 2008 which provides some perf advantages); but still the way it works is one massive Setup solution with all projects individually imported; built; etc inside of this solution.  One reason such a beast is that the StockTrader sample itself consists of so many sub-samples; etc and the modular way in which solutions are constructed with shared libraries; sub-component solutions etc.  To give an idea:

     

    1)  There are a total of 14 individual executables in the sample.  This includes:

     

    -1 for StockTrader Smart Client (which I badly want to update including with a SilverLight front end)

    -2 for StockTrader Business Services (done with a Windows self host and a console App self-host to demonstrate; with each sharing all common code except for the .exe project itself).

    -2 for StockTrader Order Processing Service  (done with a Windows self host and a console App self-host to demonstrate; with each sharing all common code except for the .exe project itself).

    -3 for the database loaders (SQL Server, Oracle 11G, DB2 V9.5)

    -2 for the SimpleTestHost ((done with a Windows self host and a console App self-host to demonstrate; with each sharing all common code except for the .exe project itself).

    -2 for the Service_A host in the MoreInterestingTestHarness (done with a Windows self host and a console App self-host to demonstrate; with each sharing all common code except for the .exe project itself).

    -1 for the Capacity Planner Controller

    -1 for the Capacity Planner Agent

     

    2) There are a total of 6 (I think) ASP.NET web apps:

    -ConfigWeb

    -StockTrader Business Services

    -StockTrader ASP.NET Web UI app

    -Service_B hosted service part of MoreInterestingTestHarness solution

    -CompositeWebApp part of MoreInterestingTestHarness solution

    -SimpleWeb part of SimpleTestHarness (the client solution)

     

    3) There are 22 shared libraries for ConfigService (why so many?  I worked very hard, iteratively, to come up with a good partitioning that I thought made sense; ...there is opportunity in future to use more effectively the ILMerge tool to reduce the number of physical assemblies laid down; but quite frankly for partitioning reasons to keep things manageable/modular I still would use separate VS projects for most of this unless anyone disagrees and makes me rethink).

     

    So, setup is a big deal; especially since I have not yet modularized it and this will be a big undertaking to do so (resources, time).

     

    But, setup does some interesting things, since I wanted to do this in a way that was integrated/easy for customers to get going with the whole kit and kaboodle without jumping through hoops:

     

    1)  Database creation including creating logins and users for all the various databases using SQL Management Objects (SMO).

    2)  Using SQL Server XML capabilities to load the databases (and by the way I use SQL Server CLR integration with a C# assembly running within SQL Server to dump master tables to XML files on disk)

    3)  Creation of IIS web apps/virtual directories.  This includes detecting OS and hence IIS version (6 or 7) so the right thing is done for the right OS being installed to.  IIS7 administration via C#/code is SOOO much better than IIS6; but this requires in setup logic to detect OS version; then dynamically load if Vista or Server 2008 an assembly that uses these new IIS 7 features to create the app pools and the IIS Vdirs/apps.

    4)  Logic to sort through the solutions and compiled .exe.configs to fixup connection strings to various exe and web app projects (both compiled .exes and web apps) to reference the correct databases.

    5)  Special logic to sort through certain configuration repositories to automatically fixup connection strings stored their as well as whether the OS-install is Vista or Win Server 2008; in which case tcp/binary endpoints are supported; but cannot be hosted if XP or Win Server 2003 given these older OS's lack this feature (WAS-Hosting).

     

    OK....phew....in a nutshell before I feel comfortable publishing this; I think I would need to modularize properly into discrete CABs, etc....and right now that is a question of resources for me given other items I want to focus on based on customer feedback to date...comments welcome....

     

    -Greg

    Friday, January 23, 2009 1:25 AM
    Moderator
  • oops--and forgot Repository Creation Tool (which I built mostly while in London doing some presentations there so I have fond memories of--London is a fantastic town and I should have put a British flag on the tool to remind me!)....

     

    Anyway, all fondness for most-things-British aside, besides the size of the Setup project aside; perhaps more interesting are some discrete components:

     

    -CLR routine for dumping database tables to XML files on disk

    -The stored procs for loading said-tables with data from XML files during setup (which, by the way, the sources are located in the \[setupdir]\setup\DataLoad directory with sources.

    -The IIS7 VDir and IIS app pool creation routines using new (as of .NET 3.0/Vista/Server 2008) IIS 7 System.Web.Administration namespace/features; which is very cool and as mentioned above, so much better than old IIS6 metabase and hoops necessary to setup/configure such IIS-specific things.

    -Perhaps the SMO routines (now working with SQL 2005 and 2008 in backwards compatible way thanks to SQL Server 2008) that can create databases on remote SQL Machines; create logins/DB user accounts in a way I think programmatically not possible without SMO.....

     

    -Greg

     

    Friday, January 23, 2009 2:57 AM
    Moderator