-1

While the MSI is running I want the application to start then immediately following I want it to stop and close out. I have a batch file to start the application below:

START C:\EmulatorSer\EmualtorSer.exe

would the opposite just be

END C:\EmulatorSer\EmulatorSer.exe
JFrosty
  • 57
  • 8
  • 1
    Why don't you try it out and then come back :P. – d_kennetz Oct 03 '18 at 15:21
  • Did you check to see if the executable has any command line arguments you can pass to it to stop it? – Squashman Oct 03 '18 at 15:24
  • 1
    if not, use [taskkill](https://ss64.com/nt/taskkill.html). – Stephan Oct 03 '18 at 15:26
  • taskill worked way better – JFrosty Oct 03 '18 at 15:37
  • 1
    @JFrosty, while it may work way better in your humble opinion, it is not always the best way to shut down an application. Using `taskkill` could cause data corruption if the program is in the middle of a write process. Always check the programs help file first if there is an option to gracefully shut down the application programmatically. – Squashman Oct 03 '18 at 15:41
  • What does the EXE file do once you run it that makes you want to launch it and then exit? – Stein Åsmul Oct 27 '18 at 17:05

1 Answers1

0

You could just use msi's killprocess custom action after you launch your bat file. In custom action add a "New Kill process", schedule it after you run your bat file. Once you add the killprocess function, add ISTerminateProcesses property in your property manager and set it to your app - you do not need the .exe, set ISTerminateProcesses to EmualtorSer

You can also give this a list, EmualtorSer;app1;app2;etc...

Tom
  • 162
  • 8