Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Hide Property Not Hiding Password In SqlConnectionString

Hello,

While configuring the Test Sql Connection for both Trusted & Not Trusted, I noticed that the SQL_PASSWORD property even thought it was set to "Hide property" it's still showing the password in the log when it logs the PROPERTY CHANGE for SqlConnectionString.

I have two SqlConnectionStrings, one for trusted & one for not trusted, each conditioned on the SQL_TRUSTED_CONNECTION:
Driver=[\{]ODBC Driver 17 for SQL Server[\}];Server=[SQL_SERVER];Trusted_Connection=yes;
Driver=[\{]ODBC Driver 17 for SQL Server[\}];Server=[SQL_SERVER];Trusted_Connection=no;Uid=[SQL_USERNAME];Pwd=[SQL_PASSWORD];

When I test the not trusted connection, it hides the value of the SQL_PASSWORD, but not when it's used in the SqlConnectionString. Here is the log:
MSI (c) (84:38) [08:59:23:530]: PROPERTY CHANGE: Adding SqlConnectionResult property. Its value is 'Connection successful'.
MSI (c) (84:38) [08:59:25:670]: PROPERTY CHANGE: Deleting SQL_TRUSTED_CONNECTION property. Its current value is '1'.
MSI (c) (84:38) [08:59:28:295]: PROPERTY CHANGE: Adding SQL_USERNAME property. Its value is 'sa'.
MSI (c) (84:38) [08:59:34:920]: PROPERTY CHANGE: Modifying SQL_PASSWORD property. Its current value is '**********'. Its new value: '**********'.
MSI (c) (84:38) [08:59:35:014]: PROPERTY CHANGE: Modifying SqlConnectionString property. Its current value is 'Driver={ODBC Driver 17 for SQL Server};Server=IR-DB14;Trusted_Connection=yes;'. Its new value: 'Driver={ODBC Driver 17 for SQL Server};Server=DB14;Trusted_Connection=no;Uid=sa;Pwd=Password1;'.
MSI (c) (84:38) [08:59:35:014]: Doing action: TestODBCConnection
Action 8:59:35: TestODBCConnection.
Action start 8:59:35: TestODBCConnection.
MSI (c) (84:38) [08:59:35:014]: Creating MSIHANDLE (833) of type 790542 for thread 7224
MSI (c) (84:54) [08:59:35:014]: Invoking remote custom action. DLL: C:\Users\testuser\AppData\Local\Temp\MSI2462.tmp, Entrypoint: TestSqlConnection
MSI (c) (84!08) [08:59:35:092]: PROPERTY CHANGE: Modifying SqlConnectionOK property. Its current value is '1'. Its new value: '0'.
MSI (c) (84!08) [08:59:35:092]: Creating MSIHANDLE (834) of type 790541 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Creating MSIHANDLE (835) of type 790540 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Creating MSIHANDLE (836) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Closing MSIHANDLE (836) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Creating MSIHANDLE (837) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Closing MSIHANDLE (837) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Creating MSIHANDLE (838) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Closing MSIHANDLE (838) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Closing MSIHANDLE (835) of type 790540 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Creating MSIHANDLE (839) of type 790540 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Creating MSIHANDLE (840) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Closing MSIHANDLE (840) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Creating MSIHANDLE (841) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Closing MSIHANDLE (841) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Creating MSIHANDLE (842) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:092]: Closing MSIHANDLE (842) of type 790531 for thread 16648
MSI (c) (84!08) [08:59:35:108]: Closing MSIHANDLE (839) of type 790540 for thread 16648
MSI (c) (84!08) [08:59:35:108]: Closing MSIHANDLE (834) of type 790541 for thread 16648
MSI (c) (84!08) [08:59:35:327]: PROPERTY CHANGE: Modifying SqlConnectionOK property. Its current value is '0'. Its new value: '1'.
MSI (c) (84:54) [08:59:35:327]: Closing MSIHANDLE (833) of type 790542 for thread 7224
Action ended 8:59:35: TestODBCConnection. Return value 1.
Is there any way to hide this?
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Hide Property Not Hiding Password In SqlConnectionString

Hi,

The "SQL_PASSWORD" property is always hidden because the "Hide property" option is set for it, but the value of the "SqlConnectionString" property is not hidden because it does not have that option set.

Since the password is concatenated to the value of the "SqlConnectionString" property, it will be displayed in the log when the value of the "SqlConnectionString" property is written. So, in order to avoid displaying it, you can set the "Hide property" option for the "SqlConnectionString" property, too.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Re: Hide Property Not Hiding Password In SqlConnectionString

Is there a way to set "Hide property" without adding something the the Value field? I would like to leave this blank as it currently is.
Catalin
Posts: 6597
Joined: Wed Jun 13, 2018 7:49 am

Re: Hide Property Not Hiding Password In SqlConnectionString

Hello,

Yes, it is possible to do that. Please leave the "Value" field blank and write something in the "Comment" field. This way, you will be able to declare an empty property.
Comment.png
Comment.png (7.26 KiB) Viewed 4148 times
Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Re: Hide Property Not Hiding Password In SqlConnectionString

Great, thank you both!
Catalin
Posts: 6597
Joined: Wed Jun 13, 2018 7:49 am

Re: Hide Property Not Hiding Password In SqlConnectionString

You are always welcome!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”