- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Decrypt SQLSERVER_PASSWORD prior to connecting to SQLServer to run SQLScript
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Decrypt SQLSERVER_PASSWORD prior to connecting to SQLServer to run SQLScript
Is there a way that I can make the SQLSERVER_PASSWORD undergo modification through a c# class or program prior to using it to connect to the SQLServer connection entered in the SQLServer Dialog?
My autodeployment process sends an encrypted password to the installer as a parameter, and I would like to decrypt this password in order to open the connection and run the Database Seed Script in my installer.
I then would like to Encrypt the password using a different algorithm and store it to my web.config.
Is there a way I can do processing on these values?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Yes, this is possible. If you have an InstallScript project you can utilize the "UseDLL" function to load your C# DLL - which must be COM Visible and x86 (or AnyCPU)
https://community.flexera.com/t5/InstallShield-Knowledge-Base/Updated-Information-About-UseDLL-Dependancy-Load-Order/ta-p/4587
In your DLL function, you could take a string input (the encrypted password) and return the decrypted string value.
Use the decrypted value to connect to your SQL server.
In another function of your DLL, you could take a string input (the decrypted password) and return the encrypted string value using the second kind of encryption.
Use the encrypted value to write to your web.config file
HTH