As long as your target machines are running Windows Installer 4.0 or later, you can set the MsiLogging property (via the setting in the General Information view), and a log file will be created in %TEMP%
.
If your target machines are running an earlier version of Windows Installer, or if you need to control the directory or filename, you can store some command-line parameters into setup.exe. However I don't know of a good way to tweak the filename here to ensure the file doesn't already exist (both %DATE%
and %TIME%
may contain characters that cannot be used in a filename, and %RANDOM%
doesn't provide much meaning).