This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Inserting a batch file into nsis installer

0

Hello, I would like to add a batch file to be executed at the end of a successful Wireshark installation. The goal is to have a single setup.exe file which will include this batch script and it's functionality. I made the installation exe file following the guide on the Development documentation for Win32/Win64. The batch file is setting up a file in %APPDATA%\Wireshark. I've never written a nsi script so I have no idea how to do it.

Thanks ahead!

asked 08 Apr '16, 06:19

Aliniel's gravatar image

Aliniel
308915
accept rate: 100%


One Answer:

1

There's nothing currently to include a general NSIS custom script section, although there is support for custom scripts for various other things, e.g. plugins, mibs etc.

You'll have to modify wireshark.nsi to do what you want. Basically use a File "path\to\file" statement to add your batch file to the installer and then use ExecWait ... to execute it. There are nsis plugins, e.g. nsExec that will hide the DOS command prompt.

answered 08 Apr '16, 07:11

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Thanks. It was enough to put ExecWait "$PATH\script.cmd". It had to be .cmd, .bat wasn't executing for some reason.

(11 Apr '16, 06:31) Aliniel