Mustafa Mohammadi
Mustafa Mohammadi

Reputation: 1463

Running .bat file before .exe automatically in Advanced Installer

I'm new to Advanced Installer. After Installing the file setup, I need to run a ".bat" file before running my ".exe" file every time. I found to add it, setting it's attributes as (Hidden, Vital and System), but I need to run it every time before lunching the application.

Please help me, Thanks

Upvotes: 2

Views: 2600

Answers (1)

Mike
Mike

Reputation: 320

If you're launching the application as a Finish Action from the Dialogs page, here are the steps:

  • go to Custom Actions page and add a Launch File custom action without sequence to launch the BAT file
  • enable the custom action's "When the system is being modified (deferred)" and "Run under the System account with full privileges (no impersonation)" options
  • go to Dialogs page, select the ExitDialog from First Time Install in the Install Sequence
  • select the Finish button then go to its Published Events tab and enable "Show all events" option
  • add an "Execute custom action" event passing in the "Launch file" created above as an argument
  • set the event's condition to the checkbox's name so the BAT doesn't execute unless the user selects the checkbox to launch your application
  • make sure the event is the first one in the Published Events list so it gets executed before the event that launches your application

There are a couple of articles to help you with other details:

How to launch a CMD or BAT file?

How to launch a file after an installation?

The main thing you need to consider is to run the event that executes the BAT custom action before the event that launches your application.

Also, I'm not sure you can do this from a Professional project type. You may need Enterprise or Architect.

Upvotes: 3

Related Questions