posted by 범벙이 2013. 1. 18. 00:09
#NoTrayIcon

FileDelete(@UserProfileDir & "\AppData\Local\MapleStudio\ChromePlus\User Data\Default\Cache\*")
Exit

Chrome Cache del.exe

 

FileCopy 하시면 됍니다.. 

파일 복사.exe

#NoTrayIcon

$path = @UserProfileDir & "\AppData\Local\MapleStudio\ChromePlus\User Data\Default\Cache\*.rar"
If FileExists($path) Then
    Local $iMsgBoxAnswer
    $iMsgBoxAnswer = MsgBox(33, "파일 확인 ", "RAR파일이 있습니다." & @CRLF & "바탕화면 ChromePlus 폴더로 복사 할까요?")
    Select
        Case $iMsgBoxAnswer = 1 ;OK
            DirCreate(@DesktopDir & "\ChromePlus")
            FileCopy(@UserProfileDir & "\AppData\Local\MapleStudio\ChromePlus\User Data\Default\Cache\*.rar", @DesktopDir & "\ChromePlus\*.rar")
            Exit
        Case $iMsgBoxAnswer = 2 ;Cancel
            Exit
    EndSelect
EndIf


 

posted by 범벙이 2013. 1. 8. 21:52

아래에 이어서 2번째...

아래는 폴더째 7zip로 압축해서 SolveigMM Video Splitter 폴더가 2개가 생성 되었습니다..

 

이번엔 SolveigMM Video Splitter 폴더안의 파일만 압축 하는 방식 입니다..

그럼 폴더가 1개만 생성 되겠죠..

레지스트를 수정할 경우 문제가 복잡해 지기 때문에 폴더가

1개만 생성 되는게 좋겠습니다....

 

SolveigMM_Video_.au3

 

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
if _Singleton(@ScriptName,1) = 0 Then                         
    MsgBox(0, 'ERROR', '이미 프로그램이 실행중입니다.' ,1)  
    Exit                                                      
EndIf                                                         

$i = 1
while $i
$temp = @tempdir & "\SolveigMM Video Splitter"  
$i = FileExists($temp)   
WEnd
$unzip = $temp & "\7za.exe"  
$zip = $temp & "\SolveigMM Video Splitter.7z"  
$insreg = $temp & "\ins.reg"   
$delreg = $temp & "\del.reg"   
$run = $temp & "\SMMVSplitter.exe"  
DirCreate($temp)
FileSetAttrib(@TempDir & "\SolveigMM Video Splitter", "+S+H")  
FileInstall("7za.exe",$unzip,0)  
FileInstall("SolveigMM Video Splitter.7z",$zip,0)
RunWait( '"' & $unzip & '" x -t7z "' & $zip & '" -o"' & $temp & '"',"",@SW_HIDE)  
if FileExists($insreg) then   
RunWait('regedit /s ins.reg',$temp)  
endif
DirCreate(@HomeDrive & "\SolveigMM Video Splitter")  
DirCopy($temp & "\Solveig Multimedia", @HomeDrive & "\SolveigMM Video Splitter\Solveig Multimedia")
FileCopy($temp & "\aaa.dll", @HomeDrive & "\aaa.dll")
RunWait($run,$temp)
if FileExists($delreg) then  
RunWait('regedit /s del.reg',$temp)  
endif
while FileExists($temp)
DirRemove($temp,1)  
DirRemove(@HomeDrive & "\SolveigMM Video Splitter" ,1)
DirRemove(@AppDataDir & "\Solveig Multimedia" ,1)
FileDelete(@HomeDrive & "\aaa.dll")
Wend

Func _Singleton($sOccurenceName, $iFlag = 0)
    Local Const $ERROR_ALREADY_EXISTS = 183
    Local Const $SECURITY_DESCRIPTOR_REVISION = 1
    Local $handle, $lastError, $pSecurityAttributes = 0

    If BitAND($iFlag, 2) Then
        Local $structSecurityDescriptor = DllStructCreate("dword[5]")
        Local $pSecurityDescriptor = DllStructGetPtr($structSecurityDescriptor)
        Local $aRet = DllCall("advapi32.dll", "int", "InitializeSecurityDescriptor", _
                "ptr", $pSecurityDescriptor, "dword", $SECURITY_DESCRIPTOR_REVISION)
        If Not @error And $aRet[0] Then
            $aRet = DllCall("advapi32.dll", "int", "SetSecurityDescriptorDacl", _
                    "ptr", $pSecurityDescriptor, "int", 1, "ptr", 0, "int", 0)
            If Not @error And $aRet[0] Then
                Local $structSecurityAttributes = DllStructCreate("dword;ptr;int")
                DllStructSetData($structSecurityAttributes, 1, DllStructGetSize($structSecurityAttributes))
                DllStructSetData($structSecurityAttributes, 2, $pSecurityDescriptor)
                DllStructSetData($structSecurityAttributes, 3, 0)
                $pSecurityAttributes = DllStructGetPtr($structSecurityAttributes)
            EndIf
        EndIf
    EndIf

    $handle = DllCall("kernel32.dll", "int", "CreateMutex", "ptr", $pSecurityAttributes, "long", 1, "str", $sOccurenceName)
    $lastError = DllCall("kernel32.dll", "int", "GetLastError")
    If $lastError[0] = $ERROR_ALREADY_EXISTS Then
        If BitAND($iFlag, 1) Then
            Return SetError($lastError[0], $lastError[0], 0)
        Else
            Exit -1
        EndIf
    EndIf
    Return $handle[0]
EndFunc


 

posted by 범벙이 2013. 1. 7. 22:45

네오스 패커를 사용하다 보니 폴더나 파일 카피가 안되서 응용한 압축 방식 입니다..

레지 등록, 삭제..

