Pressing buttons writes to file

Got a problem you cannot solve? Try here.
Post Reply
mattisdada
Posts: 4
Joined: Sat Jul 31, 2010 1:30 am

Pressing buttons writes to file

Post by mattisdada »

Image
I would like the button that says "I want technical support, after this installation Nerdfest servers will be used for installation" (Refer to as Button1 from now on out) to write to the file optin.txt "1". I would like the button "I do not want technical support, after this installation Nerdfest servers wont be used for installation" (Refer to as button2 from no on out) to write to a text file optin.txt "2".

Buttons don't seem to be controllable like other elements, i pretty much have the options to choose to go to next screen or change target.... Neither really do that, i would love it to just change a variable, and at the end of the program it writes the variable to file.

So, how would i go about doing this? Any help would be very much appreciated :)
Thank you in advance!

PS: If you would like the reason to why i want this, we're building installers for a local lan which will install the correct copy of the game, our modifications to it, and all patch's. This makes sure everyone is using the same copy (no complications). This has worked great on previous LAN's, but this time, i wanted to step it up a notch. And add a local server which whenever a program is installed, adds to the MySQL db two bits of information, game name and computer name. The server then gives us data to who has finished installing what game, what games we should have tournaments for first, etc.

PSS: The installer itself doesn't do any of the above, i wrote a program in php (server) and vb.net (client) to do this for me. The installer just executes the exe. Now, the reason why i need the buttons to write to text files is, the exe will read the text files, then do the appropriate action. 1 is to contact the server, 2 is to contact the server once (to tell us, they shant be requiring our services), reset it to 0 which means it wont connect to the server.
If anyone would like to have a look see at the files/source code, just ask, im more than happy to share :)
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Pressing buttons writes to file

Post by mills »

If you really don't want to use radio buttons, try this:

For one button set its action to "Go To Next Dialog" and set the other to "Return from Dialog". After you display the dialog, you can treat it like this:

Code: Select all

Comment: returns value into $dlgResult$
Display Dialog: twoButtons, wait for dialog to return (modal)
 
if Variable dlgResult Equals NEXT
...Write into Text File $TARGETDIR$\option.txt from Value 1 (at end of file)
else
...Comment: dlgResult must equal BTNRETURN
...Write into Text File $TARGETDIR$\option.txt from Value 2 (at end of file)
end
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
Post Reply