Hello Prerak,
First of all, please accept my apologies for the delayed reply.
My bad. I did not realize there was a second page.
That's fine, don't worry.
However, after these changes, my first installation is also failing. It says the service user does not have enough rights to launch the service.
If I uncheck the "Secure Property" for "[USER_PASSWORD]" it works completely fine.
Indeed, this happens due to the fact that the property is encrypted and can not be read. It does not have anything to do with elevated privileges.
So, could you please let me know when is the secure property encrypted?
Is it at run time as soon as the user types it? If yes, I think I'll need to decrypt it into other property and provide that in the password field for the service.
By default, the properties are encrypted during the deferred stage of the installation. As you could see, when you check the
"Secure property" option for a property, a .dll is added to your project. During install, the calls to the .dll functions are done and the property is encrypted. Since it relies on the .dll to encrypt the property, it means that the encryption is done during the Deferred stage (when the .dll is copied on the target machine).
If I check the value of a secure property after the "Searhes" stage in "Install Execution Stage" it is same as what user entered (unencrypted).
However, if I check if just before "Install Services" stage it is encrypted. And as a result the installer fails at "Starting Services".
Please see my explanation above for this.
So, could you please let me know exactly in which stage the secure properties are encrypted?
To be more precise, this custom action runs right after the
"Preparing" action group -->
"InstallValidate" standard action. You can find this custom action by going to
"Table Editor" page -->
"InstallExecuteSequence" table -->
"AI_SecureProperty" custom action.
And is it possible to move that stage after "StartServices" stage?
Yes, that is possible. By default, the
"AI_SecureProperty" custom action has its sequence number equal to
"1402", while the
"StartService" action has its sequence number equal to
"5850". With that being said, what we need here is to increase the sequence number of the "AI_SecureProperty" custom action to be > than 5850 (e.g. 5860). To do so, you can go to
"Table Editor" -->
"InstallExecuteSequence" --> find the
"AI_SecureProperty" custom action and increase its sequence number.
If not, I have a dirty workaround in my mind like:
The first method should work just fine, so I do not think this will be necessary.
Hope this helps.
Best regards,
Catalin
FOLLOW US
Get the latest news in Application Packaging