Archive: NSIS silent installer with logging of the internal commands

NSIS silent installer with logging of the internal commands

1) I need a silent installer whose log file contains all the log messages that the internal NSIS commands (File, SetOutPath, CreateShortCut, etc) would normally display in the interactive log window.

2) The community-provided logging mechanisms that I have studied (DumpLog-plugin, LogEx-plugin, etc.) do not capture the log output of the internal NSIS commands. Or am I wrong, does some such plugin exist?

3) Now, DumpLog only works with non-silent installers, because it -- if I understood correctly -- retrieves the log data from a log window object, and that window is not instantiated in silent mode (please correct if this explanation does not make sense).

4) Some background: we are deploying our software both to land-based premises and ships sailing overseas behind unreliable communications networks. We can not always assume a standard environment where the software will be run, so need to capture quite verbose installation logs.

5) Because we also deploy different versions and configurations of our program suite depending on the client, we want to trace each installation attempt made in some system with its own installation log file and place all logs in a certain directory (e.g. INSTDIR\logs).

6) I think the best solution would be that the internal NSIS commands should be changed to save their logging information *also* into some small internal storage that is always accessible to some (new, yet-to-be-invented?) DumpLog-style mechanism. Or can their logging info be accessed already in some fashion?

7) Would "LogSet on" work for us?

Thanks in advance for Your time and insights...

Tapio L.

Detailprints do not exist in silent mode, so there is nothing to capture for the normal logging functions. You'll have to write strings to a log file manually. You can for example exchange the File command with a ${File} macro that does both the File command and writes a log line.

As for verbosity, NSIS does not provide much of it. You may need to replace everything with win api commands using the system plugin, and use windows's getlasterror function if something goes wrong. This will not work with the File command, obviously. If you need a higher level of integration, maybe a plugin can do it, but otherwise you'll have to modify the NSIS source code.

Thanks a lot for your answer -- I think we now understand the options.

For the moment, in silent mode we shall use the special build and "LogSet on". At the end, its default "$INSTDIR\install.log" will be closed ("LogSet off") and copied into a release-specific name into directory "$INSTDIR\setuplogs".

In interactive mode we shall only use "DumpLog" as it creates a less verbose log.

This seems to work adequately for us now, but we might study using a ${File} -style macro and your other suggestions at some later time.

Thank You and Cheers,
Tapio L.