Click here to Skip to main content
11,797,355 members (75,890 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# 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 19:15pm
Edited 8-Apr-13 19:16pm
Sergey Alexandrovich Kryukov at 9-Apr-13 1:26am
If you develop MSI and Setup.EXE, why the user cannot simply execute it?
shivanand3291 at 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 at 9-Apr-13 1:37am
Hello Shivani,

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

shivanand3291 at 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 at 9-Apr-13 1:42am
The name 'path' does not exist in the current context error. what does this mean nasir?
Nasir M@hmood at 9-Apr-13 2:04am
add reference System.IO or use System.IO.Path and it is "Path" not "path"
shivanand3291 at 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
0 CPallini 475
1 Maciej Los 370
2 OriginalGriff 363
3 Abhinav S 344
4 Andy Lanng 296
0 OriginalGriff 2,092
1 Maciej Los 1,760
2 KrunalRohit 1,436
3 CPallini 1,245
4 ppolymorphe 893

Advertise | Privacy | Mobile
Web04 | 2.8.151002.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