Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

execute .BAT file in installshield

I am developing a package and i need to run one .bat file that will install a windows service for me. I need 2 things:

  1. steps to make custom action that will run .bat files? or other may to run .bat file.
  2. how to make this custom action with the installation process(for example: just after license agreement)?

*note: my service that I am installing is Delphi service. Regards.

like image 412
user1906043 Avatar asked Oct 05 '22 15:10

user1906043


1 Answers

Ideally, you should look into creating a component that installs the service using MSI standard action InstallService.

Otherwise, you can use the following steps to execute the batch file during installation.

  1. Create a deferred type 50 custom action (EXE file having a path specified by a property value).
  2. Set it's source to [SystemFolder]\cmd.exe.
  3. Set it's target to "/c path-to-batch-file-on-target-system"
  4. Schedule it action near InstallService.

Also, don't forget to add a rollback custom action that reverts whatever modifications the batch file is doing and schedule it right before this custom action.

[Edited Step 3]

like image 163
Jag Avatar answered Oct 10 '22 01:10

Jag