Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Encrypt Password, Store in ini & Decrypt as needed

It would be great to be able to have the password as a cypher and stored in an ini file and be able to decrypt and use it during installs (UI & Silent), as needed. Something like this:

[Byte[]] $key = (16, 2, 15, 3, 14, 4, 13, 5, 11, 8, 12, 1, 13, 14, 15, 16)
$Password = "pssword"
$path = "path"
$Secure = ConvertTo-SecureString -string $Password -AsPlainText -Force
$Encrypted = ConvertFrom-SecureString -SecureString $Secure -Key $key
$Encrypted > "${path}file.ini"
$Secure2 = Get-Content -path "${path}file.ini" | ConvertTo-SecureString -Key $key
$user_user=[system.runtime.interopservices.marshal]::securestringtobstr($Secure2)
$Pw=[system.runtime.interopservices.marshal]::ptrtostringauto($user_user)
$Pw
Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Encrypt Password, Store in ini & Decrypt as needed

Hi Collins,

Have you noticed our predefined support that has been added in the 14.6 version of Advanced Installer to encrypt MSI properties?

For details, please check the Secure Property how-tos articles.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Re: Encrypt Password, Store in ini & Decrypt as needed

Thanks Dan, looks very useful.

Would this work with a bootstrapper "feature based" where the ini is external "SETUPEXEDIR" and also in one of the msi's (APPDIR)? I'm trying to visualize what capability this feature has. I would like to have LogonInformation dialog in the bootstrapper and msi (in MSI if they run it outside of the exe), then pass the secure property to the MSI for silent install ( /q SECUREPROP="[SECUREPROP]") and have It update the external ini and also in the MSI ini. Would this work?
Dan
Posts: 4513
Joined: Wed Apr 24, 2013 3:51 pm

Re: Encrypt Password, Store in ini & Decrypt as needed

Hello,

I don't think your scenario is a valid one.

Please note that the bootstrapper dialogs are displayed only if certain features that are handled by the bootstrapper are used (e.g. multiple instances, pre-install dialogs), otherwise the bootstrapper dialogs will not be used.

If you have pre-install prerequisites, if no prerequisite is scheduled for installation based on its install conditions, then the bootstrapper dialogs will not be displayed.

If your package type is of EXE setup with resources next to it, the user will not be able to launch the installation from the MSI, they will get an error message saying that the bootstrapper needs to be used.

Considering all the above, the LogonInformation dialog should only be added in the MSI dialogs, in the First Time Install sequence and not in the bootstrapper sequence.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Encrypt Password, Store in ini & Decrypt as needed

Hello,

Yes, this should work for both of the setup packages types (EXE or MSI). If you encounter any issue or limitation please give us a detailed test case so we can analyze in depth your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Feature Requests”