Archive for July 2010

 
 

Commerce Server 2007 Install

Now we’ve got this Commerce Server 2007 solution in our development environment that the team has been working on for about twenty years. And today, I hear “We’re done, here’s the code.”

And that’s it.

So, disregarding the pipeline management issues, it looks like we have to make Commerce Server 2007 run from scratch and I’m the robot that gets to do it.

So, using my free VMWare Player on my Dell Latitude 6510, I create a new virtual machine and point it to my Windows Server 2K3 Standard Edition install disk. I tell the wizard to give it a 40Gb hard drive, enter the product key and it’s off to the races with the blue Windows Setup screen.

That runs for enough time to go get more coffee. Then it reboots into a semi-GUI Windows install environment: Collecting Information, Dynamic Update, then Preparing Installation. Here it barfed complaining about the product key I entered. I double checked my dyslexia medicine and, yes I am up to date, no typos, no nothing. I entered it again and same problem. Then I entered my Win2K3 Enterprise Key and that seemed to work. Weird.

Then, this is funny, during the “Installing Windows” process is says “Completeing Installation.”  Then it moves to “Finalizing Installation.” Obviously it’s got to complete the installation before it can initialize the finalize installation process. At some point it will have to start adding start menu items and, when it’s done it will have to stop adding start menu items. It probably won’t tell anything about the stop menu items.

The installation complete and the machine reboots and wants me to log in as “Administrator”. With no password, I just click OK.

The VMWare player wants to update itself and it want me to turn up the hardware acceleration on the Display Properties | Settings | Advanced | Troubleshoot all the way to full. No problem but it wants to restart.

Before I restart, I go ahead with the Post-Setup Security Updates.  This reminds me of two things. One, it’s way cool the way the VMWare Player just falls right into your host network. And, two, the default install leaves IE Enhanced Security Mode enabled. In Server 2003 IE Enhanced Seurity is a Windows Component you disable in Add\Remove Programs in Control Panel.

Then I’ve got to install an ActiveX Control to get the Windows Update site to work and I tell it to install the updater and select the Express option and turn on Automatic Updates.

This finds that I need to update to Service Pack 2 so I click Install Updates, accept the terms and click Install.

That takes about forty-five minutes and then wants to restart. So I let it.

When it comes back up, it wants me to Activate Windows so I do. When I check Windows Update again, it wants to install a bunch of more updates so I click Okay, agree to the terms and it says it’s got 89 updates to download and install. Might be a good time for lunch.

With Windows up to speed, I’m going to go ahead rename my computer to MSCS01 foregoing the ugly name that the VMWare Player dreamed up. That takes a reboot.

Then I’ll refer to the MS Commerce Server Quick Start Guide and double check my Windows components. It says I need:

  • Accessories and Utilities
  • Indexing Service
  • Application Server – Including:
    • ASP.Net
    • Network DTC Access
    • IIS – Including:
      • Common Files
      • Documentation (optional)
      • IIS Snap-In
      • IIS Manager
      • WWW Service – Including:
        • Active Server Pages
        • WebDav Publishishing
        • WWW Service

And I’m going to uncheck the IE Enhanced Security Mode and add the SMTP server for good measure. I click Next and I need my Win2K3 installation CD again. The wizard completes and I click Finish.

At this point, my default web site should work so I open IE8 and, after the IE8 Pest bothers me about a tour of IE8, I point it to http://localhost and I get the Under Construction page. Perfect.

I’m also going to need a user account to login to SQL Server with so I’m creating a new user and putting him in the local administrator group,

I insert the SQL Server install disk and it brings up the Install Wizard. I accept the terms and click Next. It installs the prerequisite setup support files. I click Next.

The wazard runs the configuration check which cries about minimum hardware requirements. This is where I check the VMWare Settings and see my VM has only 348Mb RAM.

I have to power down the VM to change it so down it goes. On the way down, it wants to install updates so I let it.

