We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

zing96
Posts: 2
Joined: Tue Apr 15, 2014 9:26 pm

Write User Credentials to file

I have what is hopefully a simple issue. I want to:

1) Collect user credentials (login/password).
2) Launch custom binary that encrypts this password - this binary can write to a file on disk (let's call is userpass.ini)
3) Read userpass.ini and write this value (and many other values) to a separate ini file during the "Add Resources" phase (let's call this config.ini)

This seems straight forward. I have a Custom Action that launches the custom binary and writes the ini file. I have a Search that executes and retrieves the raw value of this ini file. However, what happens is I cannot get the installer to read the encrypted password (userpass.ini) correctly when the file does not exist prior to the installer running. The installer only writes the correct, encrypted password to config.ini when userpass.ini exists before running the installer. Obviously, that's not going to happen; I need to both write userpass.ini, then read it, then write to config.ini.

What am I missing? My search runs before the custom binary runs so...I cannot figure it out. Help!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Write User Credentials to file

Hi and welcome to Advanced Installer forums.

In order to achieve what you want you can follow the steps below:
- go in the Custom Actions page and place your custom binary after the "Wizard Dialogs Stage -> User Selections" action group
- go in the Table Editor page, "InstallUISequence" table and modify the "Sequence" value of the "AI_AiIniLocator" action from "99" to "1290", for example (make sure that the new value is greater than the "Sequence" value that your own custom action has in the same table)
- build and run the project

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zing96
Posts: 2
Joined: Tue Apr 15, 2014 9:26 pm

Re: Write User Credentials to file

Thanks for the reply. This sort of worked. Not only did I change the value you recommended, but my custom action was set to a higher value than AiIniLocator (custom action was set to 1299). So even your suggestion did not resolve my issue until I edited the Sequence value for my custom action in the table editor to be lower than AiIniLocator. Your suggestion helped lead me in the right direction to find the answer. This is admittedly my fault for not knowing what the table editor is, but I'm new to the product. The GUI lends itself to think the "Search" is being performed at both steps of the installation and thus, I was confused. Thank you for the help.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Write User Credentials to file

You're welcome. I'm glad you got this working.

Just let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”