Link to home
Start Free TrialLog in
Avatar of Zeus2009
Zeus2009

asked on

How do install SQL EXPRESS 2008 with NSIS

Hi All,

I am looking for help with installing sql express 2008 with nsis silently, i have a database and app that will also be deployed in the same package. I have looked all over the net but there are many convaluted essays on how to achieve this but very few give good solid examples.

My app is purely for holding data and using lookup tables everything elses is inside the application.

Please could someone show a good example of how to delploy sql express silently using nsiss and setting up the ini file etc. im aware of the pre-requisuits such as DotNet 2 so that ins't required.

Many thanks

Zeus2009
ASKER CERTIFIED SOLUTION
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zeus2009
Zeus2009

ASKER

I will have a look at that tonight and report back.

Thanks

Zeus2009
How do you test if it is already installed?

Thank you.
Hi using nsis,

check for a registry entry for sql express etc or a dll that belongs to sql express and check the version you are installing is newer than one that is installed (if it is installed already)

 Section 'Windows Installer 3.1' SEC02 #NOTE should be installed before NET and stuff


  GetDLLVersion '$SYSDIR\msi.dll' $R0 $R1
  IntOp $R2 $R0 / 0x00010000 ; $R2 now contains major version
  IntOp $R3 $R0 & 0x0000FFFF ; $R3 now contains minor version
  IntOp $R4 $R1 / 0x00010000 ; $R4 now contains release
  IntOp $R5 $R1 & 0x0000FFFF ; $R5 now contains build
  StrCpy $0 '$R2.$R3' ;.$R4.$R5' ; $0 now contains string like '1.2.0.192'
    ${if} $R2 < '4'
        ${if} $0 != '3.1'
     ;options
     SetOutPath '$INSTDIR'
     SetOverwrite on
     ;file work
        MessageBox MB_ICONINFORMATION|MB_OK "BRiCS Installer will now update your system installer,this may take 10 minutes, please be patient.."
     File 'C:\Users\Cup\Documents\Visual Studio 2005\Projects\BRiCS (PMP)\BRiCS (PMP)(Working On)\BRiCS Installer\Install Files\Windows Installer 3.1\WindowsInstaller-KB893803-v2-x86.exe'
     ExecWait '$INSTDIR\WindowsInstaller-KB893803-v2-x86.exe /quiet /norestart' $0
     DetailPrint '..MSI 3.1 exit code = $0'
     Delete '$INSTDIR\WindowsInstaller-KB893803-v2-x86.exe'
     ${Else}
     DetailPrint '..MSI $0 already installed !!'
     ${EndIf}
    ${Else}
    DetailPrint '..MSI $0 already installed !!'
    ${EndIf}
SectionEnd