Before restarting it, I edit the VM settings and give it 2Gb RAM. That should do. I click Play Virtual Machine.

When it comes back up, I reinsert the SQL Server install disk and the wizard starts. I click Install Server Components..

I accept the license terms and click Next. It copies the Setup Support files and then I click Next.

Welcom to the Wizard.. Next.

Config Check, all good.. Next.

Enter my product key.. Next.

On Select Components, I check everything and click Advanced. under Documentation.. I deselect the sample dbs and code and Books online and click Next

I opt for the default instance and click Next.

I opt for the domain user account and enter my user created earlier, the password and the computer name as the domain and click Next.

I select Mixed Mode authentication, enter an sa password and click Next.

I opt for the default collation settings and click Next. Now I don’t know how many of you knew this but the CS Install Quick Start guide says:

Commerce Server databases require collation settings that are
not case-sensitive.

I had a Microsoft guy tell me once that you gotta be nuts changing from default collation settings so I don’t. Partly because of what he said and partly because I’ve never felt a need.

I opt for the default Reporting Server options and click Next.

I opt to send nothing to Microsoft and click Next and then Install.

So the SQL Server install runs…

and runs..

and runs…

It’s got this nice little progress interface and it’s rolling through the files but it runs for ever. My boss is saying the the IO from the VMWare Player to DVD drive is known to be slow so you might get a little better performance from a different VM solution. Regardless, I started this install yesterday and hope to finish today.

When it’s done, I got a nice column of green checkmarks on rows of items that all say Setup finished.

I click Next and then Finish.

I reboot the server a couple of times and occasionally it cries for an update.

The boss says the SQL Server configuration requires only TCP\IP so I disable the others in the Configuration Manager’s Client Protocols node. Then on services, I set the SQL Server Browser Service on Automatic and start it. We won’t need the Agent but I start it and stop it all the same just to make sure it works.

Referring back to the Quick Start Guide, it tells me to install .Net 2.0 by running:

c:\Windows\Microsoft.NET\Framework\2.0.50727\aspnet_regiis.exe -i

This runs to problem. Then it tells me to go here and download a hotfix:

http://go.microsoft.com/fwlink/?linkid=63706

This is a CAB file download specificaly for Server 2003 x32 English.  The Quick Start Guide has links to other versions. I copy it onto my server and double-click the KB13393.exe file which extracts the file from the .CAB file where I can double-click it again. It asks for permsission to run and then gives me a license agreement which I accept. It runs for a minute and then tells me it’s been sucessfully installed.

The Quick Start Guide does not tell me what to do with the other .exe files in my .CAB file. So I leave them alone. Also, there’s a couple of other steps to follow for Servefr 2008, Vista and XP that I’m ignoring.

It wants me to create a user for the Commerce Server services. I create the RunTimeUser account as directed.

The Commerce Server install is the base and SP2. I unzip the base install and click setup.exe and then the Install Microsoft Commerce Server 2007 link. The product key is embedded in this install; I click Next, accept the license terms and click Next again.

On the Component Installation page, I’m going to uncheck the Direct Mailer, the Health Monitoring Server and the Volume Shadow Copy Writer Service. I can’t check the Project Creation Wizard because I don’t have Visual Studio installed except the Premier Partner Edition that came with SQL Server. I click Next.

On the Redistributable Prerequisites page, it leave it set to automatically install the MS Document Explorer 2005 from the CAB file I downloaded earlier and click Next and then Install.

The installation take just a minute and you want to cleak the check from the Launch box before clicking Finish.

Then, there’s some ambiguity about what to install next. The Quick Start Guide says install the Business Management Applications and then SP2. The install page calls it the Business User Applications. I click that link accept the license terms, check all the components and click Install. That takes just a second and I click Finish.

Then I doulble-click the SP2 install. I get a welcome screen and I click Next, accept the license terms and Next again.

That opens the Configuration Wizard. I click Next.

I leave the database server and database name alone and allow for Windows Authentication and click Next and Next again and then Finish and then Finish again.

