prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Persistent Property changed in Maintenance

In my project, I have a property marked as "Persistent" and "Secured".

During the first install, it is encrypted and I can see it in the registry.

However, during maintenance mode (Modify to be specific), the encrypted property is encrypted again and this change is seen in the registry.
As per the documentation a persistent property is not changed even if it is modified during the maintenance mode.

The only thing that I do during maintenance mode is re-install the feature.
So, does this mean that the persistent property would be modified if any of the feature is re-installed during the maintenance. If this case, I think it should be mentioned in the documentation. And also, is there a way that I can prevent it from being modified even if the feature is re-installed?

If this is not the intended behaviour and it's a bug, could you please let me know tentatively when can I expect the update with a fix?

I have attached the ".AIP" file highlighting this behaviour.

Thanks.
Prerak
Attachments
SecureRegTest.aip
(26.06 KiB) Downloaded 197 times
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Persistent Property changed in Maintenance

Hello Prerak,

This is currently under our investigations.

I will update this thread as soon as I will come to a conclusive answer.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Persistent Property changed in Maintenance

Hello Prerak,

Upon further investigations, unfortunately, it seems that our help is wrong. If a property's value is saved in the registry and, during the maintenance, the property's value is overwritten, then the registry will also be overwritten.

I have forwarded this to our Technical Writing team and the help will be updated. Please accept my apologies for this inconvenience.
And also, is there a way that I can prevent it from being modified even if the feature is re-installed?
In what regards this, I think that you can condition the custom action that encrypts the property, in "Table Editor" page, with a condition as it follows:

Code: Select all

NOT AI_MAINT
This way, the property will not be encrypted again during the Maintenance Mode, therefore its value will be preserved.


As a side note: after seeing this behavior, I think that this might be related to the first issue you have reported. Basically, during the Maintenance, the password that is saved in the registries is overwritten, therefore when the service tries to read it, it gets the wrong password, therefore it fails.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
prerak6962
Posts: 112
Joined: Mon Dec 08, 2014 5:26 pm

Re: Persistent Property changed in Maintenance

Hi Catalin,

Thank you for the clarification regarding persistent property.

Concerning, the re-encryption during Maintenance, the thing is I have two properties that are marked as secure, one is the user password and the other is as authorization token (also written in the registry). And the authorization token is something that the user can modify during maintenance. So, if I condition the custom action that encrypts as "NOT AI_MAINT", the authorization token will not be encrypted during maintenance. So, that is something that I can not do.

However, as a work around, now I decrypt and the user password in "Install Execution Stage" and set it to the original property and the later on call the "AI_SecureProperty" action which encrypts both the token and password. The workaround is working perfectly fine in the initial tests that I did.

I am not sure if this is possible or not but if you can add the ability to conditionally overwrite the registry it would be useful in such circumstances. Same as that is provided for the files:
Capture.PNG
Capture.PNG (29.66 KiB) Viewed 2824 times
As a side note: after seeing this behavior, I think that this might be related to the first issue you have reported. Basically, during the Maintenance, the password that is saved in the registries is overwritten, therefore when the service tries to read it, it gets the wrong password, therefore it fails.
Yes, you are right. I do not have the first issue also anymore, once I added the above mentioned workaround.

Thanks for your help... :)

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

Re: Persistent Property changed in Maintenance

Hello Prerak,

Thank you for your followup on this and for sharing your solution with us.

I am really glad you got this working.
I am not sure if this is possible or not but if you can add the ability to conditionally overwrite the registry it would be useful in such circumstances. Same as that is provided for the files:
Unfortunately, I am afraid that this is not currently possible.

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

Return to “Common Problems”