Jacob Darka
Posts: 23
Joined: Mon Jun 24, 2019 7:26 pm

Run commands of batch file directly through installer

Mon Sep 06, 2021 2:24 pm

Hello,

Is there any way to run the commands of a batch file directly through the installer itself, without the need of an actual .bat file?

For example, I got a batch file that does the following:

Code: Select all

ren "5.txt" "5.back"
move "5.back" "temp"

Now I want to integrate these very specific commands through the installer itself, is that possible?

Catalin
Posts: 6509
Joined: Wed Jun 13, 2018 7:49 am

Re: Run commands of batch file directly through installer

Mon Sep 06, 2021 2:39 pm

Hello Jacob,

I believe you could achieve that by using a "Launch File" custom action that launches the cmd.exe and then pass those as arguments.

Besides that, you could convert that to either VBScript or PowerShell (this would also be much easier) and use one of the following custom actions:

Run Inline PowerShell script

Execute inline script code

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Jacob Darka
Posts: 23
Joined: Mon Jun 24, 2019 7:26 pm

Re: Run commands of batch file directly through installer

Mon Sep 06, 2021 4:58 pm

Thanks for the answer Catalin.

Catalin
Posts: 6509
Joined: Wed Jun 13, 2018 7:49 am

Re: Run commands of batch file directly through installer

Tue Sep 07, 2021 11:12 am

You are always welcome, Jacob!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”