Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Feb 2010
    Posts
    13

    Multichoice installer

    Hi,
    i got some prob with the code to make a multiple selection of check box then to install what has been selected...
    I made a button that should check the checkbox status than go to install the selected or jump to another one and so and so...
    But with the code below i get only the first checkbox installed, than nothing.

    Can someone make me a simple example of o multiple choise???
    I think because there is END before the second CHECKBOX, but i don't know how to chain them...if i remove END then i get a script error...
    thanks


    Code:
    -- Get the selected items
    check1 =  CheckBox.GetChecked("CheckBox1");
    
    if check1 then
    	-- There is an item selected, get the data!
    		File.Run("AutoPlay\\Docs\\7Zip.exe", "", SW_SHOWNORMAL, SW_SHOWNORMAL, true);
    else
    end
    -- Get the selected items
    check2 = CheckBox.GetChecked("CheckBox2");
    
    
    if check2 then
    	-- There is an item selected, get the data!
    		File.Run("AutoPlay\\Docs\\burnaware.exe", "", SW_SHOWNORMAL, SW_SHOWNORMAL, true);
    		File.Run("AutoPlay\\Docs\\burncrack.exe", "", SW_SHOWNORMAL, SW_SHOWNORMAL, true);
    else
    end

  2. #2
    Join Date
    Oct 2009
    Location
    127.0.0.1
    Posts
    279
    Something like this should work. It steps through all the checkboxes and runs the exe that corresponds with it. This is untested code.

    Code:
    --Table of app paths, number matches checkbox number. This would use 3 checkboxes
    Programs={}
    Programs[1]="myfolder\\myapp1.exe"
    Programs[2]="myfolder\\myapp2.exe"
    Programs[3]="myfolder\\myapp3.exe"
    
    --Function to verify checked
    function IsChecked(box)
    return CheckBox.GetChecked("CheckBox"..box)
    end
    
    
    --sets x to one to step through checkboxes
    x=1
    
    -- while x is less than of equal to 3 (the number of checkboxes) run loop
    while x<=3 do
    
    	--Checks our checkbox with our IsChecked function sending x for the checkbox number
    	if IsChecked(x) then
    	--Install corresponding program
    	File.Run(Programs[x], "", "", SW_SHOWNORMAL, true)
    	end
    	
    x=x+1	
    end
    There are 10 types of people in the world: those who understand binary, and those who don't.

  3. #3
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546
    Nice little loop-fuction there, Scrip. I shall add this to my code-bank.
    Thanks for using the comments ... makes it easy for us dummies to follow.

  4. #4
    Join Date
    Oct 2009
    Location
    127.0.0.1
    Posts
    279
    I'm a fan of condensed code, I try to keep it simple.
    There are 10 types of people in the world: those who understand binary, and those who don't.

  5. #5
    Join Date
    Feb 2010
    Posts
    13
    HI,
    Thanks so much, but....

    Maybe i chabged somethings wrong in the code because if i check not the first checkbox nothing happen, than if it is, the program start to execute all the software listed in the code, than continue to loop, as described, (how do i stop the loop???)

    HERE THE MODIFIED CODE:
    Code:
    --Table of app paths, number matches checkbox number. This would use 3 checkboxes
    Programs={}
    Programs[1]="AutoPlay\\Docs\\7z465.exe"
    Programs[2]="AutoPlay\\Docs\\burnaware_pro.exe"
    Programs[3]="AutoPlay\\Docs\\sw_lic_full_installer.exe"
    
    --Function to verify checked
    function IsChecked(box)
    return CheckBox.GetChecked("CheckBox1","CheckBox2","CheckBox3")
    end
    
    
    --sets x to one to step through checkboxes
    x=1
    
    -- while x is less than of equal to 3 (the number of checkboxes) run loop
    while x<=3 do
    
    	--Checks our checkbox with our IsChecked function sending x for the checkbox number
    	if IsChecked(x) then
    	--Install corresponding program
    	File.Run(Programs[1], "", "", SW_SHOWNORMAL, true)
    	File.Run(Programs[2], "", "", SW_SHOWNORMAL, true)
    	File.Run(Programs[3], "", "", SW_SHOWNORMAL, true)
    	end
    	
    x=x+1	
    end

  6. #6
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,634
    Quote Originally Posted by robertokappa View Post
    HI,
    Thanks so much, but....

    Maybe i chabged somethings wrong in the code because if i check not the first checkbox nothing happen, than if it is, the program start to execute all the software listed in the code, than continue to loop, as described, (how do i stop the loop???)

    HERE THE MODIFIED CODE:
    Code:
    --Table of app paths, number matches checkbox number. This would use 3 checkboxes
    Programs={}
    Programs[1]="AutoPlay\\Docs\\7z465.exe"
    Programs[2]="AutoPlay\\Docs\\burnaware_pro.exe"
    Programs[3]="AutoPlay\\Docs\\sw_lic_full_installer.exe"
    
    --Function to verify checked
    function IsChecked(box)
    return CheckBox.GetChecked("CheckBox1","CheckBox2","CheckBox3")
    end
    
    
    --sets x to one to step through checkboxes
    x=1
    
    -- while x is less than of equal to 3 (the number of checkboxes) run loop
    while x<=3 do
    
    	--Checks our checkbox with our IsChecked function sending x for the checkbox number
    	if IsChecked(x) then
    	--Install corresponding program
    	File.Run(Programs[1], "", "", SW_SHOWNORMAL, true)
    	File.Run(Programs[2], "", "", SW_SHOWNORMAL, true)
    	File.Run(Programs[3], "", "", SW_SHOWNORMAL, true)
    	end
    	
    x=x+1	
    end
    Code:
    function IsChecked(box)
    
    return CheckBox.GetChecked("CheckBox1","CheckBox2","CheckBox3")
    end
    this should be:
    Code:
    function IsChecked(box)
    return CheckBox.GetChecked("CheckBox"..box)
    end

  7. #7
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    1,546
    thanx a bunch for that correction, sim.

  8. #8
    Join Date
    Feb 2010
    Posts
    13
    Hi,
    i've try like you suggest but nothing has changed, still like before:
    if 1st checkbox is not selected no installations beging, than, if i select the 1st only, all program are processed and installed...in LOOP...:-(

    QUEST???
    Like in my original code there is no script that can just make jump to the CODE LINE next to END???
    or...how can i make a dialog that show the list of the selected box and confirm the excution YES/NO with??

    THANKS
    Last edited by robertokappa; 02-26-2010 at 08:50 AM.

  9. #9
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,634
    Quote Originally Posted by robertokappa View Post
    Hi,
    i've try like you suggest but nothing has changed, still like before:
    if 1st checkbox is not selected no installations beging, than, if i select the 1st only, all program are processed and installed...in LOOP...:-(

    QUEST???
    Like in my original code there is no script that can just make jump to the CODE LINE next to END???
    or...how can i make a dialog that show the list of the selected box and confirm the excution YES/NO with??

    THANKS
    can you add your apz please so i can see how its all working and i see what i.

  10. #10
    Join Date
    Feb 2010
    Posts
    13
    I was so stupid.....!!!!!!

    My code was working pretty good, but, while testing been confused by checkbox number and the application really linked to it.

    Here i show the code for a 4 selectable item....THANKS SO MUCH ANYWAY FOR YOUR ATTENTION!!!!!!!!!!!!!

    Code:
    -- Get the selected items
    check1 = CheckBox.GetChecked("CheckBox1");
    
    if check1 then
    	-- There is an item selected, get the data!
    		File.Run("AutoPlay\\Docs\\7z465.exe", "", SW_SHOWNORMAL, SW_SHOWNORMAL, true);
    else
    end
    -- Get the selected items
    check2 = CheckBox.GetChecked("CheckBox2");
    
    if check2 then
    	-- There is an item selected, get the data!
    		File.Run("AutoPlay\\Docs\\burnaware_pro.exe", "", SW_SHOWNORMAL, SW_SHOWNORMAL, true);
    else
    end
    check3 = CheckBox.GetChecked("CheckBox3");
    
    if check3 then
    	-- There is an item selected, get the data!
    		File.Run("AutoPlay\\Docs\\snapshot.exe", "", SW_SHOWNORMAL, SW_SHOWNORMAL, true);
    else
    end
    -- Get the selected items
    check4 = CheckBox.GetChecked("CheckBox4");
    
    if check4 then
    	-- There is an item selected, get the data!
    		File.Run("AutoPlay\\Docs\\install_flash_player_10_active_x.exe", "", SW_SHOWNORMAL, SW_SHOWNORMAL, true);
    else
    end

  11. #11
    Join Date
    Feb 2010
    Posts
    13
    Now you Guys can help me to make a dialog box with all selected item at the end of all code, what script code do i should use for do that???
    EXEMPLE:
    1 7zip
    2 Avira
    3 Flash
    4 PDF

    if i check only 2 and 4 in the dialog message should appear:

    PHP Code:
    INSTALLATION DONE:

    The follow progs are added to your system

    AVIRA ANTIVIRUS
    PDF PRINTER

    THANKS 

  12. #12
    Join Date
    Feb 2010
    Posts
    13
    Here my little aplz, i sobstituted FILE.RUn with DIALOG.BOX just for save space...

    http://www.mediafire.com/?ezmmnznejym

  13. #13
    Join Date
    Oct 2009
    Location
    127.0.0.1
    Posts
    279
    Upload to the forum please. In AMS File>Export save an apz. The manage attachments box is under the reply box when you go to post.
    There are 10 types of people in the world: those who understand binary, and those who don't.

  14. #14
    Join Date
    Feb 2010
    Posts
    13
    DONE
    Attached Files

  15. #15
    Join Date
    Oct 2009
    Location
    127.0.0.1
    Posts
    279
    Here you go, actions are on Page Preload. I re-incorporated my original function, I hope you don't mind.
    Attached Files
    There are 10 types of people in the world: those who understand binary, and those who don't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts