Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > How to Create Setup Project in Visula Studio 2005 with Custom Action
 

How to Create Setup Project in Visula Studio 2005 with Custom Action

Hi,

I want ot create setup of my application developed in Visual Studio 2005. The setup should ask database server details, and then create the System DSN before installing the application.

Kindly suggest.

Regards,
Kundan Kumar Sinha
www.java-script.in
Kundan Sinha http://www.java-script.in
  • Moved byeryangMSFTMonday, September 14, 2009 2:53 AM (From:Building Development and Diagnostic Tools for .Net)
  •  
Kundan Sinha  Friday, September 11, 2009 7:30 AM
Hi Kundan Sinha,

You can use Custom Action to show a dialog require user information during installation. Here is a sample which shows the step to create a custom action for your setup project.(the sample code is not for this case)
http://www.codeproject.com/KB/install/Installation.aspx

You can override the OnBeforeInstall method to raise a form(Form1 in the sample code below), In form1, you can let user to input some information to configurate the database.
public partial class Installer1 : Installer
{
public Installer1()
{
InitializeComponent();
}

protected override void OnBeforeInstall(IDictionary savedState)
{
Form1 frm = new Form1();
frm.ShowDialog();
base.OnBeforeInstall(savedState);
}
}

If you have anything unclear, please feel free to tell me.

Sincerely,
Kira Qian
Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework!
  • Marked As Answer byKundan Sinha Tuesday, September 15, 2009 4:49 PM
  •  
Kira Qian  Tuesday, September 15, 2009 6:58 AM
http://wix.sourceforge.net/
p.b.a  Friday, September 11, 2009 5:36 PM
Hi Kundan Sinha,

You can use Custom Action to show a dialog require user information during installation. Here is a sample which shows the step to create a custom action for your setup project.(the sample code is not for this case)
http://www.codeproject.com/KB/install/Installation.aspx

You can override the OnBeforeInstall method to raise a form(Form1 in the sample code below), In form1, you can let user to input some information to configurate the database.
public partial class Installer1 : Installer
{
public Installer1()
{
InitializeComponent();
}

protected override void OnBeforeInstall(IDictionary savedState)
{
Form1 frm = new Form1();
frm.ShowDialog();
base.OnBeforeInstall(savedState);
}
}

If you have anything unclear, please feel free to tell me.

Sincerely,
Kira Qian
Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework!
  • Marked As Answer byKundan Sinha Tuesday, September 15, 2009 4:49 PM
  •  
Kira Qian  Tuesday, September 15, 2009 6:58 AM
I don't see how this solution helps. All custom actions, even those called "Before" actually run after all the files have been installed, including any database files. If the requirement is to createa system DSN *before* the install, as the questioner states, then a custom action won't help. If the order is actually unimportant and it's ok to create it after everything is installed, then a custom action will work.
Phil Wilson
PhilWilson  Thursday, September 17, 2009 8:42 PM
Hi,

Yes, Philwilson's answer is correct. I forgot to post that comment in my previous post. All the installer events fired after installing and before uninstalling. Kundan Sinha, does it affect your deployment?

Sincerely,
Kira Qian
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Friday, September 18, 2009 6:44 AM

You can use google to search for other answers

Custom Search

More Threads

• ClickOnce application download error
• Perplexing ClickOnce Deployment Error HELP!
• SCCM
• DeploymentDownloadException when attempting to install a ClickOnce app
• Sql Server 2005 not packaged
• Advertised shortcuts in the installers... how avoid it
• How to modify app.exe.config.deploy file
• Windows Form UserControl
• Is IExpress.exe redistributable ? Is this inbuilt in all Windows OS?
• ClickOnce "Machine Access" warning