Monday, February 20, 2012

Overcoming MSDE Setup Problems

Here is my experience with installing MSDE.

I'm leaning C# and ASP.NET at the same time using the book "Microsoft ASP.NET Programming with Microsoft Visual C# .NET Step by Step". In Appendix C, P 577, it says to locate setup.exe under ��Microsoft Visual Studio .NET\Setup\MSDE and "run setup.exe to install MSDE."

This was my first mistake, because there are more recent versions available with security patches (for the slammer virus). I have been unable to successfully update the old version. The install program for MSDE has got to be a hackers delight because only a hacker can make it work. I decided to uninstall the old version of MSDE 2000 and install the latest download from the MSDN website. The new version would get most of the files installed and then rollback the install, removing all the files. When I tried to reinstall the old version, it did the same thing. At least the new version requires a password parameter for the sa user. The bad news is that the new password is ignored. Since I already installed the first version with a blank sa password by running setup.exe with no parameters the password will remain blank until I change it using the user friendly osql command line utility. More about osql later��

Here is how I solved the rollback problem:

I first (after many hours trying to modify the registry to clean up the mess Windows uninstaller left there) used the command line switch /L*V <your logfile name> to get a verbose log file. I noticed a property listed called "Disablerollback" this was set to 0. So, I ran setup on the command line as below (all one line):

>setup DisableRollback=1 /L*V "C:\Program Files\Microsoft Visual Studio .NET\Setup\MSDE\setupbat.log" SAPWD="ignored password"

The setup still failed, but its tracks were preserved for XP to complain about on system restart.
I then restarted the system and logged in. XP threw an error dialog box with the message "Your server installation is either corrupt or has been tampered with (unknown package ID)��" I clicked OK and waited a few extra minutes for XP to finish logging me in.

After logging in, I closed the Service Manger from the taskbar notification area. I then deleted the folders 80, and MSSQL (name of default instance) from the target install directory. Finally, I ran setup.exe again as shown:

>setup /L*V "C:\Program Files\Microsoft Visual Studio .NET\Setup\MSDE\setupgood.log" SAPWD="ignored password"

This time, after restarting, my old MSDE worked. This approach seems to only work with the first old version of MSDE that was shipped with Visual Studio .NET. I still have yet to figure out how to upgrade and get MSDE to work again.

Once you get MSDE to work, here are some tips on how to administer it using the osql command tool.
To change the sa password do the following (use null for a blank password):
>osql -U sa
Password:
1> sp-password @.old=null, @.new='newpassword', @.loginame='sa'
2> go
Password has been changed
3> quit

On page 113 of the authors' first attempt with the book "Microsoft ASP.NET Programming��", the hacks wrote:
Set up the SQL Server session state database by running the InstallSQLState.sql batch (located in ��) against the SQL Server you plan to use. (For more information about running batch statements, check with your database administrator or the SQL Server Books Online.)

Here is how to do it with osql:

> osql -S MSSQLSERVER -U sa -i InstallSQLState.sql

For less characters than it took to write the last parenthetical sentence, they could have just given the same example I supplied here.

If you want a graphical interface to administer you MSDE server, try downloading the small package for "Microsoft SQL Web Data Administrator" from Microsoft's website. This even comes with a modern installer. Here are some tips on how to connect to your locally installed MSDE using this utility:

The main dialog just requires that you click the start button. A login page comes up. To log in as sa, do the following:

? Click the "SQL Login" radio button.
? Under "Please enter a SQL Server name:" fill in the following text boxes:
? Username: sa
? Password: [your password | leave blank if no password is set]
? Server: (local)

This should get you to the server tools page. Click "Security", then Logins. Now, on the Logins page, you can add new users. If you install MSDE for mixed mode, you can add "Windows Integrated" user accounts. This best since you won't have to put passwords in your code to allow database access to these users. To add a user, click on "Create New Login". Set Authentication Method to "Windows Integrated" in the combo box. For Login Name you need to use the form <computername>\<username> . For example, "MSSQLServer\Dan".

If you did like I did, and installed MSDE in SQL login mode only, you can do the following registry hack to change it to mixed authentication mode:

