jstuardo
Posts: 87
Joined: Mon Nov 09, 2015 10:44 pm

Showing message during custom action execution

Tue Nov 28, 2017 5:28 pm

Hello,

I have a custom action that is to be run when system is being modified,

Something does not work in it that I need to debug. To do it, I have placed some MsgBox instructions but they don't work. Nothing is shown.

How can I show the message boxes?

By the way, this is the actual VBSript code. I need to pass [SqlTrustedConnection] property but I need to know how it is received.

Code: Select all

Function main()
   data = Split(Session.property("CustomActionData"), ";")
   path = data(0)
   server = data(1)
   username = data(2)
   password = data(3)
   trusted = data(4)
   If Right(path, 1) = "\" Then
     path = Left(path, Len(path) - 1)
   End If
   
   filePathConfiguracion = path & "\Configuracion.exe.config"
   filePathGestion = path & "\Gestion.exe.config"
   filePathRegistro = path & "\Registro.exe.config"
   
   oldDBString = "data source=[SERVER];user id=[USERNAME];password=[PASSWORD];"
   MsgBox data
   MsgBox trusted
   If trusted = "1" Then
     newDBString = "data source=" & server & ";integrated security=True;;"
   Else
     newDBString = "data source=" & server & ";user id=" & username & ";password=" & password & ";"   
   End If
   
   ReplaceInFile filePathConfiguracion, oldDBString, newDBString 
   ReplaceInFile filePathGestion, oldDBString, newDBString
   ReplaceInFile filePathRegistro, oldDBString, newDBString
   
   main = 1
End function
Thanks
Jaime

jstuardo
Posts: 87
Joined: Mon Nov 09, 2015 10:44 pm

Re: Showing message during custom action execution

Tue Nov 28, 2017 9:38 pm

It turned out that I was trying to show the array content in the message box, causing the script to abort prematurely. However, I am having problems passing SqlTrustedConnection to the script.

I have sent another post asking this.

Regasrds
Jaime

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Showing message during custom action execution

Wed Nov 29, 2017 1:52 pm

Hello Jaime,

Please check my reply on "[SqlTrustedConnection] property value is not passed to custom action" thread.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”