Oddly, that leaves the Upgrade Wizard on the screen.  I click Next and then Next again and then Finish.

Before I proceed, and since I want my site to have a real name other than localhost, I’m going to add a couple of host headers to my hosts file and create a new IIS website for the new application. In my hosts file, I’m going to add:

127.0.0.1       MySite.MyComputer.Local
127.0.0.1       MySite.MyFirm.Com

Then, in IIS, I’m going to right click on Web Sites and select New | Web Site and complete the wizard naming it MySite and mapping the new site to a folder under inetpub\wwwroot named MySite. Then, I’ll go into the site properties to add the second host header. So now, from a browser on the server, I can browse to MySite.MyComputer.Local and land on default.htm in my MySite folder. I do this because I like to leave my default web site intact except for some clever mods to the under construction page. This allows me to troubleshoot my app and IIS separately.

At this point, the Quick Starg Guide says to unpack the site and then configure security, including the certificate and SSL configuration. The site we want to unpack is not the starter site but rather the CSharp. Commerce Server sites are packed into a .pup file so the site we want is CSharp.pup which was copied into:

c:\Prgram Files\Microsoft Commerce Server 2007\Pup Packages

The Quick Start Guide covers this pretty good. Run the site packager by selecting the Commerce Server 2007 | Tools | Site Packager option from the Start | All Programs menu. We want to select Unpack from a Package File and click Next.

Point the packager to the .pup file and dot the Custom Unpack option. In our case, we need to forego the Quick Unpack option because we want to use the custom IIS web site.

We’ll accept the Create a new site option and click Next again. Here, we’ll change the name to MySite and click Next. We’ll leave all the resources in the right side box and click Next again. Since this is the first time through, we’ll add the two new global resources for CS Authentication and Progiles and click Next.

We’ll accept the default connection strings and click Next again. We’ll leave all the applications checked to upack them all and click Next

On the Select IIS Computers, Web Sites and Paths page, we’ll change each application’s web site to MySite and click Next. Here, the wizard will start to run saying it’s Unpacking… and showing you files as they unpack. Then, it will stop and ask you to confirm default settings for the Profiling System resource. I just clicked Next and got a second page of settings and clicked OK this time. It runs some more and then gives you a dialog box where it tells you it’s configured the various connection strings to use Windows authentication. This means we’ll have some additional security steps to provide the right permissions but that’s all covered in the Quick Start guide. I just Clicked OK.

Finally, the unpacking is complete and you get to see the databases and site it created. Conveniently, it drops the Pup.log right in your C:\ root folder. I clicked Finish.

At this point, I would expect to see some kind of CSharp site at my designated local host header htt://MySite.MyComputer.Local but I don’t. What I do see is the Default.htm that I added to the web site’s home directory that just says “Welcome to MySite.MyComputer.Local.”  The Quick Start guide continues with some security settings so let’s look at those before we dig any deeper.

First, we add our run time user and grant Write permission to:

\inetpub\wwwroot\MySite\CatalogWebService\CatalogAuthorizationStore.xml

Then, we do the same for:

\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

And:

C:\WINDOWS\Temp

Then we run the Authorization Manager snap-in, azman.msc, to edit web service .xml files. We right click on the root node and select Open Authorization Store. Then browsing out to the web site folders and opening the *AuthorizationStore.xml files. Once open in the Authorization Manager, we traverse down the tree to the *Administrator role and add the run time user to the role.

Next, we grant database permissions to our run time user and, since we’re on Server 2003, we’ll have to grant database permissions to the ASP.Net process. This means going into SQL Server Management Studio and moving down the database tree to the Security node, right-clicking on Logins and selecting New Login.

We add the run time user and then, on the User Mapping tab, we map it to database user and add roles as follows:

<Server>_Admin Database:          admin_reader_role
<Server>_CatalogScratch Database: db_datareader
                                  db_datawriter
                                  db_ddladmin
