|
#1
|
|||
|
|||
|
Hi guys.
Im having a little trouble creating a setup for personal use. Basically what i will do is make an exe that contains the setups of the programs that i use the most, but giving me the option of selecting which setups to run. looks simple but as i dont know much of lua scripting and the default options of the installer are not enough (even though they are perfectly helpful in more of my projects) I am having a little trouble here. Example: I have setup of adobe flash player which it doesnt matter which computer I am, I will needed it (and a bunch of other little setups). I loaded the file in the project, in Before Installing I create a boxlist screen with a box labeled Adobe. In the OnNext actions I put: Adobe = DlgCheckBox.GetProperties(CTRL_CHECK_BOX_01); Screen.Next(); so it checks the status of the box and saves it to Adobe. Now here is the tricky part: I want to check the status of CHECK_BOX_01 and IF checked then run the installer file... i tried with this: In After Install>Preload tab I put this action: if Adobe == tb.Checked then result = File.Run(SessionVar.Expand("%AppFolder%\\Adobe\\in stall_flash_player.exe"), "", "", SW_SHOWNORMAL, false); end If I try to put it in While Installing I have troubles cause it runs the setup over and over again while copying the files so that was the only way I came up with. I tried tb.Checked, Checked... as you could imagine the adobe setup doesnt run. (which means that im close to my goal cause at least it makes the comparison) but still not enough. Is there any other way that i can create a boxlist or a list of the programs in the setup that i can choose which ones to run or not... or it has to be manually done 1 by 1?? Thanks in advance and sorry for the long text but i wanted to be as descriptive as possible ![]() RaptorX |
|
#2
|
||||
|
||||
|
Hi RaptorX,
You are close to doing what you want however your script is slightly incorrect. What you should actually have is the following: Code:
if (Adobe.Checked) then
result = File.Run(SessionVar.Expand("%AppFolder%\\Adobe\\in stall_flash_player.exe"), "", "", SW_SHOWNORMAL, false);
end
This should work, but an easier way to do this is to use the the LUA Variable setting that each check box has. Take a look at the properties dialog of a check box and you will see what I mean. From the help file: Quote:
Code:
if (install_adobe) then
result = File.Run(SessionVar.Expand("%AppFolder%\\Adobe\\in stall_flash_player.exe"), "", "", SW_SHOWNORMAL, false);
end
You should run your actions on the "On Post Install" event, or from a screen in the After Installing list. You will have to do this for each additional install that you would like to run.
__________________
MSI Factory The Next Generation Intelligent Setup Builder |
|
#3
|
|||
|
|||
|
Yep I was close...
When I read "tb.check" I thought it meant literally... shame on me. Thanks for the explanation and the hints, cant be clearer than that. I read the help file but I was little bit confused... it was actually easier than I thought. I will give it a try tonight. 2 more questions if there is no problem: 1) can i run 2 or more files in the same IF statement? ex. checking Adobe box would run Adobe Reader and Adobe flash player? 2) and what would be your suggestion for a checkbox that if checked set all the other boxes as marked so it would install all at once without checking each box (I have in mind the Dlgcheckbox.setProperties but Im also not sure on how to use it in this case.) thanks in advance. |
|
#4
|
||||
|
||||
|
1) can i run 2 or more files in the same IF statement?
sure, as many as you need. You'd probably want to set WaitForReturn parameter to true so that installers run one after another - otherwise they'll be started all together and the script will immediately jump to the next command. 2) probably the simplest would be to set all per-installer lua variables to True if main checkbox is checked, sth like if (install_all) then install_adobe = true; install_xxx = true; -- ...... end |
|
#5
|
|||
|
|||
|
thanks for all your help guys everytihng running smooth now.
|
|
#6
|
||||
|
||||
|
Hi RaptorX,
I'm glad that you have it all working. If you do want a check box that will check all other check boxes you can use the MSGID_CLICKED notification message in combination with the DlgCheckBox.SetProperties() actions.
__________________
MSI Factory The Next Generation Intelligent Setup Builder |
|
#7
|
|||
|
|||
|
Quote:
in the OnCtrl Message windows: if (e_MsgID == CTRL_CHECK_BOX_01) then DlgCheckBox.SetProperties(CTRL_CHECK_BOX_02, Checked); end or if (e_MsgID == CTRL_CHECK_BOX_01) then DlgCheckBox.SetProperties(CTRL_CHECK_BOX_02, {Checked = true}); end and if (e_CtrlID == CTRL_CHECK_BOX_01) then DlgCheckBox.SetProperties(CTRL_CHECK_BOX_02, Checked); end Also if (MSGID_CLICKED == CTRL_CHECK_BOX_01) then DlgCheckBox.SetProperties(AFP.Checked); end and if (MSGID_CLICKED == All) then DlgCheckBox.SetProperties(AFP.Checked); end By the way "All" is the lua variable assigned to the box that would select everything at once. also tried if (e_All_CLICKED) then DlgCheckBox.SetProperties(AFP.Checked); end and without the "e_" and so on and on.... all of them do nothing... Is the first time that i dont get from the help file... ![]() It is very obscure for me and I dont understand why... I dont even understand the EXAMPLES.... Im getting old man... the age is getting me already... from the help file: Code:
Notification Messages A notification message is triggered whenever the user interacts with a control, or whenever user interaction affects a control in some way. Each notification message consists of a number that identifies the type of interaction that has occurred, and a table containing details specific to that type of interaction. These two values are passed to the screen's On Ctrl Message event as the event variables e_MsgID and e_Details. Note: Notification messages are not triggered when actions interact with this control. (number) e_MsgID A numeric constant that represents the specific notification message that was fired by the screen control. See the e_MsgID column below for all possible message ids that can be fired by a check box control. (table) e_Details A table of additional details that may be passed by the control when certain notification messages are fired. See the e_Details column below for the kinds of details that are returned and the table indexes that you can use to access them. For example, you can access the item "Checked" from this table by using e_Details.Checked. e_MsgID e_Details Description MSGID_CLICKED (boolean) Checked - Whether the check box is checked or not. The value true means it is checked and false means it is not. Fired when the check box was clicked. Related Actions The following actions are available for interacting with a check box control: DlgCheckBox.GetProperties DlgCheckBox.SetProperties Code:
Example 1
DlgCheckBox.SetProperties(CTRL_CHECK_BOX_02, tProperties);
Sets the properties for the '02' Check Box control to those contained in the table "tProperties".
Example 2
DlgCheckBox.SetProperties(CTRL_CHECK_BOX_03, {Visible = false, Enabled = false});
Disables and hides the '03' Check Box Control on the current screen.
Well my setup is working fine I just want to have the select all button working. ![]() thanks for all. |
|
#8
|
||||
|
||||
|
Hi RaptorX,
Don't worry too much about it. Programming is an art form, and if you are just beginning you can't expect to "get it" all at once. Just keep working at it and once you "get it" it should stick. From what you posted it looks like you need to pay closer attention to what the help file tells you the event variables are and how the Get and Set properties actions work. Here is a short example of code that you can put on your "On Ctrl Message" event of a Check Box screen that will always update the "Checked" state of the second check box to be the same as the first check box. Code:
-- Is this the clicked message sent from the right control? if ((e_MsgID == MSGID_CLICKED) and (e_CtrlID == CTRL_CHECK_BOX_01)) then -- Get the properties of the second check box tbProps = DlgCheckBox.GetProperties(CTRL_CHECK_BOX_02) -- Set the Checked property to be the same as Check 1 tbProps.Checked = e_Details.Checked -- Update the second check boxes properties DlgCheckBox.SetProperties(CTRL_CHECK_BOX_02, tbProps) end
__________________
MSI Factory The Next Generation Intelligent Setup Builder |
|
#9
|
|||
|
|||
|
Quote:
Thanks everyone. |
|
#10
|
|||
|
|||
|
ok several things:
1) where should I report bugs?? I put the code and tried to preview it and it didnt do anything, I compiled the setup and tried again and then I could see the results, it seems to be that you cannot preview all the codes that you input. 2) it works perfectly, what i understand is that i was using HALF the code, MSGID just checked if it is clicked but it doesnt know WHO was clicked... thats where e_CtrlID comes in, I specify WHO is the one that has to be checked right? then I get the properties of box 2 and save it into tbProps but, here is where im little bit confused when you set tbProps.Checked = e_Details.Checked because I dont see the condition when it is Unchecked... how does the computer recognize it? Im sorry but I just want to be clear. As I said before everything is working fine. Thanks for all your help Mark and I will keep in mind about the help file.
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Run a VB exe File | gauravbr | Setup Factory 6.0 | 3 | 01-10-2004 07:07 AM |
| Trying to run a .wmv video file | Bokie | AutoPlay Media Studio 4.0 | 1 | 03-20-2003 04:50 PM |
| HOWTO: Create a Project Template | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-28-2002 02:49 PM |
| HOWTO: "Hide" Externally Referenced Files | Support | AutoPlay Media Studio 4.0 Examples | 0 | 10-23-2002 04:19 PM |
| File Search with Conditional Program Installation | Jeffrey Jermolowitz | Setup Factory 5.0 | 1 | 05-07-2001 10:17 AM |
All times are GMT -6. The time now is 05:05 PM.











Linear Mode

