How to debug a .VBS custom action
Although using a Visual Basic script (.VBS) custom action is not a recommended approach, there are some times when scripting is a much quicker solution.
The correct way to develop installer custom actions is through C++ .DLLs.
To avoid any installation errors resulting from a .VBS custom action you can use the information from this article to debug it line by line.
Here's what you need to do:
- Download and install Microsoft Script Debugger for Windows.
- Enable the Just In Time Debugging policy
- Make sure the custom action you are about to debug has a stopping point like a MsgBox occurrence. For example, the message can be "Starting Debug Mode...".
- Run the installer and after the custom action stops, launch "Msscrdbg.exe" from the debugger's install location.
- Attach the installer process(msiexec.exe) by accessing the debugger's bar menu > "View" > "Running Documents".
- Use the debugger's functionality to verify every line of code in your .VBS.