'도움말들..../오토잇'에 해당되는 글 34건

  1. 2012.09.05 AutoIt과 Command Line 명령을 이용한 동기화(백업) 툴
  2. 2012.09.05 WinRAR 4.11 한글 자동설치 스크립트
  3. 2012.09.05 OS( x86) (x64) 구분 설치..
posted by 범벙이 2012. 9. 5. 11:00

 

 

 

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\..\..\Documents\Icons\sync1.ico
#AutoIt3Wrapper_Outfile_x64=..\My Sync.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Description=My Simple Sync
#AutoIt3Wrapper_Res_Fileversion=1.0.0.3
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_LegalCopyright=Copyright 2012 (C) W.K.SEONG
#AutoIt3Wrapper_Res_Language=1042
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>

Global $sMain = "My Sync"
Global $SetSync = @ScriptDir & "\Settings.ini"
Global $FSource = IniRead($SetSync, "Default", "Source", "")
Global $FDest = IniRead($SetSync, "Default", "Destination", "")
Global $sName, $Label1, $Label2, $Label3, $Input1, $Input2, $Radio1, $Radio2, $Select
Global $Button1, $Button2, $Button3, $Button4, $Button5, $var, $Form

If Not FileExists($SetSync) Then
    IniWrite($SetSync, "Default", "Source", "")
    IniWrite($SetSync, "Default", "Destination", "")
    IniWrite($SetSync, "Default", "sync", "0")
EndIf

_Mainwindow()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            IniWrite($SetSync, "Default", "Source", "")
            IniWrite($SetSync, "Default", "Destination", "")
            IniWrite($SetSync, "Default", "sync", "0")
            Exit
        Case $msg = $Button1
            $Check = GUICtrlRead($sName)
            $FolderA = FileSelectFolder("원본 폴더를 선택하세요.", "", 1)
            If $FolderA <> "" Then
                IniWrite($SetSync, $Check, "Source", $FolderA)
                GUICtrlSetData($Input1, $FolderA)
            Else
                MsgBox(0, "Error", "대상이 선택되지 않았습니다.")
            EndIf
        Case $msg = $Button2
            $FolderB = FileSelectFolder("대상 폴더를 선택하세요.", "", 1)
            If $FolderB <> "" Then
                IniWrite($SetSync, $Check, "Destination", $FolderB)
                GUICtrlSetData($Input2, $FolderB)
            Else
                MsgBox(0, "Error", "대상이 선택되지 않았습니다.")
            EndIf
        Case $msg = $Radio1
            _SyncCheck()
        Case $msg = $Radio2
            _SyncCheck()
        Case $msg = $Select
            $Check = GUICtrlRead($Select)
            _SelectCombo()
            For $i = 1 To $var[0]
                If $Check = $var[$i] Then
                    GUICtrlSetData($sName, $Check)
                    $SourceA = IniRead($SetSync, $Check, "Source", "")
                    $DestA = IniRead($SetSync, $Check, "Destination", "")
                    GUICtrlSetData($Input1, $SourceA)
                    GUICtrlSetData($Input2, $DestA)
                    GUICtrlSetData($Select, $Check)
                EndIf
            Next
            _RadioCheck()
        Case $msg = $Button3
            $New = InputBox("새작업", "작업할 이름을 넣으세요", "", "", 150, 125, (@DesktopWidth - 150) / 2, (@DesktopHeight - 125) / 2)
            If $New <> "" Then
                $FA = FileSelectFolder("원본 폴더를 선택하세요.", "", 1)
                If $FA <> "" Then
                    IniWrite($SetSync, $New, "Source", $FA)
                    GUICtrlSetData($Input1, $FA)
                Else
                    MsgBox(0, "Error", "대상이 선택되지 않았습니다.")
                EndIf
                $FB = FileSelectFolder("대상 폴더를 선택하세요.", "", 1)
                If $FB <> "" Then
                    IniWrite($SetSync, $New, "Destination", $FB)
                    GUICtrlSetData($Input2, $FB)
                Else
                    MsgBox(0, "Error", "대상이 선택되지 않았습니다.")
                EndIf
                _SelectCombo()
                GUICtrlSetData($sName, $New)
                GUICtrlSetData($Select, $New, $New)
                _SyncCheck()
            EndIf
        Case $msg = $Button4
            $Check = GUICtrlRead($sName)
            If MsgBox(4, "작업 삭제!", "현재 작업(" & $Check & ")을 삭제합니다.", "", $Form) = 6 Then
                IniDelete($SetSync, $Check, "Source")
                IniDelete($SetSync, $Check, "Destination")
                IniDelete($SetSync, $Check, "sync")
                IniDelete($SetSync, $Check)
                GUICtrlSetData($sName, "Default")
                GUICtrlSetData($Input1, IniRead($SetSync, "Default", "Source", ""))
                GUICtrlSetData($Input2, IniRead($SetSync, "Default", "Destination", ""))
                _SelectCombo()
            EndIf
        Case $msg = $Button5
            _sCommand()
    EndSelect