MySite_marketing Database:        db_ddladmin
                                  mktg_MarketingService_role
                                  mktg_promoCodeGenerator_role
                                  mktg_runtime_role
                                  mktg_staging_role
MySite_MarketingLists             db_datareader
                                  db_owner

MySite_ProductCatalog             ctlg_CatalogReaderRole
                                  ctlg_CatalogWriterRole
                                  db_datareader
                                  db_datawriter
                                  db_ddladmin
                                  db_securityadmin
                                  Inventory_ReaderRole
                                  Inventory_RuntimeRole
                                  Inventory_WriterRole
MySite_Profiles                   Profile_Reader
                                  Profile_Runtime
                                  Profile_Schema_Manager
                                  Profile_Schema_Reader
MySite_TransactionConfig          Orders_Management
                                  Orders_Runtime
MySite_Transactions               Orders_Management
                                  Orders_Runtime

Next, we create and install a temporary SSL certificate.  This requires downloading the IIS 6 Resource Kit from:

http://go.microsoft.com/fwlink/?linkid=59276

Install it and then run the SelfSSL program. This install takes just a second and then it’s Start | Programs | IIS Resources | SelfSSL and you get a little command window. You’ll need the Site ID. Lucky for us, our new best friend, Scott, explains here that you can find the Site ID in the web site property’s log file folder name. Also, since nothing ever gets done in seven days, I’m running the certificate out to 700 days. So my command line looks like this:

C:\Program Files\IIS Resources\SelfSSL>selfssl.exe /T
/N:CN=MyComputer /K:1024 /V:700 /S:40485460 /P:443

The command returns a success statement.

Finally, we grant permissions to the IIS worker process groups. This means we go into IIS and create a new application pool and assign it the run time user ID and enter the password. Then we add our run time user to the IIS_WPG group in Computer Management. Then, for each of our applications under our web site in IIS, we have to select our new application pool on the Virtual Directory tab and, when we’re done, run an IISReset.

 

 

 

 

 

 

Debugging Web Parts

So we have a to do list that includes looking at Kerberos for CRM and SharePoint v4 as well as another that includes getting the BDC ADF File Builder to run.

But for now, we’ve had a new project dropped on us that includes reworking a web part project that never really got finished. It’s a WSS 3.0 solution so let’s see what we can do with it.

First, I have the solution file: MyProject.sln and MyProject.sou.

In Visual Studio 2008, I select Open from the File menu and select Project\Solution. In the Open Project dialog box, I navigate out to my  project folder and select MyProject.sln.

The project opens in the solution explorer. Now we have our friend, Carsten’s WSPBuilder installed in the VS environment so, when I right-click on the project, I get a WSPBuilder | Deploy option. That makes the machine run and I get a little text in the output window that ends with Done.

Now, since I’m working directly on my SharePoint server and this web part has already been deployed and is visible on a team site, I can pretty much hack it up and redepoy it and my hack will appear on the screen.

For example, I have a MyWebPartToolPane.cs file that’s got code that looks like this: 

namespace CmsFtpPublishing32bit.WebPartCode
{
    public class MyWebPart : System.Web.UI.WebControls.WebParts.EditorPart
    {

In here, we’re creating a bunch of controls and structuring them in the tool pane with alot of these:

 
 

Controls.Add(new LiteralControl("<br/>"));
Controls.Add(new LiteralControl("<div class=\"UserSectionTitle\">These Settings</div>"));
Controls.Add(new LiteralControl("These Settings<br/>"));
Controls.Add(TheseSettings);
Controls.Add(new LiteralControl("<br/><br/><div class=\"UserDottedLine\"></div>"));

Here is where we can add “Hello World” and see it in our tool pane. First, we have to do a WSPBuilder | Deploy again. Then browse to the page with the web part and open the tool pane.

Next we’ll attach the debugger to it and break into the code at runtime. Event though it was written in 2006, our new best friend, George, outlines, in this post, the process of attaching the VS debugger to your w3wp.exe process to hit your breakpoints.

hth

-robot