I am installing a .NET program that has database credentials. I want to encrypt the password within the config file for obvious reasons.
I don't see a great way to do this from installaware though. I have a dialog that gets the database information from the user, and that works just fine, populating the $PASSWORD$ variable that i create.
I can't seem to run a program to do the encryption, because there is no way to return the data back (I can only return the exit code, not output). I do not know enough about C++ to generate a native DLL (and I'm not sure that would work anyway).
I really just want to call a program and get a string back, then I can create the config file by the "Write text to file" installaware command.
Any ideas?
Encrypting string in config file
Re: Encrypting string in config file
I solved this by re-working my wrapper program to handle output to a file - this now saves the encrypted password directly to the config file.
Here is the encrypt class http://stackoverflow.com/questions/2020 ... t-a-string
And here is my wrapper class attached.
Also here is the installaware code that calls my program.
~InstallAware Clipboard Data~
~Write to Text File~
~{9D45A66E-6890-4CA6-8116-D3E9E95795F4}~
~$TARGETDIR$\Checkin\CheckinSvc.exe.config~
~ <add key="PracticeID" value="$PRACTICEID$" />~
~FALSE~
~TRUE~
~Run Program~
~{2C7CB714-C3FD-4ACB-818C-C28EAA20746D}~
~$TARGETDIR$\Encrypt.exe~
~FALSE~
~"$PASSWORD$" "$TARGETDIR$\Checkin\CheckinSvc.exe.config"~
~TRUE~
~~
~Write to Text File~
~{C486CC50-B59E-4145-B19A-83FF74414769}~
~$TARGETDIR$\Checkin\CheckinSvc.exe.config~
~ <add key="DatabaseUser" value="$USERNAME$" />~
~FALSE~
~TRUE~
Here is the encrypt class http://stackoverflow.com/questions/2020 ... t-a-string
And here is my wrapper class attached.
Also here is the installaware code that calls my program.
~InstallAware Clipboard Data~
~Write to Text File~
~{9D45A66E-6890-4CA6-8116-D3E9E95795F4}~
~$TARGETDIR$\Checkin\CheckinSvc.exe.config~
~ <add key="PracticeID" value="$PRACTICEID$" />~
~FALSE~
~TRUE~
~Run Program~
~{2C7CB714-C3FD-4ACB-818C-C28EAA20746D}~
~$TARGETDIR$\Encrypt.exe~
~FALSE~
~"$PASSWORD$" "$TARGETDIR$\Checkin\CheckinSvc.exe.config"~
~TRUE~
~~
~Write to Text File~
~{C486CC50-B59E-4145-B19A-83FF74414769}~
~$TARGETDIR$\Checkin\CheckinSvc.exe.config~
~ <add key="DatabaseUser" value="$USERNAME$" />~
~FALSE~
~TRUE~
- Attachments
-
- Encrypt.zip
- (47.84 KiB) Downloaded 313 times
Who is online
Users browsing this forum: No registered users and 108 guests