Reputation: 1153
I'm creating a Wix installer for a windows service which needs to have provided, at installation time, the username and password for an email account to inspect. Currently the password is stored in clear text in the config file which at the least needs to be encrypted.
Is this the best approach to take as I realise that storing an encrypted password is not good practice in itself?
If there is no better way then I was going to perform the encryption as part of a custom action but I can't figure out if there's a way to pass the encrypted value back to the installer so that the installed config file can be amended. Is there a way to do this as otherwise I'm guessing the custom action will have to perform this task to.
Upvotes: 4
Views: 2816
Reputation: 32270
The best option I found for now is using custom actions and data protection API:
Furthermore, all this can be wrapped into a WiX extension, but it's a kind of advanced...
This all concerns the case when you need the password during the install/uninstall/maintenance. Otherwise (if it is the application which needs it for functioning), it's up to the application architecture to choose the right way to store and use the value...
Upvotes: 6