WEnd

Exit

Func _Mainwindow()
    $Form = GUICreate($sMain, 535, 125, (@DesktopWidth - 535) / 2, (@DesktopHeight - 200) / 2)
    GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
    $jopName = GUICtrlCreateLabel("작   업 :", 8, 10, 44, 25)
    $sName = GUICtrlCreateLabel("Default", 66, 10, 200, 25)
    GUICtrlSetFont(-1, 9, 800, 0, "굴림")
    $Label1 = GUICtrlCreateLabel("원   본 :", 8, 35, 44, 25)
    $Label2 = GUICtrlCreateLabel("대   상 :", 8, 61, 44, 25)
    $Input1 = GUICtrlCreateInput("", 64, 32, 400, 21)
    GUICtrlSetData(-1, $FSource)
    $Input2 = GUICtrlCreateInput("", 64, 57, 400, 21)
    GUICtrlSetData(-1, $FDest)
    $Button1 = GUICtrlCreateButton("찾기...", 470, 30, 56, 25)
    $Button2 = GUICtrlCreateButton("찾기...", 470, 55, 56, 25)
    $Label3 = GUICtrlCreateLabel("선   택 :", 8, 97, 44, 25)
    $Radio1 = GUICtrlCreateRadio("동기화", 64, 90, 60, 25)
    _RadioCheck()
    $Radio2 = GUICtrlCreateRadio("백 업", 130, 90, 50, 25)
    _RadioCheck()
    $Select = GUICtrlCreateCombo("", 185, 93, 110, 25)
    _SelectCombo()
    $Button3 = GUICtrlCreateButton("작업 추가", 307, 90, 70, 25, 0)
    $Button4 = GUICtrlCreateButton("작업 삭제", 382, 90, 70, 25, 0)
    $Button5 = GUICtrlCreateButton("실   행", 457, 90, 70, 25, 0)
    GUICtrlSetState(-1, $GUI_FOCUS)
    GUISetState()
EndFunc

Func _SelectCombo()
    $j = ""
    $var = IniReadSectionNames($SetSync)
    For $i = 1 To $var[0]
        $j = $j & "|" & $var[$i]
        GUICtrlSetData($Select, $j, "Default")
    Next
EndFunc

