i have to make my installer with some sql script.
one of this make my db totally an have the install dir of data index and log.
The prob is that the paths is variable because the db was install on more machine.
i need to have a install.exe that ask me were i want to install db when run the master script.
Can i do with adv inst 6.7?
I'm not sure I understand what you need to do. Can you please give me more details? Are you installing a Database file or are you running a SQL Script which creates a Database?
my script install a database and inside my script there are the paths of my DB.
I have more machines and these paths are variable, so i need to make a ".exe" that ask me, during the installation ,where i want to install my DB.
example:
USE [master]
GO
/****** Object: Database [MRV] Script Date: 02/16/2008 12:20:49 ******/
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = N'MRV')
BEGIN
CREATE DATABASE [MRV] ON PRIMARY
( NAME = N'MRV', FILENAME = N'D:\DBMRV\Data\MRV_PRIMARY.mdf' , SIZE = 102400KB , MAXSIZE = UNLIMITED, FILEGROWTH = 51200KB ),
FILEGROUP [INDEX]
( NAME = N'MRV_index', FILENAME = N'D:\DBMRV\Index\MRV_index.ndf' , SIZE = 102400KB , MAXSIZE = UNLIMITED, FILEGROWTH = 51200KB )
LOG ON
( NAME = N'MRV_log', FILENAME = N'D:\DBMRV\Log\MRV_LOG.ldf' , SIZE = 51200KB , MAXSIZE = 2048GB , FILEGROWTH = 51200KB )
END
For this you can use the SQL Script Replacement feature. Here are the steps you can try:
- in the "Dialogs" page create a custom dialog which allows the user to enter the paths you need
- in the SQL script which contains the variable paths use a unique token for each path (for example "_path1_")
- after adding the script in Advanced Installer, use the SQL Script Replacement feature to replace the unique tokens in the script with the properties of the Path Edit controls on the custom dialog
For example, you can replace the "_path1_" token in the script with the property of a path edit control (which will be resolved to the path entered by the user). Let me know if you encounter problems with this approach.
i try to work with your method but i have a problem to test my project.
my .exe also need to run some sql script (master script+other) and i can't test if it work if i didn't put some files in the project.
how can i solve this limit?
Please note that you can add a dummy registry value in the Registry page. After that, in the Organization page you can set for the component of the registry value a condition which is always false (for example "1 = 2"). This way the value will not be created by the installation process.
i click on RUN for test my project and i have this:
error.
Exception - Reason: Your project must contain at least one file before this operation can be performed.
Build finished because an error was encountered.
Did you create a registry value in the "Registry" page of your project? Please note that the project needs to contain at least one resource in order to be built (this is a Windows Installer requirement).
yes i create a reg value but i can't build my project.
I ins some file in app dir to workaround and now i can build mt project , but i have another error.
In the log i have this:
argumnents are: pathDB, BannerLine, to the right
MSI (c) (74:80) [16:44:42:187]: Note: 1: 2343
DEBUG: Error 2343: Specified path is empty.
This error is shown because a path edit control on one of the installation dialogs does not have a value. Please note that in order to use a path edit control there are some steps you need to take. The User Guide contains the Browse for folder how-to which may help you.
FOLLOW US
Get the latest news in Application Packaging