1. Locate either of the following subkeys (depending on whether you installed MSDE as the default MSDE instance or as a named instance:
HKEY_LOCAL_MACHINE\Software\Microsoft\MSSqlserver\MSSqlServer

-or-

HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\<Instance Name>\MSSQLServer\

2. In the right-pane, double-click the LoginMode subkey.

3. In the DWORD Editor dialog box, set the value of this subkey to 1. Make sure that the Hex option is selected, and then click OK.

4. Restart the MSSQLSERVER and the SQLSERVERAgent services for this change to take effect.

Try this link for more details:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322336Correction to this step:
3. In the DWORD Editor dialog box, set the value of this subkey to 1.

For Mixed mode, the subkey should be 0 or 2.
For Windows Integrated only, the subkey should be 1.|||First a syntax typo correction:
change sp-password to sp_password. So the section on changing the sa password should read:

To change the sa password do the following (use null for a blank password):
>osql -U sa
Password:
1> sp_password @.old=null, @.new='newpassword', @.loginame='sa'
2> go
Password has been changed
3> quit

Notes on upgrading to SP3a.

Prerequisites:
1) You have to know the sa password for this solution to work.
2) Parameters in example assume you are in mixed authentication mode.
3) You should stop SNMP services.

Command line setup:
At the command line, type the following or paste this in a *.bat file and run the bat file:

>setup /upgradesp sqlrun DISABLENETWORKPROTOCOLS=1 /L*V C:\sql2ksp3\MSDE\setupbat.log SAPWD=yourSApassword

The "DISABLENETWORKPROTOCOLS=1" is optional. The default when installing a new instance of SP3a is to disable network protocol support. I don't know what the option does when you are simply upgrading. You can run svrnetcn.exe from the Tools\Binn directory to enable network protocols later. I found this tip on another forum: http://www.mcse.ms/message290056.html

You need to check the log file (setupbat.log in this case) to make sure the upgrade finished successfully. It should say, "Configuration completed successfully."

I tried running this without the SAPWD parameter since this was left off the example under section 3.7.4 of the sp3readme.htm file. The upgrade failed. If the sa password is still blank it says to use the BLANKSAPWD=1 parameter. Requiring the password makes sense because the installer needs to access your database files in order to upgrade. The "Northwind" sample database was deleted during the upgrade.|||Ok I've got as far as this line:

>setup /L*V "C:\Program Files\Microsoft Visual Studio .NET\Setup\MSDE\setupgood.log" SAPWD="ignored password"

When I restarted my computer I got the "Your server installation is either corrupt or has been tampered with..." message and the MSDE icon was in my System Tray (with a red square in a white circle). So I closed this program and entered the above code in cmd line. However a dialog box appeared and said it could not locate the above file. I tried looking in the directory specified above and I couldn't find the file or the folders "80" and "MSSQL" either.|||Hello!

I got the same problem when installing MSDE at the end the performance counters install fails, beauce it can not update the reg key (as mentioned in my therad).

To uninstall MSDE see 320873 (german). Tipp you need only the msizap.exe prog. Evt. you dont must donload the whole SDK.
But uninstalling and new installation doesnt help either.

