Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 3

Database Installer - Basic MSI

Hello Everyone,
I am completely new bie to the installshield tool.Though, the installshield help library explains the tool functionalities very well, but I'm unable to comprehend and connect working of different parts of the tool to accomplish below tasks.So could anyone please explain on achieving the below tasks using Basic MSI or InstallScript MSI in InstallShield 2013.
1) Input Screens to capture the credentials from user and validate
2) On successful validation, Need to verify whether a particular version of SQL server;Ex : SQL Server R2 Express SP2(x86) is installed on the user's machine
3) If the SQL server is not installed, then just throw a relevant message to the user and abort the installatiion.
4) Once performing above tasks, below are the sub tasks to be performed as part of the installation.
4.1) Creating DB User
4.2) Create a new database
4.3) Restore Database using backup file provided/attached(.bak) with the installer.
4.4) Restore the SQL Jobs from server.

Any input would be helpful. Thanking In Advance!
Labels (1)
0 Kudos
(4) Replies
Level 17

In order to accomplish your requirements, you may want to look into the SQL Scripts view under the Server Configuration in the View List. The view provides a central location for managing and organizing all SQL scripts by server connections and settings. On the Requirements tab of connections, you can specify version requirements for the type of server that the installation should target at run time. Once you add a connection to the view, InstallShield automatically adds the SQLLogin dialog that captures and validates the credentials from user to your installation. For your task item 4, you can run some SQL scripts by adding to the connections that you create in the view. This functionality is available in both Basic MSI and InstallScript MSI projects.

Hope that helps.
0 Kudos
Level 3

Thanks Hidenori for your quick reply.
As per your instructions, I have completed most of the tasks, but getting stuck at few places.
I am trying to restore database by uploading the .bak file and using Text Replacement Tab. This works fine when I run the setup under the same server where SQL is installed.
When I take the setup file outside the server and try to restore by connecting to remote server, the installer goes fine without any error or message, at the same time it doesn't restore the database.
I believe for some reason, it's looking for .bak file under the local machine and installer is not able to find the file.
Could you please help me to fix the above.
0 Kudos
Level 17

You should be able to use a UNC path to restore a database from a .bak file located on a different machine. Note that the SQL Server service account must have access to the network share. Here is a sample script restoring a database named 'TESTDB' from c:\testdb\testdb.bak under a different machine named 'localmachine'. Please see the Backup Devices (SQL Server) help topic for more information.

RESTORE DATABASE TESTDB FROM DISK = N'\\localmachine\c$\testdb\testdb.bak'
0 Kudos
Level 3

Here, the requirement is I need to restore database on either on local machine/remote machine where setup is being installed. Below is the sample code, where I'm trying to pick the .bak file from configured path inside the script. is mapped to [INSTALLDIR] using Text Replacement Tab.
USE [master]
DISK = 'Example.bak' WITH FILE=1,
MOVE 'TestDB' TO 'TestDB.mdf',
MOVE 'TestDB_log' TO 'TestDB_log.ldf',
Below is the sequence of steps I'm expected to perform.
1) When user clicks on the setup, the setup should extract the .bak file on the configured [INSTALLDIR] path.
2) When setup prompts for SQL Login credentials, he can either connect to local SQL server or remote SQL server by providing the credentials.
3) When Next button is clicked, the above SQL script should pick the extracted file from [INSTALLDIR] path and restore the database on local/remote machine accordingly.

Could you please let me know how to achieve the above. Thanking In Advance.
0 Kudos