How to make "SqlConnectionString" property which comes with default SQL Dialog "Hide Property"

Having trouble running Advanced Installer? Got a bug to report? Post it all here.
Post Reply
dk.cvo
Posts: 4
Joined: Thu Aug 30, 2018 8:08 am

How to make "SqlConnectionString" property which comes with default SQL Dialog "Hide Property"

Post by dk.cvo » Thu May 02, 2019 10:14 am

Hi Team,

I observed that SqlConnectionString property is used to evaluate the ODBCConnection via TestODBCConnection custom string. I want to make the property SqlConnectionString as "hidden", so it does not reflect its value in my log. But when I try to do it, I see that "OK" button is not enabled as attached.

Can you please guide me on how can I make this property hidden so it does not reflect in installer logs?

Kumar
Attachments
Hidden Property.PNG
Hidden Property.PNG (15.18 KiB) Viewed 414 times

Catalin
Posts: 1770
Joined: Wed Jun 13, 2018 7:49 am

Re: How to make "SqlConnectionString" property which comes with default SQL Dialog "Hide Property"

Post by Catalin » Tue May 07, 2019 9:28 am

Hello,

First of all, please accept my apologies for the delayed reply, but we had our Orthodox Easter holiday here.

Indeed, you are right, the "Ok" button is grayed out. Let me try to explain this:

- first of all, please keep in mind that a Windows Installer property can only have two states:

1. it exists and it has a value

2. it does not exist

As you may already know, the "SQLConnectionString" property is made up from another properties which are also assigned to different controls in your dialog (such as username, password, port, etc.). This means that the "SQLConnectionString" property has no value until the user inputs the above specified data (username, password, etc.), which means that this property is created during install time. Until then, this property does not exist, thus trying to assign the "Hide property" flag to it is not possible.

A way to assign the "Hide property" flag to your property would be to have a predefined value for it (to insert a value in the "Value" field - from your screenshot). However, you probably do not want this and this is the reason why we have added the "Comments" field to the "Edit Property" dialog.

With that being said, in order to assign the "Hide property" flag to the "SQLConnectionString" property, please add any comment to the "Comments" field - from your screenshot.

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

dk.cvo
Posts: 4
Joined: Thu Aug 30, 2018 8:08 am

Re: How to make "SqlConnectionString" property which comes with default SQL Dialog "Hide Property"

Post by dk.cvo » Tue May 07, 2019 9:50 am

Hi Catalin,

Not a problem :)
It perfectly makes sense to me, and adding the value/comment actually enabled me to declare that property as "Hide Property". Thank you so much for the detail reason and step forward. Very helpful. :)

I have one follow up question though, which is also related to verbose in logs about sensitive data. I am executing few SQL Scripts using Advanced Installer. When those execute I see logs as follows -

MSI (s) (7C!DC) [13:30:15:252]: PROPERTY CHANGE: Adding AI_SqlRollback property. Its value is 'CeliveoDB1016060Driver={ODBC Driver 13 for SQL Server};...............

There I belive connection string which I have in "Pre defined connection" OR "Custom Connection" is assigned to property AI_SqlRollback. But downside of this log is again, my passwords are in connection string and they are logged too. I tried to search this property in "Install PArameter" section where all properties are listed. But I dont see it there.

Is there a way as well to make this AI_SqlRollback hidden? Or not verbose this log?

Kumar

Catalin
Posts: 1770
Joined: Wed Jun 13, 2018 7:49 am

Re: How to make "SqlConnectionString" property which comes with default SQL Dialog "Hide Property"

Post by Catalin » Wed May 08, 2019 10:52 am

Hello Kumar,
It perfectly makes sense to me, and adding the value/comment actually enabled me to declare that property as "Hide Property". Thank you so much for the detail reason and step forward. Very helpful.
You are always welcome. I am glad I could help.
:)

In what regards your second question, indeed, you are right, the "AI_SqlRollback" can not be found in the "Install Parameters" page. However, let me try to go a bit deeper with this so you can better understand how to achieve this.

The property that does the trick here is called MsiHiddenProperties. The MsiHiddenProperties property is used to prevent the installer from displaying passwords or other confidential information in the log file. To prevent a property from being written into the log file, you can set the value of the MsiHiddenProperties property to the name of the property you wish to hide. You can hide multiple properties by specifying a string of property names delimited by semicolons (;).

This is what is happening behind when you are ticking the "Hide property" flag in the "Install Parameters" page. The property for which you tick the option is added to the "MsiHiddenProperties" property. For example, you wanted to hide the "SqlConnectionString" property, so you ticked the "Hide Property" option. By doing this, the "MsiHiddenProperties" was added to your project, as a row in the database as it follows:

Property: MsiHiddenProperties
Value: SqlConnectionString


With that being said, the trick to hide properties is pretty obvious now. All you have to do is to add the property name to the "MsiHiddentProperties" property. This can be easily done by proceeding as it follows:

Important: First of all, please go to "Install Parameters" page and uncheck the "Hide Property" option from your "SqlConnectionString" property.

Now please go to "Table Editor" --> "Property" table. There, right click on the white space --> "New Row":

1- In the "Value" field of the "Property" column, please input: MsiHiddenProperties

2- In the "Value" field of the "Value" column, please input the name of the properties that you want to hide, separated by a semicolon (;). This can look something like this, on our case:

AI_SqlRollback;SqlConnectionString

Please be aware to not leave any spaces between the semicolon and the name of the property.

Now let me try to explain the "Important" point from above. As you can see here, we have manually added the "MsiHiddenProperties" property in our Table Editor. By default, when you tick the "Hide Property" option from "Install Parameters" page, the "MsiHiddenProperties" is added to the database at build time (when you build the project). As you may have guessed by now, this would cause conflicts if we were to add only the "AI_SqlRollback" property to the "MsiHiddenProperties" property and leave the other one with the "Hide Property" option. The conflict would consist of the fact that the "MsiHiddenProperties" would be overwritten and only one value would be hidden, not both of them, as expected.

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

dk.cvo
Posts: 4
Joined: Thu Aug 30, 2018 8:08 am

Re: How to make "SqlConnectionString" property which comes with default SQL Dialog "Hide Property"

Post by dk.cvo » Wed May 08, 2019 11:55 am

Hi Catalin,

Thanks you very much for the in-depth explanation and great help :) This works like a breeze. I am not very proficient of Windows installer and was unaware of this property.

This helped me a lot. I just gave it a test and all those properties are hidden in installer logs. This is what I wanted to achieve. :)

My Best Reagrds
Kumar

Catalin
Posts: 1770
Joined: Wed Jun 13, 2018 7:49 am

Re: How to make "SqlConnectionString" property which comes with default SQL Dialog "Hide Property"

Post by Catalin » Wed May 08, 2019 1:56 pm

You are always welcome, Kumar.

I am really glad I could help.
:D

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Post Reply