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

M_Prog
M_Prog used Ask the Experts™
on
Hello,
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.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Developer
Commented:
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.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"

[Setup]
; 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.)
AppId={{1F30C2F6-6C7A-4A20-A08E-191A295AD08C}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

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

[Files]
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 

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

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


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

Open in new window

Author

Commented:
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

Commented:
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!

Author

Commented:
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
Commented:
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.

Author

Commented:
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

Commented:
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.  

Author

Commented:
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.
http://www.windowsnetworking.com/articles_tutorials/msi-packaging-tools.html

Author

Commented:
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