Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

execute exe during install.

Posted on 2012-04-05
13
Medium Priority
?
189 Views
Last Modified: 2012-04-05
I want to execute an exe (.NET framework install) during a Setup/install project.  How do I do this?
0
Comment
Question by:HLRosenberger
  • 9
  • 4
13 Comments
 
LVL 38

Expert Comment

by:PaulHews
ID: 37812189
Include the exe as a file or as a project output in your install project.  Right click your install project in project explorer and select "Custom Actions"  You'll see a tree of custom actions with nodes for Install, Commit, Rollback and Uninstall.  Assuming you only want to lauch the EXE during install, right click the "Install" node, and select "Add Custom Action"  You'll get a dialog that allows you to browse to the output or file.  Select the executable output or file and click "Ok."

If you need to add arguments when you launch the EXE, click the action and locate arguments in the properties for the action.

Note that if it is a .NET project, the installer should be able to install all the prerequisites, so you should have no problems.  If it is a different type of executable, make sure the installer includes all the required runtimes.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 37812227
project explorer?   You mean solution explorer?  See attached
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 37812230
See attached
setup1.png
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:HLRosenberger
ID: 37812291
Also, you state that, "Note that if it is a .NET project, the installer should be able to install all the prerequisites".  And that's exactly what I want.   But I ran my install and it tells me it requires the .NET framework and then takes me to Microsoft Web site.
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 37812353
Sorry I thought you wanted to run a custom action.  You want to include .NET framework with your install project.  The best way to do this:

http://stackoverflow.com/questions/6090913/make-an-installation-program-for-c-sharp-applications-and-include-net-framework

Note that it creates a folder with an external file that the bootstrap setup.exe calls, so that must be distributed with your setup files.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 37812453
That link appears to download the framework as it installs.  I already have the framework install exe.  All I want to do is include it in the install and execute it first.
0
 
LVL 38

Accepted Solution

by:
PaulHews earned 2000 total points
ID: 37812565
All I want to do is include it in the install and execute it first.

There's a technical reason why you can't do that.  While one installation is in progress (your program), you can't start an installation for another (.NET framework.)   This is why MS has provided the means to include it at the same location.

That link appears to download the framework as it installs

No, where step 8 says "check output"  you will see that the .NET framework install is output to a folder next to your install files.  This folder must be included alongside your install files for the bootstrapper to utilize it.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 37812629
ah, got it!  Thanks.   Let me give it a try....
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 37812671
arggggg.   The install keeps telling me it requires the .NET framework, and if I click yes, takes me to Microsoft WEB site.  Is this correct?   I want the install done without prompts.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 37812681
What do I need to distribute?  I was assuming just the msi file.
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 37812714
No, the setup.exe, msi file, and the two folders must be distributed.  You can use a self extract file to package them if you want.  You have to run the setup using the setup.exe bootstrapper for it all to work properly.

I just did a test with a simple installer on a virtual machine and it set up the .NET 4 client framework without any visit to the web site.
0
 
LVL 1

Author Comment

by:HLRosenberger
ID: 37812756
ok.  This is for a school project, so I think I'll just do this, distribute the framework exe and run it first.  And also distribute my app.exe.  it should run after .NET is installed.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 37812870
Thanks
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Loops Section Overview
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question