SQL 2008 Express with Adv. Services/Problem with SQL PlugIn

Interested in developing new plug-ins? Got one to share? Post here!
ohali
Posts: 59
Joined: Mon Jun 08, 2009 6:41 am

SQL 2008 Express with Adv. Services/Problem with SQL PlugIn

Postby ohali » Mon Jun 08, 2009 7:32 am

I'd like to install SQL 2008 Express Edition (SP1) with Advanced Services during the setup of my application. As there is no such Setup from MicroSoft (at least none that includes SP1 and the Advanced Services), I've created my own. If anyone is interested, the steps to reproduce this are:

1. Load the setup for SQL2008EE with Advanced Services from Microsoft webpage.
2. Extract all files to a temporary Folder (using 7zip)
3. Make a backup copy the file mediainfo.xml in this folder
4. Load the setup for SQL2008EE SP1 (without Advanced Services)
5. Start the setup loaded in step 3, but do not continue when the welcome screen appears.
6. The files in the setup are being extracted to a temporary folder in your boot drive. The folder name is a GUID.
7. Locate this folder and copy all files over the existing files in the temporary folder created in step 2.
8. Restore the mediainfo.xml from the backup created in step 3

This setup works fine and installs SQL-Server 2008 Express Edition SP1 with Advanced Services. The following commandline for Setup.exe installs SQL-Server (including Fulltext and Replication), ReportingServices, Managementstudio and Business Intelligence Development Studio. TCP/IP-Protocol is also enabled:

/Q /ACTION=INSTALL /SECURITYMODE=SQL /SAPWD=$SQLPASSWORD$ /INSTANCENAME=$INSTANCENAME$ /FEATURES=SQL,RS,TOOLS /SQLSVCACCOUNT="NT AUTHORITY\\NETWORK SERVICE" /RSSVCACCOUNT="NT AUTHORITY\\NETWORK SERVICE" /SQLSYSADMINACCOUNTS="$SQL_COMPUTER_NAME$\\$SQL_USER_NAME$" /TCPENABLED=1

(Of course you have to provide values for the variables $SQLPASSWORD$, $INSTANCENAME$, $SQL_COMPUTER_NAME$, $SQL_USER_NAME$)

The description of the parameters can be found here:
ttp://msdn.microsoft.com/de-de/library/ms144259.aspx#Accounts

The setup of this version of SQL-Server requires PowerShell 1.0 as a pre-requisite, so I've written separate scripts to check/install it. I can provide these scripts if you are interested.

Until now everything worked as expected, so I continued with the following:

9. Compress the content of this folder to expressx.7zip
10. Replace the original expressx.7zip in Plug-Ins\\MS SQL Express

Then I changed the command line of the SQL Server Express PlugIn manually to /SECURITYMODE=SQL /SAPWD=$SQLPASSWORD$ /INSTANCENAME=$INSTANCENAME$ /FEATURES=SQL,RS,TOOLS /SQLSVCACCOUNT="NT AUTHORITY\\NETWORK SERVICE" /RSSVCACCOUNT="NT AUTHORITY\\NETWORK SERVICE" /SQLSYSADMINACCOUNTS="$SQL_COMPUTER_NAME$\\$SQL_USER_NAME$"

Result: Setup of SQL-Server failed :cry:

Then I've put the expressx.7zip in a file bag, extraced it during the runtime of the setup and installed SQL-Server using the Run Program command with the above mentioned command line for setup. Everything worked perfect.

The only disadvantage of this approach is, that I get no progress messages from the SQL-Server setup. The setup really takes some time, so I expect some of my users will quit setup, because it seems to "hang".

My question is: what does the Install SQL Express PlugIn do internally? Why does the setup fail with this new expressx.7zip. What commands does it add to the command line you can see if you doubleclick that command in MSIcode view?

Or: how can I run the setup and still get the PROGRESSTEXT displayed?

Thanks in advance for any help!

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jun 08, 2009 7:46 am

That's some great work - good job :D

For a version of the SQL 2008 install script that does nothing via plug-ins but everything through the MSIcode script, look at the x64 version of the runtime. This will help you eliminate any black-boxes at installation time.