Func _sCommand()
    Local $Source = GUICtrlRead($Input1)
    Local $Dest = GUICtrlRead($Input2)
    Local $sJop = GUICtrlRead($sName)
    Local $sCase = IniRead($SetSync, $sJop, "sync", "")
    Switch $sCase = "0"
        Case True
            $sPDI = Run(@ComSpec & " /c xcopy " & Chr(34) & $Source & Chr(34) & " " & Chr(34) & $Dest & Chr(34) & "\" & " /c /d /e /k /h /y")
        Case False
            $sPDI = Run(@ComSpec & " /c xcopy " & Chr(34) & $Source & Chr(34) & " " & Chr(34) & $Dest & Chr(34) & "\" & " /c /d /e /k /h /y && xcopy " & Chr(34) & $Dest & Chr(34) & " " & Chr(34) & $Source & Chr(34) & "\" & " /c /d /e /k /h /y")
    EndSwitch
    _sMoveCMD()
    While 1
        Sleep(250)
        If ProcessExists($sPDI) = 0 Then
            SplashTextOn("", "모든 작업이 성공적으로 완료되었습니다.", "400", "50",(@DesktopWidth - 400) / 2, (@DesktopHeight - 50) / 2, 33, "맑은 고딕","14","400")
            Sleep(1500)
            SplashOff()
            ExitLoop
        EndIf
    WEnd
EndFunc

Func _RadioCheck()
    Local $sJop = GUICtrlRead($sName)
    If IniRead($SetSync, $sJop, "sync", "") = 1 Then
        GUICtrlSetState($Radio1, $GUI_CHECKED)
    Else
        GUICtrlSetState($Radio2, $GUI_CHECKED)
    EndIf
EndFunc

Func _SyncCheck()
    Local $Check = GUICtrlRead($sName)
    Local $CheckSet = GUICtrlRead($Radio1)
    If $CheckSet = 1 Then
        IniWrite($SetSync, $Check, "sync", "1")
    Else
        IniWrite($SetSync, $Check, "sync", "0")
    EndIf
EndFunc

Func _sMoveCMD()
    WinWaitActive("[Class:ConsoleWindowClass]", "", 1)
    WinMove("[CLASS:ConsoleWindowClass]", "", (@DesktopWidth - 677) / 2, (@DesktopHeight - 520) / 2)
    WinActivate("[Class:ConsoleWindowClass]", "")
EndFunc

 

펌 // http://blog.naver.com/seongwk?Redirect=Log&logNo=70122793090

posted by 범벙이 2012. 9. 5. 10:49
#NoTrayIcon
#RequireAdmin

Switch @OSArch
    Case "X86"
        $sOS_Arch = "wrar411kr.exe"
    Case "X64"
        $sOS_Arch = "winrar-x64-411kr.exe"
EndSwitch

Global $url_rar = "http://www.rarlab.com/rar/" & $sOS_Arch
Global $file_path = @TempDir & "\" & $sOS_Arch
Global $info_setup = "한글 WinRAR archiver 4.11 (" & @OSArch & ")"
Global $program_dir = "C:\Program Files\WinRAR"

If FileExists($program_dir & "\WinRAR.exe") Then
    Local $fileversion1 = FileGetVersion($program_dir & "\WinRAR.exe")
    Local $fileversion2 = "4.11.0.0"
    If $fileversion1 <> $fileversion2 Then
        RunWait($program_dir & "\Uninstall.exe /s")
        _Execute()
    Else
        MsgBox(0, "WinRAR", "최신 버전을 사용중입니다.")
        Exit
    EndIf
Else
    _Execute()
EndIf

Func _Execute()
    DownSplash($url_rar, $file_path, $info_setup)
    RunWait($file_path & " /s")
    make_rarkey()
    MsgBox(0 + 64 + 4096, "한글 WinRAR v4.11 Setup", $info_setup & " 설치가 완료되었습니다.", 2)
    Run($program_dir & "\WinRAR.exe")
    FileDelete($file_path)
EndFunc

Func DownSplash($sFileURL, $sFileSave, $sFileInfo)
    $iTotalSize = InetGetSize($sFileURL)
    ProgressOn($sFileInfo & " 다운로드", "다운로드 진행 상황", "0% 다운로드 중...")
    $sDownload = InetGet($sFileURL, $sFileSave, 1, 1)
    Do
        Sleep(200)
        $iGetDownSize = InetGetInfo($sDownload, 0)
        $iPercent = Ceiling(($iGetDownSize / $iTotalSize) * 100)
        ProgressSet($iPercent, $iPercent & "% 다운로드 중...")
    Until InetGetInfo($sDownload, 2)
    ProgressSet(100, "다운로드를 완료하였습니다.", "완료")
    InetClose($sDownload)
    Sleep(200)
    ProgressOff()
EndFunc

Func make_rarkey()
    Local $key
    If FileExists($program_dir & "\rarreg.key") Then FileDelete($program_dir & "\rarreg.key")
    $key = "RAR registration data" & @CRLF
    $key &= "Administrator" & @CRLF
    $key &= "Enhanced Corporate" & @CRLF
    $key &= "UID=ffd17c293f42b94c3b28" & @CRLF
    $key &= "64122122503b281646f59a96b629958adcc52afe077f0682246ae5" & @CRLF
    $key &= "54958b9c467ab240e5a9608a7f3372a80923a74c55e23fa85f410f" & @CRLF
    $key &= "986b55ba1f344cb54742558c4674bec2f3f44597a594b865433801" & @CRLF
    $key &= "d13141516c4c47c869c2b76309785d3d05606909687ce7e79c91d7" & @CRLF
    $key &= "050a8254ed73508f5ca65007653492ae03ae96f7b77dafdce6140c" & @CRLF
    $key &= "bfebaaa0c3514f197a99b9c3590b2d0d110aa2ba37d8a72160ada7" & @CRLF
    $key &= "54fd3db8746dc7706cb36e57a5777074d497fa6d53592378887116" & @CRLF
    Local $regist = FileOpen($program_dir & "\rarreg.key", 2)
    FileWrite($regist, $key)
    FileClose($regist)
EndFunc


펌 // http://blog.naver.com/seongwk?Redirect=Log&logNo=70122793090

posted by 범벙이 2012. 9. 5. 10:44

Switch @OSArch
    Case "X86"
        $sOS_Arch = "wrar411kr.exe"
    Case "X64"
        $sOS_Arch = "winrar-x64-411kr.exe"
EndSwitch

..............................................................

 

 If @OSArch = "X86" Then
 FileCopy(@ScriptDir & "\App\x86\pwdrvio.sys", @SystemDir & "\pwdrvio.sys")
ElseIf @OSArch = "X64" Then
 FileCopy(@ScriptDir & "\App\x64\pwdrvio.sys", @SystemDir & "\pwdrvio.sys")
EndIf

.............................................................