sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Install Parameters Not Persisted In Maintenance Mode

I have a set of properties defined in Install Parameters, marked as persisted, that I was testing being set during maintenance mode. In the install log I see the properties being set but they do not get updated in the registry. Initially during the first install these would have been written out as empty.

Is this the expected behavior? If I add a feature it's "persisted" properties won't be saved?
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install Parameters Not Persisted In Maintenance Mode

Hi!

I have tested this behavior and it works just as expected. The properties marked as persistent are stored in the registry by default. Just let me know aren't they stored for your application or you want to use them as arguments for your registry keys (path, version, etc.) and it is not working? Can you please give me an example?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Install Parameters Not Persisted In Maintenance Mode

Eusebiu,

During the "first install" the parameters get persisted properly (e.g. ES_MASTER_IP = '192.168.1.123'). Then I rerun the install in Maintenance Mode and change the same parameter as noted by:

MSI (s) (E0:30) [08:34:47:991]: PROPERTY CHANGE: Modifying ES_MASTER_IP property. Its current value is '{}'. Its new value: '192.168.1.124'.

The '192.168.1.124' does not get written out to the registry. The registry entry still contains '192.168.1.123'.
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install Parameters Not Persisted In Maintenance Mode

Are you choosing one of the "Repair" or "Modify" option in the maintenance mode? If so, can you send us please installation and maintenance logs and your project file?
In my scenario everything worked fine.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Install Parameters Not Persisted In Maintenance Mode

Yes I'm selecting "Add or Remove Features".
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Install Parameters Not Persisted In Maintenance Mode

The install also has a "Property set with Formatted" to set this to {} (i.e. empty) during Maintenance, Immediate, synchronous.
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install Parameters Not Persisted In Maintenance Mode

Hi

I have received your email with logs but there still are some details that would help me. If you can't send the install project, can you please create a sample project which reproduce the behavior and send it to us.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Install Parameters Not Persisted In Maintenance Mode

Eusebiu,

When you say you need the install do you mean you need the compiled install EXE or the project's AIP file?

Scott
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Install Parameters Not Persisted In Maintenance Mode

Eusebiu,

Sent a shell of my install AIP project file with the problem via support e-mail.

Scott
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Install Parameters Not Persisted In Maintenance Mode

Hi Scott,

It seems we misunderstood your problem. The behavior you are encountering is the correct one. i.e. the persistent properties do not get their values updated on maintenance, their only support is to remember the value they had on install and restore it back on maintenance. If you change the value of a persistent property during maintenance, then you launch the package again in maintenance it will still have the initial value that it got when the package was first installed.

Unfortunately this was not clearly explained in the user-guide, sorry for that, it was fixed.

The problem is that the registry entries created for persistent properties when the package first installs do not get rewritten on maintenance, this is why your change is not saved.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Install Parameters Not Persisted In Maintenance Mode

So the only other option is for me to write my own custom action to persist these values to the registry?

I'm trying to support if they run the install once a install feature "A" (of 3), run Maintenance mode and install feature "B" and still be able to run Maintenance mode a 2nd time and install feature "c".
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install Parameters Not Persisted In Maintenance Mode

Hi Scott,

You don't have to write your own custom action.

In order to be able to update the registry during maintenance you have to do the following steps:

Remove the persistent properties you created and create them again as you see in the example below, but do not select the "Set persistent property" option anymore.

Let's suppose the installation package requires a Username and a Password every time it is launched in order to determine what it must do. For this purpose you can use two Edit Box controls which have the properties USER and PASSWORD

Write the values of the properties into the registry
This can be done by following these steps:

- after the edit boxes are created and configured you can go to the Registry page
- create a new registry value in HKEY_LOCAL_MACHINE\Software\[Manufacturer]\[ProductName]
- set the "Name" field to Username and the "Data" field to [USER]
- create another registry value in the same key
- set the "Name" field to Password and the "Data" field to [PASSWORD]

This way you will create two registry values (Username and Password) which will contain the values of the properties "USER" and "PASSWORD" (which are set by the end-user).

Read the values of the properties from the registry
When running the installation in Maintenance mode (the "Modify", "Repair" and "Remove" options) the package must have access to the username and password. In order to improve the functionality, this information should be stored in the USER and PASSWORD properties..

For this you can follow these steps:

- go to the Search page and create a new search
- use the "Add Location" context menu to add the Registry as the search location
- in the Registry Location Properties section set the registry value in which the installation wrote the username information (for example, retrieve the raw value from HKEY_LOCAL_MACHINE\SOFTWARE\Your Company\Your Application\Username)
- rename the search to USER (the name of the search is actually the name of the property which stores the result of the search)
- do the same for the password (you will search for the "Password" registry value in the same key and the search will be named PASSWORD)

This way the Username and Password set during the first installation can be used during Maintenance.

Update the values of the properties into the registry during maintenance
Then go to the Organization page, create a new feature and add to it the registry values you created earlier.

In the Feature Properties panel:
- set the "Identifier" for example "Registry"
- select the "Not Displayed" option from the "Feature Tree", so it will not be shown in the ConfigureDlg dialog

Go in the Dialog page:
- select the MaintenanceTypeDlg from the Maintenance folder
- click on the "Modify" button on the dialog
- add a published event by clicking the "New" button from the "Published Events" tab
- select "Reinstall one or more features" from the newly appeared dialog
- in the "Argument" edit box write the identifier of the feature that contains the registry, in our example "Registry"
- do not modify the "Condition" field
- click [OK]
- click on the "Repair" button and follow the steps you followed for the "Modify" button

Let us know if this worked.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
broeckerS
Posts: 6
Joined: Thu May 02, 2013 10:34 am

Re: Install Parameters Not Persisted In Maintenance Mode

Hi,

your way is working but not the reinstall feature step at the end.
Why do you have to add it exactly at this control.
I would think, this event is called, when the button was clicked.
And at this time, there are no changes to the values.

In my opionen it would make more sense, if I add this event to InitEvents at the ProgressDlg,
but this doesn't work, too. So I am wrong... but I don't know why.
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Install Parameters Not Persisted In Maintenance Mode

Hi,

I'm not sure why the above solution does not work for you, but I tested it and also attached a sample project which works as expected.

However, it doesn't work with the "Reinstall one or more features" event in the "InitEvents" tab on the "ProgressDlg" dialog.

Best regards,
Eusebiu
Attachments
Persistent properties.aip
(21.29 KiB) Downloaded 595 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
broeckerS
Posts: 6
Joined: Thu May 02, 2013 10:34 am

Re: Install Parameters Not Persisted In Maintenance Mode

thanks for your sample.

Now, it works!

I didn't realize, that I use the Surface Theme and the order of the dialogs is a bit different.
I changed the dialogs in some way, so the maintenance process wasn't executed.

Return to “Common Problems”