There is still the problem with the performance counters, and there is no solution yet (I really looked the www for the last days and did not found any solution.

lg ifoko|||You need to open a cmd window and run the command from the path where "setup" for MSDE lives. "MSSQL" may be named something else if you used INSTANCE= <name> in your first install. The default install target path is "C:\Program Files\Microsoft SQL Server\". This is where you should find the "80" and "MSSQL" folder to delete. Use a search to locate the "80" folder if you have to.

The other path (C:\Program Files\Microsoft Visual Studio .NET\Setup\MSDE\) is where my Microsoft Visual Studio .NET 2002 is installed. The buggy version of MSDE came with my .NET software.|||To VilleValo:

On second thought, I don't see how you could get "setup DisableRollback=1 /L*V "C:\Program Files\Microsoft Visual Studio .NET\Setup\MSDE\setupbat.log" SAPWD=IgnoredPassword" to work, and you can't get "setup /L*V "C:\Program Files\Microsoft Visual Studio .NET\Setup\MSDE\setupgood.log" SAPWD=IgnoredPassword" to work. I created these commands in .bat files and ran the .bat files. This way, if I needed to make any further modifications, I could edit the .bat files. It also leaves a record of what I did.|||thx dran001 for help.

But my problem is that I got no previous "working" installation of MSDE.

The problem is that I cant update the Perflib\009 key. Either the registry is damaged, or some service lock the key.
And I still no found any help with issue.

lg|||I think my problem was caused by the setup.ini file that came shipped with .NET. This file contains:
[Options]
INSTANCENAME=VSdotNET

So when I did the first install, my instance of MSDE was named VSdotNET. When I tried to install SP3a version after the uninstall, I didn't use the ini file. I ran this install from a different folder. The Windows uninstall must have left references to VSdotNET in the registry which left me unable to install another instance since I had uninstalled the first instance. The default instance is just MSSQL. If you supply an INSTANCENAME option, the instance is named MSSQL$<instancename> or MSSQL$VSdotNET for example.

I think the PerfMon is loaded after the error so that the MSDE installer can draw a nice reverse progress bar as the install is being rolled back. Here is a clip of my log file were I think the real error is:

MSI (s) (7C:DC) [15:59:17:020]: QueryPathOfRegTypeLib returned -2147319779 in local context.Path is ''
MSI (s) (7C:DC) [15:59:17:020]: CMsiServices::ProcessTypeLibrary runs in local context, not impersonated.
MSI (s) (7C:DC) [15:59:17:120]: ProcessTypeLibraryCore returns: 0. (0 means OK)
MSI (s) (7C:DC) [15:59:17:120]: Executing op: TypeLibraryRegister(,,FilePath=C:\Program Files\Microsoft SQL Server\80\Tools\Binn\dtspkg.DLL,LibID={10010001-EB1C-11CF-AE6E-00AA004A34D5},Version=-2147483648,,Language=0,,BinaryType=0,IgnoreRegistrationFailure=0)
MSI (s) (7C:DC) [15:59:17:120]: QueryPathOfRegTypeLib returned -2147319779 in local context.Path is ''
MSI (s) (7C:DC) [15:59:17:120]: CMsiServices::ProcessTypeLibrary runs in local context, not impersonated.
MSI (s) (7C:DC) [15:59:17:181]: ProcessTypeLibraryCore returns: 0. (0 means OK)
MSI (s) (7C:DC) [15:59:17:181]: Executing op: TypeLibraryRegister(,,FilePath=C:\Program Files\Microsoft SQL Server\80\Tools\Binn\dtspump.DLL,LibID={10010200-740B-11D0-AE7B-00AA004A34D5},Version=-2147483648,,Language=0,,BinaryType=0,IgnoreRegistrationFailure=0)
MSI (s) (7C:DC) [15:59:17:181]: QueryPathOfRegTypeLib returned -2147319779 in local context.Path is ''
MSI (s) (7C:DC) [15:59:17:181]: CMsiServices::ProcessTypeLibrary runs in local context, not impersonated.
MSI (s) (7C:DC) [15:59:17:211]: ProcessTypeLibraryCore returns: 0. (0 means OK)
MSI (s) (7C:DC) [15:59:17:211]: Executing op: TypeLibraryRegister(,,FilePath=C:\WINDOWS\system32\atl.dll,LibID={44EC0535-400F-11D0-9DCD-00A0C90391D3},Version=-2147483648,,Language=0,,BinaryType=0,IgnoreRegistrationFailure=1)
MSI (s) (7C:DC) [15:59:17:221]: QueryPathOfRegTypeLib returned -2147319779 in local context.Path is ''
MSI (s) (7C:DC) [15:59:17:221]: CMsiServices::ProcessTypeLibrary runs in local context, not impersonated.
MSI (s) (7C:DC) [15:59:17:261]: ProcessTypeLibraryCore returns: 0. (0 means OK)
MSI (s) (7C:DC) [15:59:17:261]: Executing op: ActionStart(Name=InstallServices,Description=Installing new services,Template=Service: [2])
MSI (s) (7C:DC) [15:59:17:261]: Executing op: ProgressTotal(Total=2,Type=1,ByteEquivalent=1300000)
MSI (s) (7C:DC) [15:59:17:261]: Executing op: ServiceInstall(Name=SQLAgent$VSdotNET,DisplayName=SQLAgent$VSdotNET,ImagePath=C:\Program Files\Microsoft SQL Server\MSSQL$VSdotNET\Binn\sqlagent.EXE -i VSdotNET,ServiceType=16,StartType=3,ErrorControl=1,,Dependencies=MSSQL$VSdotNET
MSI (s) (7C:DC) [15:59:17:871]: Executing op: ServiceInstall(Name=MSSQL$VSdotNET,DisplayName=MSSQL$VSdotNET,ImagePath=C:\Program Files\Microsoft SQL Server\MSSQL$VSdotNET\Binn\sqlservr.exe -sVSdotNET,ServiceType=16,StartType=2,ErrorControl=1,,,,,,)
MSI (s) (7C:DC) [15:59:18:072]: Executing op: ActionStart(Name=InstallPerfMon.2D02443E_7002_4C0B_ABC9_EAB2C064397B,,)
MSI (s) (7C:DC) [15:59:18:082]: Executing op: CustomActionSchedule(Action=InstallPerfMon.2D02443E_7002_4C0B_ABC9_EAB2C064397B,ActionType=1025,Source=BinaryData,Target=InstallPerfMon,)
MSI (s) (7C:48) [15:59:18:152]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI8F.tmp, Entrypoint: InstallPerfMon

No comments:

Post a Comment