Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Visual-Studio VB.NET Forms , +
Hi,
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.
 
Problem:
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";
     p.Start();
 
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
v2
Comments
Sergey Alexandrovich Kryukov at 9-Apr-13 1:26am
   
If you develop MSI and Setup.EXE, why the user cannot simply execute it?
—SA
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.
 
Regards,
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
good
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")
  Permalink  
Comments
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 Sergey Alexandrovich Kryukov 565
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,466
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,897


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 9 Apr 2013
Copyright © CodeProject, 1999-2014
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