Monday, January 24, 2011

Fix Squirrel-SQL Install on Windows 7 64-bit

I wanted to evaluate the latest SquirrelSQL client on a Windows 7 64-bit desktop, so I downloaded the latest 3.2.1 version from the Squirrel-SQL SourceForge web site, and attempted to install the JAR file.

Once I had the squirrel-sql-3.2.1-install.jar, I simply tried to execute it in order to install Squirrel-SQL, but I quickly encountered some errors and issues preventing me from installing it.

Solving this particular bug...
So, what is causing this and how to fix this error?  Turns out you need to install the JAR file with administrator privileges.  But, Windows does not give you an easy "run JAR as administrator" or "install JAR as administrator" option from Windows Explorer.  So, here is what you need to do:
  • open up an administrator command prompt
  • navigate to the directory you have the squirrel-sql-3.2.1-install.jar file in
  • execute this command: java -jar squirrel-sql-3.2.1-install.jar
  • you should now step through the install... I installed it to: C:\Program Files\squirrel-sql-3.2.1
  • but,...
  • at the end of the install you may see the following error, which oddly enough does not seem to prevent Squirrel-SQL from working:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.izforge.izpack.panels.ShortcutPanel.isValidated(Unknown Source)
at com.izforge.izpack.installer.IzPanel.panelValidated(Unknown Source)
at com.izforge.izpack.installer.InstallerFrame.navigateNext(Unknown Source)
at com.izforge.izpack.installer.InstallerFrame.navigateNext(Unknown Source)
at com.izforge.izpack.installer.InstallerFrame$NavigationHandler.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Don't you just love such informative messages?!  NOT!

Running SquirrelSQL Now...
That stack-trace aside,at least Squirrel is working enough for me to evaluate it as a universal SQL-client now (I am first trying it with SQL-Server 2008R2; connected just fine).

To run it, you should be able to simple double-click (from Windows Explorer) the file: squirrel-sql.bat (in the C:\Program Files\squirrel-sql-3.2.1 directory it was installed to)

It has some nice features for data-scripting and other things... time to start playing with it.  I hope this helps someone else get past the issues with installing on 64-bit Windows 7 (and, here's hoping a better installer comes out in future releases).

Friday, January 21, 2011

Fix SQL-Server 2008 R2 "network error occurred" SQLNCLI file x64

I was just installing SQL-Server 2008R2 Management Studio (SSMS) Client Tools and SQLNCLI 10.5 on a Windows-7 Professional x64 (64-bit) machine when I ran into a very uninformative, or clearly misleading, error message during the install procedure that stated (something close to this):
Microsoft SQL Server 2008 Setup: The following error has occurred: A network error occurred while attempting to read from the file: [install-device-name--and-root-of-path-here]\x64\setup\x64\sqlncli[1].msi
Since I was installing from an ISO image that I had just used to successfully do a *test* install into a VMware ESXi VM (Windows 2008 Server R2)  prior to the real install on a physical machine, I instantly thought: "what the heck? bad image suddenly?... unlikely... network issues?... unlikely, as I have not had any others."  Something was off.  I wondered if there was an issue with the installer not liking the fact I was trying to install from an ISO that I had "mounted" as a virtual CDROM via UltraISO for this.  So, I used 7-ZIP to explode the ISO into an install directory on my same server, and tried to install directly from this completely unpacked set of files.

The error persisted!  Still getting that "The following error has occurred: A network error occurred while attempting to read from the file... SQLNCLI...".  Hmmm... odd.  And, annoying, as OBVIOUSLY THIS IS/WAS NOT A NETWORKING ERROR as the message describes!  (thank you Microsoft! NOT!).

The cause of the error...
I wondered what was different between my clean test-VM and my server that I was now attempting to install SQL-SERVER 2008 R2 Client Tools and SSMS onto.  Both were 64-Bit OS's and same setup, etc., but one was a clean VM.  This got me thinking...

I had PREVIOUSLY installed JUST the SQLNCLI (SQL-Server Native Client) for SQL 2008 R2 onto my physical system, in order to test application connectivity to a SQL2008R2 database.  So, could that be it!?  YES!  After uninstalling any previously installed SQLNCLI applications, and re-running the SQL-Server installer, amazingly my "network errors" were gone and the installation was fixed!  

Microsoft: GIVE MEANINGFUL ERROR MESSAGES!  All the installer had to do was say that "previous installations of SQLNCLI / native client exist and must be removed before installing"... in fact, the PREREQUISITES-CHECK SHOULD HAVE TESTED FOR THIS if it can cause a total failure to install!  

This may affect SQL-Server Express Edition installs as well.  I was doing a SQL-Server 2008 Enterprise install, but I would bet the installer code is the same... whether standard edition, enterprise edition, express edition, or developer edition 2008 R2.  

I do not know if this only affects x64 (64-bit) installs or x32 (32-bit) as well, but perhaps if you encounter a similar problem, this article may help.  I was able to confirm the error occurs installing on Windows-7 Professsional 64-bit x64, so good luck and get past this quickly.