Running bat files during installation through MSI

  • Thread starter Thread starter Mohit
  • Start date Start date
M

Mohit

Hi All,
I have some batch files which needs to be executed when installer
is running. How can I achieve this functionality using .Net MSI
installers. I didn't found any option where I can include all my
executables(here it is .bat) so that they can be run at the time of
installation.
Thanks in advance!!!
 
Hi All,
I have some batch files which needs to be executed when installer
is running. How can I achieve this functionality using .Net MSI
installers. I didn't found any option where I can include all my
executables(here it is .bat) so that they can be run at the time of
installation.
Thanks in advance!!!

Did you check out the PreBuildEvent and PostBuildEvent Setup Project
properties?
 
Thanks a lot for your reply.
Did you check out the PreBuildEvent and PostBuildEvent Setup Project
properties?

Well I have checked them and done some googling on them. But I found
(I may be wrong..correct me if so) that these will run the batch files
when the deployment project is built on the development machine. (Here
is a brief excerpt taken from msdn docs regarding PreBuildEvent
property - "Specifies a command line to be executed before the
deployment project is built.")

I wanted to run the batch files on the target machine on which
installation is done and those batch files should be run during the
time when installation is going on the target machine.
 
Mohit said:
Hi All,
I have some batch files which needs to be executed when installer
is running. How can I achieve this functionality using .Net MSI
installers. I didn't found any option where I can include all my
executables(here it is .bat) so that they can be run at the time of
installation.
Thanks in advance!!!

You will need to create a custom action to do this. You can include the
files/executables as part of your installer package. Though not exactly what
you are trying, I just bundled some zip files loosly in the installer and the
custom action uses ICSharpZipLib to extract them. I bundled ICSharpLib as
part of the installer and it worked well. I believe you will bundle your bat
file, then call it from your custom action.
 
You will need to create a custom action to do this. You can include the

Thanks a lot.
Custom action worked for me.

Now I have another problem - I have added custom action in Commit
therefore it runs the bat file at the end of the setup. What should I
do in order to run the batch file at the start of the installer or in
middle at some step???

Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top