As for obtaining accurate progress text/feedback - such is not possible with the SQL installer, because the SQL installer cannot run as a stand-alone MSI file - and must always be invoked via the EXE file (akin to an InstallAware setup). Therefore, that is one thing that cannot be addressed within the current constraints of the native SQL install itself.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

ohali
Posts: 59
Joined: Mon Jun 08, 2009 6:41 am

Postby ohali » Mon Jun 08, 2009 10:13 am

Thanks for the quick answer. If I got it right, there is no need to change my attempt back to the "Install SQL Express"-PlugIn, because it also does not show the progress to the user. My attempt looks pretty much like the sql 2008 x64 script, so it should be ok.

Because I am a little bit concerned about my users aborting setup during the long period of the SQL setup, I have two more questions:

My first thought was to open a minimized console window where the progress is being displayed during the setup. In that case the impatient user can open that window and has something to look at. So I've changed the "Run Program" command to "Run Program As". But this command (same parameters as the Run command, additionally set the working directory to the location of the program), returns with an error "-11". I've found no explanation of these error codes, but I cannot imagine what I might have done wrong. Perhaps you can help in that case.

Secondly ... I can tell the setup to send some progress information to the console (using /INDICATEPROGRESS). Is there no way to capture the output to the console window and get it into PROGRESSTEXT? This would be a great enhancement.

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Mon Jun 08, 2009 2:41 pm

That's a pretty good feature suggestion!

Error -11 is a "generic unknown create process error".
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

syadav
Posts: 1
Joined: Fri Jan 28, 2011 12:50 pm

Re: SQL 2008 Express with Adv. Services/Problem with SQL Plu

Postby syadav » Fri Jan 28, 2011 1:28 pm

hey ohali could you pass on the scripts to install powershell

ohali
Posts: 59
Joined: Mon Jun 08, 2009 6:41 am

Re: SQL 2008 Express with Adv. Services/Problem with SQL Plu

Postby ohali » Mon Jan 31, 2011 5:06 am

Sure.
Script 1: checkpws:
~InstallAware Clipboard Data~
~Comment~
~{60D449FD-585D-4F63-9F51-4E5A1C2A68DD}~
~~
~End~
~{C7EC8E01-1232-4644-81F9-AC26B35F3C40}~
~Set Variable~
~{ABED86DC-7290-4AA3-8C21-0E673068AA5A}~
~PRELIST$MYAH$MYAH$FALSE~
~$PRELIST$$NEWLINE$Microsoft PowerShell 1.0~
~Set Variable~
~{5870C5A3-D4F2-49BC-84CA-D502D58E46D5}~
~PREREQ~
~TRUE~
~End~
~{78E104E1-C2A1-4DB8-B0F4-DD955A0B3E79}~
~End~
~{11105352-D38B-4BAB-ADA0-1DBA83FA6010}~
~Terminate Install~
~{D9454BBF-F7C2-47F7-9EA0-D66E1802447D}~
~MessageBox~
~{DF23D968-78DE-4388-815C-1272171C873A}~
~$TITLE$ Setup~
~$TITLE$ requires at least Service Pack 2 or later. Please upgrade your operating system and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.~
~3~
~1~
~~
~If~
~{B2CACEF1-DD75-4BC6-AC3A-2907B128A81F}~
~ISVISTA~
~0~
~FALSE~
~FALSE~
~Get System Settings~
~{319709EC-BF1E-4AEA-AE6A-3C87D27CAB4C}~
~ISVISTA~
~69~
~If~
~{0949C77F-9270-4174-8009-E669C60756AD}~
~ISSP2~
~0~
~FALSE~
~FALSE~
~Get System Settings~
~{44308FE1-66DD-4008-B770-8E5E891A7C59}~
~ISSP2~
~28~
~Comment~
~{C445D042-D0B8-45D8-847B-D5CB61DD20EB}~
~PowerShell 1.0 has stringent operating system and service pack requirements~
~Set Variable~
~{016215DC-FE09-4B73-A83E-C6EB463B0E21}~
~PWSHELL$MYAH$MYAH$FALSE~
~FALSE~
~MessageBox~
~{C58C008C-515F-47B6-BD90-AD694D57C3C5}~
~Powershell~
~PowerShell ist nicht installiert~
~2~
~1~
~~
~Else~
~{A4BEBA0B-0CA9-4F5C-BBC3-8CF1D179772B}~
~MessageBox~
~{92958FB5-EEC0-44FD-B998-FE5755CB56CF}~
~Powershell~
~PowerShell ist installiert~
~0~
~1~
~~
~Set Variable~
~{1DCD5AA3-0393-48E9-BA09-79E3C789ACA5}~
~PWSHELL$MYAH$MYAH$FALSE~
~TRUE~
~If~
~{D814C9C4-DD03-448D-966F-4F4A573692A9}~
~PWSREG~
~0~
~1~
~FALSE~
~Read Registry~
~{EB101AF0-02BB-4C39-9311-7D008317AE6C}~
~PWSREG~
~2~
~SOFTWARE\Microsoft\PowerShell\1~
~Install~
~Set Variable~
~{D37C426E-6098-4643-81D0-B11CA658AB11}~
~PWSREG$MYAH$MYAH$FALSE~
~0~

