How do install SQL EXPRESS 2008 with NSIS

Posted on 2009-02-24
Last Modified: 2012-05-06
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

Question by:Zeus2009
    LVL 57

    Accepted Solution

    Just follow the Unattended installation steps of SQL Server Express edition along with your NSIS setup.

    That's it, Just configure the ini file and feel easy with your SQL Server Express 2008 installation.

    Author Comment

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



    Expert Comment

    How do you test if it is already installed?

    Thank you.

    Author Comment

    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 ''
        ${if} $R2 < '4'
            ${if} $0 != '3.1'
         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'
         DetailPrint '..MSI $0 already installed !!'
        DetailPrint '..MSI $0 already installed !!'

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now