Archive: Attempting to use installer to call another installer in Silent mode.


Attempting to use installer to call another installer in Silent mode.
The first installer will ask the user if they want to install the additional content, and on yes will call the second installer. No problem. However Boss says he wants it to work without user input. Easy enough, just slap an "/S" at the end of the nsExec::ExecToLog portion. The second installer works, but gives an error message at the end. The only clue I have is a blank messagebox with the word "Error", and an OK button. The program installs, but I am wondering what is causing the "Error" message.

How do I isolate this, if I want the program to install silently within another program, but run normally if run without the original installer?

There is supposed to be a log file, but that appears to not work correctly, either. I get the log file from the original installer, but not from the smaller sub-installer. No error messages in the regular log, so this appears to be a sub-installer issue.


Can you check if the second sub installer installs correctly if you run it in silent mode without using it in the script?

If this works fine then problem might be in the nsExec plugin try using ExecWait since i assume the sub installer is a windows application.

If it does not work(throwing some errors) then the problem is in the sub installer.


/me kicks self.
Thanks, I should have thought of that...

Just tried it, and yes, there is still an error. Any thoughts on how to obtain the error message while running in silent mode?


I am assuming the second installer is NSIS Installer, since you were talking about /S switch.

The most common problem with silent mode is you wouldnt have specified the inputs(/SD switch) for MessageBoxes in silent mode. Check if you have specified /SD switches to all messageboxes?

I may not be right but just give it a shot.


I do the silent install within installers all of the time. Just use the logging build, and send an installer.log to the install directory. As a suggestion, implement logging using the following macros, otherwise if you add logging, you won't be able to build again if you use the default compiler (IMHO, if this was in the standard build, it would make two separate NSIS compilers un-neccessary).

!macro Logger What
!ifdef NSIS_CONFIG_LOG
LogSet "${What}"
!endif
!macroend

!macro Log What
!ifdef NSIS_CONFIG_LOG
LogText "${What}"
!endif
!macroend

Then, to turn it on:
!insertmacro Logger on

And to log some text:
!insertmacro Log "About to install ${prodname}"

Anyway, the logging build is the ONLY way to fly for debugging silent installs. Go to the downloads screen and look under special builds.

-Kevin


darthvader:
Part of my surprise is the secondary script (yes, NSIS) completely lacks any messagebox lines. What would cause a random "error" messagebox to appear when run in silent mode?

Kevin:
Thanks for the suggestion about a logging build. I'll look into it. I am a little confused regarding: "you won't be able to build again if you use the default compiler"


Found there was an issue with the logging that I already had in the program. Found it by backtracking and commenting out sections until I found the culprit.

Thanks for your suggestions.