Jump to content

How to close script


Guest blunderbum
 Share

Recommended Posts

Guest blunderbum

I have written a script to run several installers when a checkbox is checked. The script seems to work OK and all of the installers run sequentially as I had hoped, but then the script never ends and the GUI stays on the screen. Any ideas?

#include <GUIConstants.au3>


GUICreate("Content", 275, 160) ; will create a dialog box that when displayed is centered

$group_1 = GUICtrlCreateGroup ("Content", 10, 10, 250, 140)
GUICtrlCreateLabel ("Select Content To Install",  20, 30, 200)
GUIStartGroup()
$MSC1 = GUICtrlCreateCheckbox ("MSC1", 30, 60, 60, 20,)
$MSC2 = GUICtrlCreateCheckbox ("MSC2", 30, 80, 60, 20)
$MSC3 = GUICtrlCreateCheckbox ("MSC3", 30, 100, 60, 20)
GUIStartGroup()
$MSC4 = GUICtrlCreateCheckbox ("MSC4", 110, 60, 60, 20)
$MSC5 = GUICtrlCreateCheckbox ("MSC5", 110, 80, 60, 20)
$MA1_1 = GUICtrlCreateCheckbox ("MA1_1", 110, 100, 60, 20)
GUIStartGroup()
$Ma1_2 = GUICtrlCreateCheckbox ("Ma1_2", 190, 60, 60, 20)
$DR1 = GUICtrlCreateCheckbox ("DR1", 190, 80, 60, 20)
$DR2 = GUICtrlCreateCheckbox ("DR2", 190, 100, 60, 20)

$install = GUICtrlCreateButton ("Install",  80, 120, 100)


GUISetState(@SW_SHOW)

$msg = 0
While $msg <> -3
 $msg = GuiGetMsg()
Select

case $msg = $install
   $state1 = GuiCtrlRead($MSC1)
   $state2 = GuiCtrlRead($MSC2)
   $state3 = GuiCtrlRead($MSC3)
   $state4 = GuiCtrlRead($MSC4)
   $state5 = GuiCtrlRead($MSC5)
   $state6 = GuiCtrlRead($MA1_1)
   $state7 = GuiCtrlRead($MA1_2)
   $state8 = GuiCtrlRead($DR1)
   $state9 = GuiCtrlRead($DR2)

if $state1 = 1 Then
    $arg1 = "MSC1\setup.exe /a"
 Else
    $arg1 = "empty.exe"
 EndIf

 if $state2 = 1 Then
    $arg2 = "MSC2\setup.exe /a"
 Else
    $arg2 = "empty.exe"
 EndIf

 If $state3 = 1 Then
    $arg3 = "MSC3\setup.exe /a"
 Else
    $arg3 = "empty.exe"
 EndIf

 If $state4 = 1 Then
    $arg4 = "MSC4\setup.exe /a"
 Else
    $arg4 = "empty.exe"
 EndIf

 If $state5 = 1 Then
    $arg5 = "MSC5\setup.exe /a"
 Else
    $arg5 = "empty.exe"
 EndIf

 If $state6 = 1 Then
    $arg6 = "MA1_1\setup.exe /a"
 Else
    $arg6 = "empty.exe"
 EndIf

 If $state7 = 1 Then
    $arg7 = "MA1_2\setup.exe /a"
 Else
    $arg7 = "empty.exe"
 EndIf

 If $state8 = 1 Then
    $arg8 = "DR1\setup.exe /a"
 Else
    $arg8 = "empty.exe"
 EndIf

 If $state9 = 1 Then
    $arg9 = "DR2\setup.exe /a"
 Else
    $arg9 = "empty.exe"
 EndIf



 Runwait($arg1)
 Runwait($arg2)
 Runwait($arg3)
 Runwait($arg4)
 Runwait($arg5)  
 Runwait($arg6)  
 Runwait($arg7) 
 Runwait($arg8) 
 Runwait($arg9)

EndSelect
wend
Exit
Link to comment
Share on other sites

  • Developers

I have written a script to run several installers when a checkbox is checked.  The script seems to work OK and all of the installers run sequentially as I had hoped, but then the script never ends and the GUI stays on the screen.  Any ideas?

<{POST_SNAPBACK}>

Just add an ExitLoop after the last RunWait()..

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...