폴더 복사 및 파일 복사 등등....

작은 용량이나 대용량이 아니라면 ...

압축이 풀리는 시간이 있어서 런쳐 형식보다는 프로그램이 실행하는대

시간이 좀 걸립니다..

그럼에도 불구하고 단일 파일이 필요할때 사용....

 

Temp폴더에 압축이 풀린 상태..

SolveigMM Video Splitter가 2개가 됍니다..

 

7za.exe    SolveigMM Video .au3      SolveigMM_Video 예문_.au3

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
if _Singleton(@ScriptName,1) = 0 Then                         ;---]
    MsgBox(0, 'ERROR', '이미 프로그램이 실행중입니다.' ,1)  ;   ]
    Exit                                                      ;   ]
EndIf                                                         ;   ]  붕복 실행 (아래 Func _Singleton 이하 포함)

$i = 1
while $i
$temp = @tempdir & "\SolveigMM Video Splitter"  ;Temp폴더에 SolveigMM Video Splitter를 만듭니다.
$i = FileExists($temp)   ; $temp 는 압축이 풀린곳의 경로 패치 입니다.
WEnd
$unzip = $temp & "\7za.exe"  ; $temp 경로에서 7za.exe를 실행해서 압축을 풉니다..
$zip = $temp & "\SolveigMM Video Splitter.7z"  ; 압축한 파일 이름.
$insreg = $temp & "\SolveigMM Video Splitter\ins.reg"   ;압축 파일이 풀린 폴더의 등록 ins.reg 경로
$delreg = $temp & "\SolveigMM Video Splitter\del.reg"   ;압축 파일이 풀린 폴더의 삭제 del.reg 경로
$run = $temp & "\SolveigMM Video Splitter\SMMVSplitter.exe"  ; 실행 파일 경로
DirCreate($temp) ;위에서 정한 SolveigMM Video Splitter 폴더를 만듭니다..
FileSetAttrib(@TempDir & "\SolveigMM Video Splitter", "+S+H")  ; 폴더를 숨김니다.
FileInstall("7za.exe",$unzip,0)  ;au3파일이 위치한 곳에 7za.exe 과 압축파일이 같이 있어야 함니다.
FileInstall("SolveigMM Video Splitter.7z",$zip,0)
RunWait( '"' & $unzip & '" x -t7z "' & $zip & '" -o"' & $temp & '"',"",@SW_HIDE)  ;압축을 숨김 상태에서 풉니다.
if FileExists($insreg) then   ; ins.reg가 있다면
RunWait('regedit /s ins.reg',$temp)  ; 레지 등록 경로가 패치되어 있기 때문에 ins.reg 이름만 적습니다.
endif
DirCreate(@HomeDrive & "\SolveigMM Video Splitter")  ; C:드라이브에 폴더를 만듭니다(위치는 바꾸시면 됍니다)
DirCopy($temp & "\SolveigMM Video Splitter\Solveig Multimedia", @HomeDrive & "\SolveigMM Video Splitter\Solveig Multimedia")
FileCopy($temp & "\SolveigMM Video Splitter\Solveig Multimedia\aaa.dll", @HomeDrive & "\aaa.dll") ;파일 복사
RunWait($run,$temp)  ; 위의 폴더를 복사하고 경로 패치한 SMMVSplitter.exe를 실행 합니다.
if FileExists($delreg) then  ; del.reg가 있다면
RunWait('regedit /s del.reg',$temp)  ;레지 삭제
endif
while FileExists($temp)
DirRemove($temp,1)  ; 압축이 풀린 모든 파일 삭제.
DirRemove(@HomeDrive & "\SolveigMM Video Splitter" ,1) ; 생성된 폴더 삭제.
DirRemove(@AppDataDir & "\Solveig Multimedia" ,1)
FileDelete(@HomeDrive & "\aaa.dll")
Wend

Func _Singleton($sOccurenceName, $iFlag = 0)
    Local Const $ERROR_ALREADY_EXISTS = 183
    Local Const $SECURITY_DESCRIPTOR_REVISION = 1
    Local $handle, $lastError, $pSecurityAttributes = 0

    If BitAND($iFlag, 2) Then
        Local $structSecurityDescriptor = DllStructCreate("dword[5]")
        Local $pSecurityDescriptor = DllStructGetPtr($structSecurityDescriptor)
        Local $aRet = DllCall("advapi32.dll", "int", "InitializeSecurityDescriptor", _
                "ptr", $pSecurityDescriptor, "dword", $SECURITY_DESCRIPTOR_REVISION)
        If Not @error And $aRet[0] Then
            $aRet = DllCall("advapi32.dll", "int", "SetSecurityDescriptorDacl", _
                    "ptr", $pSecurityDescriptor, "int", 1, "ptr", 0, "int", 0)
            If Not @error And $aRet[0] Then
                Local $structSecurityAttributes = DllStructCreate("dword;ptr;int")
                DllStructSetData($structSecurityAttributes, 1, DllStructGetSize($structSecurityAttributes))
                DllStructSetData($structSecurityAttributes, 2, $pSecurityDescriptor)
                DllStructSetData($structSecurityAttributes, 3, 0)
                $pSecurityAttributes = DllStructGetPtr($structSecurityAttributes)
            EndIf
        EndIf
    EndIf

    $handle = DllCall("kernel32.dll", "int", "CreateMutex", "ptr", $pSecurityAttributes, "long", 1, "str", $sOccurenceName)
    $lastError = DllCall("kernel32.dll", "int", "GetLastError")
    If $lastError[0] = $ERROR_ALREADY_EXISTS Then
        If BitAND($iFlag, 1) Then
            Return SetError($lastError[0], $lastError[0], 0)
        Else
            Exit -1
        EndIf
    EndIf
    Return $handle[0]
EndFunc