Click here to Skip to main content
11,922,641 members (54,195 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# VB Visual-Studio VB.NET Forms , +
I am using windows server2008 r2 and visual studio 2010

1) I have developed a windows forms application which has some textboxes and buttons.
2) I have built an setup project using visual studio installer.

Now i have added the setup.exe/msi package to the forms application. once the user clicks on a particular button the setup.exe/msi package should start its installation. i have googled many forums but got with this solution.

Process p = new Process();
    p.StartInfo.FileName = @"Path to the exe\setup.exe";

This solution is good if the user machine has the setup.exe file. But my problem is when we give it to the client they will not be having the setup.exe on their machine. So this way of mentioning the path will not work out. i need a solution wherein the setup.exe/msi package should start installing on a button click without mentioning the path.

Looking forward for your help in this scenario. Many thanks in advance. plz help me out
Posted 8-Apr-13 20:15pm
Edited 8-Apr-13 20:16pm
If you develop MSI and Setup.EXE, why the user cannot simply execute it?
shivanand3291 9-Apr-13 1:30am
Yeah you are right sergey but i have certain configuration settings to be done using that form and once it is done i want to launch this msi file upon a button click
Prasad Khandekar 9-Apr-13 1:37am
Hello Shivani,

You can do certain configuration settings via setup scripts as well.

shivanand3291 9-Apr-13 1:44am
@prasad khandekar: Do you mean writing .vbs scripts to do iis configuration settings?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Paste your setup.exe in same folder where your form is running and use this
p.StartInfo.FileName = Path.Combine(Application.StartupPath, "setup.exe")
shivanand3291 9-Apr-13 1:42am
The name 'path' does not exist in the current context error. what does this mean nasir?
Nasir M@hmood 9-Apr-13 2:04am
add reference System.IO or use System.IO.Path and it is "Path" not "path"
shivanand3291 9-Apr-13 2:51am
ya it worked..Thanks nasir !!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151125.1 | Last Updated 9 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100