It's not possible to make Inno Setup automatically log actions based on [Registry]
section.
But you can log them manually using BeforeInstall
and AfterInstall
parameters and Log
support function:
[Registry]
Root: HKLM; Subkey: "Software\My Company\My Program"; ValueType: string; \
ValueName: "Test"; ValueData: "data"; \
BeforeInstall: Log('Before writing Test value'); \
AfterInstall: Log('After writing Test value');
Registry writing errors (as any errors) are logged automatically:
2017-05-21 16:57:51.652 Before writing Test value
2017-05-21 16:57:51.653 Message box (Abort/Retry/Ignore):
Error creating registry key:
HKEY_LOCAL_MACHINE\Software\My Company\My Program
RegCreateKeyEx failed; code 5.
Access is denied.
Click Retry to try again, Ignore to proceed anyway, or Abort to cancel installation.
2017-05-21 17:00:58.116 User chose Ignore.
2017-05-21 17:00:58.116 After writing Test value
If you need greater control over the logging, you need to use Pascal Scripting (instead of [Registry]
section entries) to write to the registry. But you cannot use convenient Inno Setup Registry support functions, as they won't give you a reason of a failure.
You would have to use low-level WinAPI functions.
Some references: