FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Default a "Properties" to empty

Using AI 8.5

I have a property that i want the user to enter at install time, and i use this later to set some iis properties

Is there a way to set the initial value of this property to be blank, im verifying that the value i enter is <>"" and having to set a default value as something is causing an issue
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Default a "Properties" to empty

Hi,

You can try to set the value of the property to:

Code: Select all

{}
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Default a "Properties" to empty

mihai.petcu wrote:Hi,

You can try to set the value of the property to:

Code: Select all

{}
All the best,
Mihai
Setting that under the install parameters is setting the value to those 2 characters
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Default a "Properties" to empty

Hi,

All properties are blank until you set them to a value, for example through a custom dialog. If a property has an initial value and you want to make it blank again, you can set it to {} through a custom action or a SetProperty control event.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Default a "Properties" to empty

The problem is i need to have defined this property ahead of time (IN CAPS) since its used in some vb scripts, and I cant set it to be Blank at this point

Found a workaround...
since this property is not used during a maintenance install i've set the property to

Code: Select all

[|AI_MAINT]
which is blank on the 1st time installs
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Default a "Properties" to empty

Hi,

Please note that the property is blank by default. So setting it to another empty property (AI_MAINT) is the same as not defining it at all.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Default a "Properties" to empty

Yes blank by default, but you cant define a global property as blank, as the "Ok" Box greys out

"Product Information" -> "Install Parameters" -> "Properties
Press "New" and blank the value, the "OK" box disabled and you cant add it
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Default a "Properties" to empty

Hi,
Yes blank by default, but you cant define a global property as blank, as the "Ok" Box greys out
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.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FergusMurray
Posts: 150
Joined: Thu Sep 30, 2010 10:44 am

Re: Default a "Properties" to empty

If i dont define the variable, using the variable in substitutions(xml) is pretty clumsy if its not defined
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Default a "Properties" to empty

Hi,

You can still use the property in the XML file, just don't use a picker to insert it. You can simply write its name like this:

Code: Select all

[MY_PROP]
Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
aldebaran
Posts: 23
Joined: Wed Dec 05, 2007 4:04 pm
Location: Hannover, Germany
Contact: Website

Re: Default a "Properties" to empty

I like to second the original poster in stating that dealing with empty / undefined properties is "pretty clumsy" in at least the situation mentioned (xml-substitution).

All three solutions

1) initializing the property with an empty one, e.g. AI_MAINT [abuse of totally unrelated property]
2) setting the property to non-empty dummy value just to clear it soon afterwards using "{}" through a custom action or a SetProperty control event ["pretty clumsy" is a polite understatement]
3) not defining the property at all, thus not being able to use the property picker [error prone]

mentioned in this thread are in my eyes far from optimal.

Is there a better way?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Default a "Properties" to empty

Hi,
Is there a better way?
Not really. This is how Windows Installer handles properties.

A property doesn't exist prior to being set by something (custom action, control event, control etc.). So if you access it, it will have no value (it's empty). It's not a declarative mechanism, you create properties when you need them.

Our property picker was designed to offer easier access to predefined properties and the custom properties you used somewhere in your installer. During the actual installation you can set (create) an infinite number of properties.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
abarry
Posts: 4
Joined: Thu Dec 15, 2016 3:48 pm

Re: Default a "Properties" to empty

I have achieved adding a blank parameter (in Advanced Installer 16.2) using the following process:
  • Go to: "Package definition > install parameters"
  • Right-click in the "properties" pane, and select "new property" from the context-menu.
  • Specify the (property) "name".
  • Leave the "value" field blank.
  • Write something in the "comments" field.
  • Click "OK"
The value of the new property is now blank/empty until you set it one way or another.
Last edited by abarry on Thu Aug 08, 2019 1:13 pm, edited 1 time in total.
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Default a "Properties" to empty

Hello,

Thank you for sharing your solution with us. I am sure this will be of help for further users facing a similar scenario.

Yes, we have recently added the "Comment" section in order to allow users to create empty properties.

This was not previously possible, as it was not supported by the Windows Installer technology either. However, we managed to find this workaround which works.

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

Return to “Common Problems”