Furqan Sehgal
Furqan Sehgal

Reputation: 4997

Running a batch file

How can I include a batch file or an .exe file in my setup, that runs after setup is complete? Thanks Furqan

Upvotes: 1

Views: 454

Answers (2)

Hans Olsson
Hans Olsson

Reputation: 55001

If it's a Visual Studio Setup Project you can add a custom action. It can't execute batch files, but it can execute scripts and executables and also call functions in some DLLs.

Here's an article with more details: Visual Studio Setup - projects and custom actions

Be aware though, it's usually not recommended to run scripts.

Upvotes: 0

Anax
Anax

Reputation: 9362

It depends on the setup program you are using. The build-in setup programs available in VS Express do not offer such possibility.

If you are looking for a free alternative, have a look at Nullsoft Scriptable Install System. Other than that, you could get away by running the external batch / application file during the first time your application runs:

If My.Application.Deployment.IsFirstRun then
    Process.Start("yourapp.exe")
End If

Upvotes: 1

Related Questions