Sign in to follow this  
Followers 0


4 posts in this topic

Ok, this is a small fragment of the big picture.

I've got enough install scripts for small applications and checks for the pc's I have to manage at work. Now im wanting to make 1 big program/script to manage the rest of the scripts. Basically an installer to run each script depending on which boxes the user selects.

First things first... check this out. baring in mind this is the very first time i've used the GUI functions :P

#include <GUIConstants.au3>
$Form1 = GUICreate("Installation Form", 220,140)
$ck1 = GUICtrlCreateCheckbox("Change Room Location", 40, 10, 300, 20)
$ck2 = GUICtrlCreateCheckbox("Install Proxy", 40, 30, 250, 20)
$btn = GUICtrlCreateButton( "Install", 40, 80, 100, 35) 
While 1
    $msg = GuiGetMsg()
    Case $msg = $GUI_EVENT_CLOSE
    Case $msg = $btn
        If GUICtrlRead($ck1) = $GUI_CHECKED then

        ; Script Start - Change ROOM location
        RegWrite ( "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment" ,"LOCATION", "REG_SZ", "607" )
        $newLocation = RegRead( "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment" ,"LOCATION")
        msgbox(0,"","" & $newLocation & "")
    If GUICtrlRead($ck2) = $GUI_CHECKED then
        ;Proxy Checker
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", "")
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", "1")
    Case Else   
oÝ÷ ØÚ0hî²Ü(׫x"~Øb²+-êâpk&¢ë]¢)àÒ/y©ky§rmë®*m²ájwZ²Ç©z¶­yø¥zƧ˲Z¥v+[yæ¬êí¡ì^q«­¢+ÙèÀäÈíÁÑ ÀäÈíѼÀäÈíÕѽ¥Ð¹áÍÉ¥ÁÐĹÔÌí¥¹Íѱ°ÁɽɴÄ)èÀäÈíÁÑ ÀäÈíѼÀäÈíÕѽ¥Ð¹áÍÉ¥ÁÐȹÔÌí¥¹Íѱ°ÁɽɴÈ(

rather then copying the existing script text into the over all script?

Also any error reporting ideas please incase 1 installation fails that it will carry on or something?

Thanks, any advice appreciated!! :D


Share this post

Link to post
Share on other sites

Ah brillient! :)

Yus thanks


Also, im thinking of making it detect if somethings already there and checking the box for the user on load.

Im reading up on styles and im finding the examples in the help file alot more difficult then the rest when it comes to GUICtrlSetData.

$regCheck = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable")
if $regCheck = 1 Then
    GUICtrlSetData(4,"Checkbox", 1)

All very confused. Especially making a checkbox ticked initially if that program or setting is already inplace.

How's GUI Control Styles actually used within a script? Sorry for all the n00bish questions. :P Thanks again and well played Manadar

Share this post

Link to post
Share on other sites

Aah ok found the right 1.

GUICtrlSetState (4, 1)

Still confused about the styles though. Cheers

Share this post

Link to post
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
Sign in to follow this  
Followers 0