MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Deleting a Property that is used

Wed Nov 16, 2022 10:46 am

I have just added the SQL Test Connection operation to our project whose result is stored in the "SqlConnectionOk" property. Then I created several actions that depend on the "SqlConnectionOk" property. Then I wanted to initialize the "SqlConnectionOk" property to "0" to disable a button when I call a dialog, so I added the "SqlConnectionOk" property to the property view and initialized it to "0". That worked fine. But then I changed my mind in favor of another solution and tried to delete the "SqlConnectionOk" property again, so as not to initialize it to "0". But that's not possible anymore, because it tells me that several actions depend on the property so I can't delete it. Since I read that a variable CAN be initialized, but does not HAVE to be initialized before it is used: Why can't I delete this property initialization in the property view?

From user point of view, I think it is very good that you tell us that there are references to this property and that I can search for them in this case. But please give us the possibility to delete the property anyway, no matter if there are references or not.

Best regards,
Johannes

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Deleting a Property that is used

Thu Nov 17, 2022 9:27 am

Hello Johannes,

You can not delete properties referred by other items.

If this were possible, then you might end up with a broken installation. For example, all custom actions, all events in dialogs and so on that use this property will fail (since they call a property that no longer exists).

I hope things are clearer now.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MGS
Posts: 83
Joined: Tue Oct 04, 2022 9:52 am

Re: Deleting a Property that is used

Thu Nov 17, 2022 9:58 am

Hello Liviu,
Liviu wrote:
Thu Nov 17, 2022 9:27 am
If this were possible, then you might end up with a broken installation. For example, all custom actions, all events in dialogs and so on that use this property will fail (since they call a property that no longer exists).
Doesn't that contradict what Cosmin wrote here?
If you don't define it, it's blank until you set it to a value. So if you don't create it in Install Parameters page, it's blank until you set it. It's not a variable. You don't need to define it in order to use it.

My suggestion would be to add a force-removal button to the dialog (the dialog that tells the user that this property cannot be deleted because other elements reference it), so that deleting this property initialization can be forced. That way, I don't have to delete everything that references this property just to delete its initialization so I can get back to where I started.

Best regards
Johannes

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

Re: Deleting a Property that is used

Fri Nov 18, 2022 1:20 pm

Hello Johannes,

A property has two states:

- it has a value, therefore it exists

- it has no value, therefore it does not exist (you can now create an empty property using the "Comment" field)

Your request is impossible to implement. As my colleague Liviu previously mentioned, that would break your project.

Thank you for your understanding!

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

Return to “Common Problems”