Select Primary output from DBCustomAction (Active), then click OK to close the dialog box.ĥ. In the Select item in project dialog box, double-click the Application Folder.Ĥ. On the Action menu, choose Add Custom Action.ģ.
#My visual database portable install#
In the Custom Actions Editor, select the Install node. On the View menu, point to Editor, and then click Custom Actions.Ģ. Select the DBCustomAction_Setup project in Solution Explorer. Select the Edit2Visible, Edit3Visible, and Edit4Visible properties and set them to False.ġ. Select the Edit1Property property and type CUSTOMTEXTA1.ĩ.
Select the Edit1Label property and type Name of database server.Ĩ. Select the BodyText property and type This dialog allows you to specify the name of the database server.ħ. In the Properties window, select the BannerText property and type Specify Database Server Name.Ħ. Repeat until the Textboxes (A) dialog is above the Installation Folder node.ĥ. In the Add Dialog dialog box, select the Textboxes (A) dialog, then click OK.Ĥ.
In the User Interface Editor, select the Start node under Install. On the View menu, point to Editor, and choose User Interface.Ģ. Step 4:To create a custom installation dialogġ. In the Add Project Output Group dialog box, select Primary output for the Existing (say DBCustomAction) project. On the Action menu, click Add, and then click Project Output.ĥ. In the File System Editor, select the Application Folder. In the Properties window, select the ProductName property and type DB Installer.Ĥ. In the Name box, type DBCustomAction_Setup.ģ. Then select Setup Project in the Templates pane. In the Add New Project dialog box, open the Other Project Types node and select Setup and Deployment Projects in the Project Type pane. On the File menu, click Add, and then click New Project.Ģ. Tex = File.AppendText( this.logFilePath) Public override void Install(System.Collections. string strScript = GetSql( "sql.txt") ĮxecuteSql(serverName, "master", strScript) Creates the database and installs the tables. Protected void AddDBTable( string serverName) Server server = new Server( new ServerConnection(conn)) Using ( SqlConnection conn = new SqlConnection(connStr)) String connStr = "Data Source=" + serverName + " Initial Catalog=" + Private void ExecuteSql( string serverName, string dbName, string Sql) StreamReader reader = new StreamReader(strm) Reads the contents of the embedded file. Stream strm = Asm.GetManifestResourceStream(Asm.GetName().Name + "." + Name) Resources are named using a fully qualified name. Assembly Asm = Assembly.GetExecutingAssembly()
Private string logFilePath = "C:\\setupLog.txt" Public partial class CustomInstaller : Installer
#My visual database portable code#
Using Īdd the following code to the installer class You need to add following dll in your projectĪdd following namespace in installer class: