How to configure Inno SetUp Or PWD to install all software at once

M_Prog used Ask the Experts™
Please i need help on how i can package a Setup CD for my Application written in VB6.0, SQL Server 2005 Express (Stored Procedures). The Setup should install all prerequisite Software, Add Username/Password for my SQL installation, block SQL USer from viewing my Database structure and Stored Procedure using MGT Studio Express. Also configuring an online installation package.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Developer
You can install SqlExpress either in the [ Code] or [Run] section of InnoSetup.  The example below shows how to install the .NET framework but it could be changed to install Sql Express.  You can use the same concept to execute the SQL statements to create tables, stored procedures, and database security using osql and an SQL file included in your script.  
; Script generated by the Inno Setup Script Wizard.

#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL ""
#define MyAppExeName "MyProg.exe"

; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
;AppVerName={#MyAppName} {#MyAppVersion}

Name: "english"; MessagesFile: "compiler:Default.isl"

Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

Source: "c:\util\innosetup\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  Source: "c:\util\innosetup\Examples\dotnetfx.exe"; DestDir: {tmp}; Flags: ignoreversion dontcopy 

Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: nowait postinstall skipifsilent

function InitializeSetup(): Boolean;
    ErrorCode: Integer;
    NetFrameWorkInstalled : Boolean;
    Result1 : Boolean;
    sVer : string;
      NetFrameWorkInstalled := RegKeyExists(HKLM,'SOFTWARE\Microsoft\.NETFramework\policy\v2.0');
      if NetFrameWorkInstalled =true then
        //.NET Framework v2 is currently installed so nothing needs to be done.
            Result := true;
          //Run the .NET redistributable here using shellexec
          if Exec(ExpandConstant('{tmp}\dotnetfx.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
              // handle success if necessary; ResultCode contains the exit code
              Result := true;
          else begin
            // handle failure if necessary; ResultCode contains the error code
            Result := false;

Open in new window


Hello mirtheil,
Thanks for the reply but am new to inno setup, never used it before and also never used to setup any application. Please could help state procedures and also considering prerequisite installation which the setup has to check its existence before continuing installation.

I mean Windows Installer 3.1 needs to be checked, if not present then install, also .Net Framework 2.0 while the sql express needs to be installed with Username and password cos the application references to Username and Password.

Thanks again
MirtheilSoftware Developer

I've given you an example that you can look at that is a good base for what you are trying to do with InnoSetup.  Have you looked at the install?  Do you have any specific questions about it?  

InnoSetup does not use Windows Installer so you don't need to check it when running InnoSetup installs.  As far as other prerequisites, the installers for those pieces will do what they need to do.  

As I stated, I don't use SQL Express so I don't know how to install it with a username and password.  If there's a command line option for SQL Express that you can pass to set the username / password, then you can use that command line from within InnoSetup to run the SQL Express install.  
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!


Ok thanks i understand every bit of your comment but my question is prerequisite for installing SQL Server Express on systems like Windows XP is Windows Installer 3.1, .Net Framework 2.0. I think i got some link to putting username and password to SQl Server Express installation via command prompt but how do i incorporate that into Inno SetUp.
MirtheilSoftware Developer
To check for the MSI version, you can check the version of MSI.DLL.  You can get the location of the DLL by looking at the InstallerLocation value of the registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer.  
I've given you the example for .NET 2.0.  
You can modify the example to run the SQL Server Express install.  Instead of using the dotnetfx.exe, you would use the SQL Server Express executable.

This is not the place, if you want a script written for you.  We can offer help and suggestions.  If you want the script written for you, you need to look other places.


Ok please where is the location to get the complete script of installing WindowsInstaller 3.1,.Net Framework 2.0, SQL Server Express with username and password, Attach Database, Run Stored Procedures, and allow user input counts during Application SetUp.
Thanks i appreciate you
MirtheilSoftware Developer

I know of no site that has the exact script you are looking for.  You might need to find a consultant that knows InnoSetup and would be willing to write one for you for a fee.  Something like you are describing shouldn't take too long.  


Ok Mirtheil, Please help do that or refer me, would pay for the service and hope its in my budget. I really would appreciate this cos i really want to package my longtime design application. Also hope its compatible with windows 7 and other operating system.

Please help do this as immediate as possible.

Thank you
Packaging and distributing software can be very complex.   It varies on how many different platforms you are installing into and how diverse your applications are in software development.
This is a dated article, but Windows environments are mostly using the MSI installation packages and this may offer the overview you need to look further.


Please i thought i should be getting closer to a solution on how Inno SetUP works or better any standard SetUP package to complete my Application Process.

Or Please could PWD be used to package an application that requires checking if SQL Server Express is installed on the target machine, if not Install it alongside its prerequisite, also allows executing Stored procedure, creating table and so on.

Thank you
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial