|
#1
|
||||
|
||||
|
Check Box Variables
Quick LUA oriented question.
I tried figuring this one out on my own, but I can't seem to get this to work. I'm trying to have the installer check on the status of two checkboxes in my project. If they are checked, then the project should open external documents (one is plain txt and the other is pdf). What am I doing wrong? (this code appears in the screen's On Next event handler): Code:
ReadMeResult = DlgCheckBox.GetProperties(CTRL_CHECK_BOX_01);
if ReadMeResult == "true" then
File.Open(SessionVar.Expand("%AppFolder%\\ReadMe.txt"), "", SW_SHOWNORMAL);
end
WhatsNewResult = DlgCheckBox.GetProperties(CTRL_CHECK_BOX_02);
if WhatsNewResult == "true" then
File.Open(SessionVar.Expand("%AppFolder%\\whats_new.pdf"), "", SW_SHOWNORMAL);
end
Screen.Next();
|
|
#2
|
||||
|
||||
|
The easier way is to use the Lua variable that was assigned to the checkbox in the Checkbox properties screen ("Store state in Lua variable" field). Then you just check for that variable rather than doing GetProperties. If you do want to use the DlgCheckBox.GetProperties action, keep in mind that a table is returned, not just the checked value:
Code:
ReadMeResult = DlgCheckBox.GetProperties(CTRL_CHECK_BOX_01);
if ReadMeResult.Checked == true then
File.Open(SessionVar.Expand("%AppFolder%\\ReadMe.txt"), "", SW_SHOWNORMAL);
end
|
|
#3
|
||||
|
||||
|
I see, it's a table.... Many thanks, Brett.
|
|
#4
|
||||
|
||||
|
Darryl is currently working on a really handy "example project". It will contain some great examples on how to work with each of the screen types and should be available later this afternoon.
__________________
Check out the new MSI Factory 2.0! |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Default check box value based on variable | Terry Rasmussen | Setup Factory 6.0 | 7 | 02-27-2004 03:08 PM |
| HOWTO: Display Conditional Text Based Upon a List Box Selection | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-15-2002 11:54 AM |
| Packages and If Statements | Medlir | Setup Factory 6.0 | 4 | 05-09-2002 04:51 PM |
| check box on finish screen | smarty | Setup Factory 6.0 | 3 | 04-10-2002 09:42 AM |
| Variables in Text Box | tbybee | AutoPlay Menu Studio 3.0 | 2 | 03-07-2001 03:20 PM |
All times are GMT -6. The time now is 06:31 AM.








Linear Mode

