Archive: Derive testbox content from file


Derive testbox content from file
Hi

My installer writes a text file during the .onInit and I would like to populate a textbox in the UI with the content of this file.

Any ideas on how I can do this?

Thanks


If the text box is in an InstallOptions page, simply write the text you want into the INI file. If it's in a normal page, use send WM_SETTEXT using SendMessage. Search the examples that come with NSIS for WM_SETTEXT. They contain a couple of usage examples.


Unfortunately, I don't actually know the text at compile time. The text will vary from PC to PC.

What I'm actually doing in .onInit is piping the output of an exe into the text file as I thought this might be a way to populate my textbox in the UI.

Is there a way of piping the output directly into the INI file?


You can read the file using FileOpen, FileRead and FileClose and then write it to INI file using WriteINIStr.


If you're writing the text file in .onInit you might as well write to the INI file too. That will save you having to read from the file again. Just make sure you extract the INI file first.

-Stu