Jump to content

Autoıt Birkaç Soru


lazenes1
 Share

Recommended Posts

[center]Merhaba Arkadaşlar Ben Sizlere Bu Konu Altında Birkaç Soru Soracam İnşallah Cevap Ala bilirm
Öncelikle Ben Kendi HardDisk'im deki Oyunlarımı Partlara Böldüm Ve Bu Partları Otomatik Çıkartması İçin Bur Scripth Hazırlamaya çalıştım Fakat Bir Kaç Hatavar Galiba

Aşağıdaki ResimdeArşivin Konumunu Seçiyorum Fakar Progress Hareket Etiremiyorum Bir Çok Kod Denedim Fakatİşlemden Bağımsız Bir Şekide Çalışıyor yani Sorum Şu Progress Bar'ı nasıl Hareket Ettire Bilirim Acaba ?
[img]http://i.minus.com/iq1wgNHAThgk4.JPG[/img]

İkinci Sorum ise Şu Aşağıdaki Resimde Yazan

[img]http://i.minus.com/ibl333aQ53Bdt4.JPG[/img]

Proje Dosyasını Burda :

http://www.mediafire.com/?kodrub7hrymsock
[/center]

ProjeKodlarını:
[code]#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <UnRAR.au3>
#Region ### START Koda GUI section ### Form=
$oyunadi=IniRead("ayar.ini", "oyun", "Adi", "")
$Kurulumdansonra=IniRead("ayar.ini", "oyun", "Kurulumdan_sonra_calistir", "")
$sonpartadi=IniRead("ayar.ini", "oyun", "SonPartAdi", "")
$Form1 = GUICreate("By LaZEnEs"&$oyunadi, 611, 451, 192, 124)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "\Kapak\buda.bmp", 0, 0, 620, 436)
$Edit1 = GUICtrlCreateEdit("", 5, 293, 369, 130)
$raryolu = IniRead("ayar.ini", "oyun", "part1", "")
$ArchiveFile =@ScriptDir & "\" & $raryolu
GUICtrlSetData(-1, StringFormat("Otomatik Part Çıkartıcı :)"))
GUICtrlSetState(-1, $GUI_DISABLE)
$Progress1 = GUICtrlCreateProgress(8, 270, 150, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $Cancel = False

HotKeySet("{Esc}", "_CancelUnpack")

;Creates a user-defined DLL Callback function to process Unrar events
$hUnRAR_CallBack = DllCallbackRegister("_UnRARProc", "int", "uint;int;int;int")
$OutputFolder = FileSelectFolder("Oyunun Kurulum Dosyaları Nereye Çıkartılsın?", "", 1)
If $OutputFolder = "" Then Exit

;Retrieve comment from archive file
$comment = _Rar_GetComment($ArchiveFile)
ConsoleWrite("!> Arşiv Açıklaması: " & $comment & @LF)

;Open RAR archive and allocate memory structures
$hArchive = _RAR_OpenArchive($ArchiveFile)
If @error Then
MsgBox(16, @error, "Arşiv Açma HATA'sı!")
Exit
EndIf

;Test the current archive file
_Rar_TestArchive($hArchive)
If @error Then
MsgBox(16, "UnRAR", "Arşiv Testinde Hatamaydana Geldi")
Exit
Else
MsgBox(64, "UnRAR", "Arşiv Başarı İle Test Edildi")
EndIf

;Close RAR archive and release allocated memory
_RAR_CloseArchive($hArchive)

;Set a password to decrypt files
;_RAR_SetPassword($hArchive, "MyPassword")

;Returns an integer value denoting UnRAR.dll API version
;_RAR_GetDllVersion()

$hArchive = _RAR_OpenArchive($ArchiveFile)
If @error Then
MsgBox(16, "UnRAR", "Arşiv Açma HATA'sı!")
Exit
EndIf

;Set a user-defined callback function to process Unrar events
_RAR_SetCallback($hArchive, $hUnRAR_CallBack)

;Read header of file in archive, performs action and moves the current position in the archive to the next file
;Also extract or test the current file from the archive
_Rar_UnpackArchive($hArchive, $OutputFolder)
If @error Then
MsgBox(16, "UnRAR", "Arşiv Çıkartma HATA'sı!")
Exit
EndIf

If $Cancel = True Then
MsgBox(64, "UnRAR", "Çıkartma İşlemi İptal Edildi!")
Else
MsgBox(64, "Bitti", "Arşiv Çıkartıldı")
EndIf

DllCallbackFree($hUnRAR_CallBack)

Func _CancelUnpack()
$Cancel = True
EndFunc

Func _UnRARProc($Msg, $UserData, $P1, $P2)
Switch $Msg
Case $UCM_PROCESSDATA ;Return a positive value to continue process or -1 to cancel the archive operation
If $Cancel = True Then Return -1
Case $UCM_NEEDPASSWORD ;DLL needs a password to process archive
Local $iPassGet = InputBox("Şifre Girişi ßy LaZEnEs", "Lütfen Arşiv Şifresini Giriniz", "", "*", 300, 120)
If $iPassGet = "" Then Return -1 ;If user cancelled password entering
Local $PassBuffer = DllStructCreate("char[256]", $P1)
DllStructSetData($PassBuffer, 1, $iPassGet)
Return 1
Case $UCM_CHANGEVOLUME ;Process volume change
If $P2 = $RAR_VOL_ASK Then ;Required volume is absent
Local $iVolGet = InputBox("Bir Sonraki Part Gerekiyor.. ßy LaZEnEs", "Bir Sonraki DVD/CD'yi Takıp Sürücü Adresini Giriniz: ", @ScriptDir&$sonpartadi,"", 300, 120)
If $iVolGet = "" Then Return -1 ;If user cancelled path entering
Local $VolBuffer = DllStructCreate("char[256]", $P1)
DllStructSetData($VolBuffer, 1, $iVolGet)
Return 1
EndIf
EndSwitch
EndFunc
Run($OutputFolder &"\"& $Kurulumdansonra)


[/code]

Link to comment
Share on other sites

Bunu niye winrarın sfx özelliği ile yapmıyorsun? O zaman parçaları otomatik çıkartacaktır zaten...
Winrar sfxte pencere sitili değişitilebiliyordu galiba...

Ayrıca ilgili kodların çalışması için unrar.dll dosyasına ihtiyacında bulunmakta!

Link to comment
Share on other sites

blue_life mantıklı söylüyor sfx çok başarılı bu konuda

ama yok ben Unrar ile yapmak istiyorum dersende
ilgili dosya ve udf belki lazım olur
[b]Unrarudf ve içinde örneğiyle beraber[/b]
[code]http://www.autoitscript.com/forum/index.php?app=core&module=attach&section=attach&attach_id=21447[/code]
[b]unrar.dll[/b]
[code]http://www.autoitscript.com/forum/index.php?app=core&module=attach&section=attach&attach_id=21446[/code]
[b]Her ikisi Ekde[/b]

Edited by MeHMeTBeN
Link to comment
Share on other sites

@lazenes1

Kısaca sana echo örnekleri vereyim. Bu sayede daha iyi kavrarsın!

[codebox]Global $CMD_PARAM = "Echo Selam Millet && Echo Bu tün nasılsınız? && Echo. && Pause"
RunWait(@ComSpec & ' /c ' & $CMD_PARAM, "", @SW_SHOW)[/codebox]

Gizli çalıştırmak için, @SW_SHOW yerine @SW_HIDE kullanacaksın. Ama komutta pause olduğu için programın takılır.
Bu yüzden pauseyi silmelisin. Yani;

[codebox]Global $CMD_PARAM = "Echo Selam Millet && Echo Bu tün nasılsınız? && Echo."
RunWait(@ComSpec & ' /c ' & $CMD_PARAM, "", @SW_HIDE)[/codebox]

Eğer komutu çalıştırdıktan sonra cmd ekranının kapanmamasını istersen /c yerine /k yazmalısın.
Yani;

[codebox]Global $CMD_PARAM = "Echo Selam Millet && Echo Bu tün nasılsınız? && Echo. && Pause"
RunWait(@ComSpec & ' /k ' & $CMD_PARAM, "", @SW_SHOW)[/codebox]

Örneklerde [b]RunWait [/b]kullandığım için cmd işlemi bitene kadar bekliyoruz. Bekleme yapmak istemezsen [b]Run [/b]kullanırsın.

[codebox]Global $CMD_PARAM = "Echo Selam Millet && Echo Bu tün nasılsınız? && Echo. && Pause"
Run(@ComSpec & ' /c ' & $CMD_PARAM, "", @SW_SHOW)
MsgBox(64,"","Alt satırlar...")[/codebox]

vs. vs. gibi örnekleri çoğaltmak mümkün! Umarım açıklayıcı olmuştur...

Link to comment
Share on other sites

_RunDos'u içinde barındıran Process.au3'te _RunDos komutunun içeriğine bakalım,

; #FUNCTION# ====================================================================================================================
; Name...........: _RunDOS
; Description ...: Executes a DOS command in a hidden command window.
; Syntax.........: _RunDOS($sCommand)
; Parameters ....: $sCommand - Command to execute
; Return values .: Success - the exit code of the command
; Failure - 0 and sets @Error to non-zero
; Author ........: Jeremy Landes <jlandes at landeserve dot com>
; ===============================================================================================================================
Func _RunDOS($sCommand)
Local $nResult = RunWait(@ComSpec & " /C " & $sCommand, "", @SW_HIDE)
Return SetError(@error, @extended, $nResult)
EndFunc ;==>_RunDOS

Ve şimdi bir üstte blue_life'ın verdiği örneğe bakıp karşılaştıralım?Hiç bi fark yok sadece @error dönüşü yapılmış.Fakat sadece bi komut için koskoca bi udf eklemek zorunda kalacaktık ki bu çok saçma olur değil mi?

Link to comment
Share on other sites

[font="Georgia"]Çalıştırılabilir program dosyaları için Run komutunu Kullanırız..Bunu yanında ShellExecute komutuda iş görür help dosyasında aratırsan ayrıntılı bilgi bulabilirsiniz.Kolay gelsin[/font]


[codebox]Run(@WindowsDir & "\Notepad.exe", "", @SW_MINIMIZE) ;Min
Run(@WindowsDir & "\Notepad.exe", "", @SW_HIDE) ;Hide[/codebox]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...