Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Get rid of CA MessageBox(es) during silent setup


5 replies to this topic

kgiloo

kgiloo
  • Full Members
  • 60 posts

Posted 21 December 2006 - 14:32

I have several CA with possible MessageBox(es).
For instance I have a CA which checks whether a process is running and suggests to kill it if the user wants.

What is the best to do to avoid all MessageBoxes when I run a silent install?
Is there a way to know from within my script in which mode the installation is started?


Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 22 December 2006 - 01:59

Yes, you can check the value of the UILevel Property.
Regards
-Stein Åsmul

nesesser

nesesser
  • Full Members
  • 62 posts

Posted 22 December 2006 - 06:48

For this aim I use Session.Message method.
This method automatically runs in silent mode (messages go to the log).
For example:
CODE

 iNum = Session.Property("DIRMSIMSGNUMBER")
 iButtons = Session.Property("DIRMSIMSGBUTTONS")
 Set oRec = Session.Installer.CreateRecord(1)
 oRec.IntegerData(1) = CInt(iNum)
 svRez = Session.Message(CInt(iButtons), oRec)
 oRec.ClearData
 Set oRec = Nothing
 
 Session.Property("DIRMSIMSGREZ") = svRez

This code gets iNum - number of exception from Error table
iButtons - buttons to show (the same as for MsgBox function).


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 22 December 2006 - 11:42

I prefer MsiProcessMessage / Session.Message.
This function detects invisible installs and acts upon that. More important: in case of a full UI, you know for sure that the message is not shown behind the main window.

kgiloo

kgiloo
  • Full Members
  • 60 posts

Posted 08 January 2007 - 12:24

I thank you for your help.
I used the function MsiProcessMessage successfully.
For the silent install I found out that the function returns '0', which enables me to manage specific actions in this mode.

I noticed that the message strings were sent anyway to the log file in silent mode.
Do you know if there's a way to log some messages for specific modes only (silent install for instance)?

Thanks in advance

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 08 January 2007 - 18:28

You could embed your logging code in an if statement that checks the value of the UILevel property.