ohali
Posts: 59
Joined: Mon Jun 08, 2009 6:41 am

Re: SQL 2008 Express with Adv. Services/Problem with SQL Plu

Postby ohali » Mon Jan 31, 2011 5:11 am

Script 2 SetupPws:

As there are a lot of different installers for different operating systems you'll have to download all of them from MSDN and put them in the appropriate filebag. It should be straightforward to see which file goes into which 7zip. Put all of the 7zips to a new folder pwsbin below the folder runtimes of IA.

~InstallAware Clipboard Data~
~End~
~{BB9DF11D-A1D2-4BCD-847C-FD4B47AEDD38}~
~Call DLL Function~
~{A81D76F0-1164-4F5A-8DB3-4907F84C81C8}~
~kernel32.dll,RemoveDirectoryA,bool,,"pointer to string",$PWS_BOOTPATH$\pwsbin,$~
~mIDEFunc.dll\mEXEFunc.dll~
~Delete Files Recursive~
~{06FCEBEE-A932-499A-B3D2-BB02CD59B955}~
~$PWS_BOOTPATH$\pwsbin\*.*~
~End~
~{5BCE93EF-C439-4905-B885-FB3C4819F1F7}~
~End~
~{09D4F7E7-F290-4DEA-A598-F5CA1A0EA590}~
~End~
~{4E8B8D75-5F32-432E-9BD5-3C5A26B4CAAF}~
~Set Variable~
~{15704FAF-FBBB-4B7B-B93B-19710075891E}~
~PWS_RESULT$MYAH$MYAH$FALSE~
~0~
~If~
~{7B4A8D35-C9FC-4BB4-89FB-EA8A4B719DB1}~
~PWSREG~
~0~
~1~
~FALSE~
~Read Registry~
~{91E2F683-BC38-4237-A7EE-E26FA83DD461}~
~PWSREG~
~2~
~SOFTWARE\Microsoft\PowerShell\1~
~Install~
~If~
~{C191D35E-C300-45C3-8A16-DB9E2A449669}~
~PWS_RESULT~
~0~
~3010~
~TRUE~
~If~
~{113F6BDD-4A8C-4B63-9F49-BE93FE6E6814}~
~PWS_RESULT~
~0~
~0~
~TRUE~
~Set Variable~
~{49305123-B04D-445A-89FB-825222BAF190}~
~PROGRESSMODE~
~~
~End~
~{0486247D-DAAD-4C39-85F5-32543EF51686}~
~Run Program~
~{693EEDD8-E9D5-4A18-96B1-346791CB536C}~
~"$PWS_BOOTPATH$\pwsbin\WindowsServer2003-KB926139-v2-x86-ENU.exe"~
~TRUE~
~/quiet~
~TRUE~
~PWS_RESULT~
~End~
~{AD690306-B114-40C8-8143-600AC8B35879}~
~Terminate Install~
~{C5BFCDB4-B614-4707-B470-D2211620257F}~
~MessageBox~
~{19187AB6-9AF7-46D2-B6EF-B6000D038B28}~
~$TITLE$ Setup~
~Unable to extract temporary files for Microsoft PowerShell 1.0 installation. $NET3SP2_EXTRACT$$NEWLINE$$NEWLINE$Please free up some space on your boot drive and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.~
~3~
~1~
~~
~If~
~{5DF4A42E-29EB-4B15-AE68-27E8145E724A}~
~PWS_EXTRACT~
~0~
~SUCCESS~
~TRUE~
~Extract 7Zip Archive~
~{BD0A7044-51D9-43D0-AAE6-91C3DDFDEF58}~
~$PWS_FILEBAG$\pwshellSrv2003.7zip~
~$PWS_BOOTPATH$\pwsbin~
~PWS_EXTRACT~
~~
~TRUE~
~TRUE~
~Else~
~{82E821E5-0CE4-4DCA-8116-A7CB53BBECD5}~
~End~
~{6A7DA681-9820-4FDD-AD4A-39FB3A45C499}~
~End~
~{839CFA18-40E6-4CAD-A5AB-8CC4632284E8}~
~Run Program~
~{07C2FBCD-9665-447D-8118-DC96BB737CC7}~
~wusa.exe~
~TRUE~
~"$PWS_BOOTPATH$\pwsbin\Windows6.0-KB928439-x64.msu" /quiet~
~TRUE~
~PWS_RESULT~
~End~
~{808BD2AA-A546-493E-A664-44DF781996F2}~
~Terminate Install~
~{D8030CD8-6896-411D-8FD4-6521BB49CABE}~
~MessageBox~
~{CD30289B-8291-4A14-90B9-8591B92B36DD}~
~$TITLE$ Setup~
~Unable to extract temporary files for Microsoft PowerShell 1.0 installation. $NET3SP2_EXTRACT$$NEWLINE$$NEWLINE$Please free up some space on your boot drive and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.~
~3~
~1~
~~
~If~
~{AC976A96-A33A-49F0-B802-EDBA66D2EF00}~
~PWS_EXTRACT~
~0~
~SUCCESS~
~TRUE~
~Extract 7Zip Archive~
~{20339828-4F5E-409A-B992-606C2F773791}~
~$PWS_FILEBAG$\pwshellVs64.7zip~
~$PWS_BOOTPATH$\pwsbin~
~PWS_EXTRACT~
~~
~TRUE~
~TRUE~
~Else~
~{796E9D0F-B233-4059-B4C2-6A89653D7371}~
~Run Program~
~{D13183F9-90AC-41D0-BFFE-80D1971716C3}~
~wusa.exe~
~TRUE~
~"$PWS_BOOTPATH$\pwsbin\Windows6.0-KB928439-x86.msu" /quiet~
~TRUE~
~PWS_RESULT~
~End~
~{A4F64F90-4AA9-4B6B-9E67-101F6640A2F2}~
~Terminate Install~
~{B255AAE5-960B-46B5-9BA3-28676E137BFA}~
~MessageBox~
~{A54567C7-7ADF-415E-A3C2-D9647CFD6E71}~
~$TITLE$ Setup~
~Unable to extract temporary files for Microsoft PowerShell 1.0 installation. $NET3SP2_EXTRACT$$NEWLINE$$NEWLINE$Please free up some space on your boot drive and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.~
~3~
~1~
~~
~If~
~{EEFC27D2-845F-423F-A835-FC719BD35977}~
~PWS_EXTRACT~
~0~
~SUCCESS~
~TRUE~
~Extract 7Zip Archive~
~{AEB15601-6B79-40DB-8CF9-CBACBEDAA472}~
~$PWS_FILEBAG$\pwshellVs.7zip~
~$PWS_BOOTPATH$\pwsbin~
~PWS_EXTRACT~
~~
~TRUE~
~TRUE~
~If~
~{4B4BD4ED-12BB-432C-B119-65F12ED8E67E}~
~IS64~
~0~
~FALSE~
~FALSE~
~Get System Settings~
~{D7AEEBD3-5BF0-40A8-88EF-1396D0814AFF}~
~IS64~
~65~
~Else~
~{3A336095-6ED0-4A12-915F-2D70D9BDB319}~
~MessageBox~
~{1CB6BA57-AE67-4951-8C1E-ABFFB7CE6A0E}~
~PowerShell Setup~
~"$PWS_BOOTPATH$\pwsbin\WindowsXP-KB926140-v5-x86-DEU.exe"$NEWLINE$$NEWLINE$$PWS_RESULT$~
~0~
~1~
~~
~Run Program~
~{A5DA8EA0-1D22-452F-B8C1-4AF5059800EC}~
~"$PWS_BOOTPATH$\pwsbin\WindowsXP-KB926139-v2-x86-ENU.exe"~
~TRUE~
~/quiet~
~TRUE~
~PWS_RESULT~
~End~
~{1BD575E8-06BC-49E1-B0CF-C7F8294C9904}~
~Terminate Install~
~{6703ACAB-019E-4E34-AE4D-5EA156C5962E}~
~MessageBox~
~{01D8321E-C02F-45D1-A626-28BF298BB53D}~
~$TITLE$ Setup~
~Unable to extract temporary files for Microsoft PowerShell 1.0 installation. $NET3SP2_EXTRACT$$NEWLINE$$NEWLINE$Please free up some space on your boot drive and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.~
~3~
~1~
~~
~If~
~{F595390E-8137-4006-A865-7DEBBFABA481}~
~PWS_EXTRACT~
~0~
~SUCCESS~
~TRUE~
~MessageBox~
~{DF260361-ACBE-45EA-B84B-850E690D5AAB}~
~PowerShell Setup~
~$PWS_EXTRACT$~
~0~
~1~
~~
~Extract 7Zip Archive~
~{48EA395D-C475-470A-9238-28FCCDB60CC2}~
~$PWS_FILEBAG$\pwshellXP.7zip~
~$PWS_BOOTPATH$\pwsbin~
~PWS_EXTRACT~
~~
~TRUE~
~TRUE~
~MessageBox~
~{8E74AF26-C297-4326-A87B-8AEE20A42052}~
~PowerShell Setup~
~XP~
~0~
~1~
~~
~If~
~{2F69DC43-760E-4977-A7FC-5E683F606A97}~
~ISVISTA~
~0~
~FALSE~
~FALSE~
~If~
~{DFC96CEA-1FF5-4556-8E38-ADDCCD7DEFC0}~
~IS2003~
~0~
~FALSE~
~FALSE~
~MessageBox~
~{ACE786E9-7B38-492F-9F9B-61C780B7E687}~
~PowerShell Setup~
~$PWS_FILEBAG$~
~0~
~1~
~~
~File Bag~
~{F175C566-4251-4DF9-BDA0-D4B0B37EC2C3}~
~#IADIR#\runtimes\pwsbin\*.*|,TRUE,PWS_FILEBAG~
~mFileBagIDE.dll\mFileBagEXE.dll~
~MessageBox~
~{3CA44066-4303-4A1B-925E-5DC26AB4B977}~
~PowerShell Setup~
~$PWS_BOOTPATH$~
~0~
~1~
~~
~Get Folder Location~
~{29CD1671-033D-469E-904B-1EA91E450EF6}~
~PWS_BOOTPATH~
~9~
~TRUE~
~Set Variable~
~{C1CB7103-69C5-4EEE-8310-2F73C0C1623C}~
~PWS_ERROR$MYAH$MYAH$FALSE~
~~
~Set Variable~
~{70AFA716-EA70-4729-B460-C02F027897AD}~
~PWS_RESULT$MYAH$MYAH$FALSE~
~~
~Set Variable~
~{FB251EC9-2696-4B94-B11F-3FF390467B12}~
~PWS_FILEBAG$MYAH$MYAH$FALSE~
~~
~Get System Settings~
~{C3B724CC-5109-4765-A606-3FDD2F8904F6}~
~IS2003~
~26~
~Get System Settings~
~{5E958327-366E-4AB1-8962-FD9A7577C5E3}~
~ISVISTA~
~69~
~Set Variable~
~{B966F665-DF70-4C25-A362-DCA49BE59D8F}~
~PROGRESSMODE~
~MARQUEE~
~Set Variable~
~{945709EE-0689-4D94-AC2E-7F2BA77D4486}~
~PROGRESSTEXT$MYAH$MYAH$FALSE~
~Installing Microsoft PowerShell 1.0~
~If~
~{5BD0FA05-ABEB-4B57-BCDB-0F1D3B812028}~
~PWSHELL~
~0~
~FALSE~
~FALSE~


Return to “Plug-In Development”

Who is online

Users browsing this forum: No registered users and 35 guests