WolfmanTR_ Posted July 22, 2012 Share Posted July 22, 2012 (edited) arkadaşlar program eklenirken progresste görstersin istiyorum ama göstermiyor, neden olmuyor acaba ? birde birden fazla program seçilmiyor .. kullandığım kodlar: [codebox]tDosya = Dialog.FileBrowse(true, "Dosya Seçin", _DesktopFolder, "EXE dosyaları (*.exe)|*.exe|", "", "", false, true) if tDosya[1] ~= "CANCEL" then sDosya = String.SplitPath(tDosya[1]).Filename .. String.SplitPath(tDosya[1]).Extension; function CopyCallback(Source,Destination,Copied,Total) Progress.SetCurrentPos("Progress1", (Copied / Total) * 100); end File.Copy(tDosya[1], _SourceFolder .. "\\Programlar\\" .. sDosya, false, true, false, true, nil) Ekle() Dialog.Message("Silent Setup Box", "Program Başarıyla Eklendi!") end[/codebox] Edited July 22, 2012 by wolfman.tr_ Quote Link to comment Share on other sites More sharing options...
MostWanted Posted July 22, 2012 Share Posted July 22, 2012 function copycallback kısmını if dışına al. Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted July 22, 2012 Author Share Posted July 22, 2012 yaptım ama olmadı, galiba yine yanlışlık yaptım [codebox] tDosya = Dialog.FileBrowse(true, "Dosya Seçin", _DesktopFolder, "EXE dosyaları (*.exe)|*.exe|", "", "", false, true) function CopyCallback(Source,Destination,Copied,Total) if tDosya[1] ~= "CANCEL" then Progress.SetCurrentPos("Progress1", (Copied / Total) * 100); sDosya = String.SplitPath(tDosya[1]).Filename .. String.SplitPath(tDosya[1]).Extension; File.Copy(tDosya[1], _SourceFolder .. "\\Programlar\\" .. sDosya, false, true, false, true, nil) Ekle() Dialog.Message("Silent Setup Box", "Program Başarıyla Eklendi!") end end[/codebox] Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted July 22, 2012 Author Share Posted July 22, 2012 [quote name='wolfman.tr_' date='22 July 2012 - 15:59 ' timestamp='1342965594' post='1223682'] yaptım ama olmadı, galiba yine yanlışlık yaptım [codebox] tDosya = Dialog.FileBrowse(true, "Dosya Seçin", _DesktopFolder, "EXE dosyaları (*.exe)|*.exe|", "", "", false, true) function CopyCallback(Source,Destination,Copied,Total) if tDosya[1] ~= "CANCEL" then Progress.SetCurrentPos("Progress1", (Copied / Total) * 100); sDosya = String.SplitPath(tDosya[1]).Filename .. String.SplitPath(tDosya[1]).Extension; File.Copy(tDosya[1], _SourceFolder .. "\\Programlar\\" .. sDosya, false, true, false, true, nil) Ekle() Dialog.Message("Silent Setup Box", "Program Başarıyla Eklendi!") end end[/codebox] [/quote] Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted July 22, 2012 Share Posted July 22, 2012 [color="#8B0000"]Global Funtions ;[/color] [codebox] function CopyCallback(Source,Destination,Copied,Total) Progress.SetCurrentPos("Progress1", ((Copied/Total) * 100)); end [/codebox] [color="#8B0000"]Kopyalayan Button vs. kodları ;[/color] [codebox] tDosya = Dialog.FileBrowse(true, "Dosya Seçin", _DesktopFolder, "EXE dosyaları (*.exe)|*.exe|", "", "", false, true) if tDosya[1] ~= "CANCEL" then File.Copy(tDosya[1], _SourceFolder.."\\Programlar\\"..String.SplitPath(tDosya[1]).Filename..".exe", true, true, false, true, CopyCallback) Ekle() Dialog.Message("Silent Setup Box", "Program Başarıyla Eklendi!") end [/codebox] Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted July 22, 2012 Author Share Posted July 22, 2012 böyle yaptım ama gene göstermedi... Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted July 23, 2012 Author Share Posted July 23, 2012 [quote name='wolfman.tr_' date='22 July 2012 - 20:00 ' timestamp='1342980001' post='1223768'] böyle yaptım ama gene göstermedi... [/quote] Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted July 23, 2012 Share Posted July 23, 2012 [color="#8B0000"]Bende gösterdi. Projeni özelden veya msn üzerinden at, bakayım.[/color] Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted July 23, 2012 Share Posted July 23, 2012 [color="#8B0000"]Global Functions ;[/color] [codebox] function FileProgress(Source, Destination, Copied, Total, FileCopied, FileTotal) Progress.SetCurrentPos("Progress1", ((Copied/Total) * 100)); end [/codebox] [color="#8B0000"]Kopyalama kodu ;[/color] [code]File.Copy(tDosya[1], _SourceFolder.."\\Programlar\\"..String.SplitPath(tDosya[1]).Filename..".exe", true, true, false, true, FileProgress)[/code] [color="#8B0000"]Ayrıca Action > On Startup kısmına ;[/color] [codebox] if not Folder.DoesExist(_SourceFolder.."\\Programlar") then Folder.Create(_SourceFolder.."\\Programlar"); end [/codebox] [color="#8B0000"]yazmayı unutma.[/color] Quote Link to comment Share on other sites More sharing options...
nightmare3519 Posted July 23, 2012 Share Posted July 23, 2012 (edited) [codebox] tDosya = Dialog.FileBrowse(true, "Dosya Seçin", _DesktopFolder, "EXE dosyaları (*.exe)|*.exe|", "", "", false, true) if tDosya[1] ~= "CANCEL" then sDosya = String.SplitPath(tDosya[1]).Filename .. String.SplitPath(tDosya[1]).Extension; function CopyCallback(Source,Destination,Copied,Total) Progress.SetCurrentPos("Progress1", (Copied / Total) * 100); end File.Copy(tDosya[1], _SourceFolder .. "\\Programlar\\" .. sDosya, false, true, false, true, nil) Ekle() Dialog.Message("Silent Setup Box", "Program Başarıyla Eklendi!") end [/codebox] File.Copy(tDosya[1], _SourceFolder .. "\\Programlar\\" .. sDosya, false, true, false, true, [b][color="#0000FF"]nil[/color][/b]) Sen bu mavi işaretlediğim yeri CopyCallback ile değiştirmeyi denedinmi? fonksiyon boş olursa tabiki çalışmaz Ama Divane abi son noktayı koymuş Edited July 23, 2012 by nightmare3519 Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted July 23, 2012 Author Share Posted July 23, 2012 koydu , çokta iyi oldu. bence globale gerek yok birkaç edit, haloldu, boşuna yordum herkesi [codebox]tDosya = Dialog.FileBrowse(true, "Dosya Seçin", _DesktopFolder, "EXE dosyaları (*.exe)|*.exe|", "", "", false, true) if tDosya[1] ~= "CANCEL" then sDosya = String.SplitPath(tDosya[1]).Filename .. String.SplitPath(tDosya[1]).Extension; function CopyCallback(Source,Destination,Copied,Total) Progress.SetCurrentPos("Progress1", (Copied / Total) * 100); end File.Copy(tDosya[1], _SourceFolder .. "\\Programlar\\" .. sDosya, false, true, false, true, CopyCallback) Ekle() Dialog.Message("Silent Setup Box", "Program Başarıyla Eklendi!") end[/codebox] Quote Link to comment Share on other sites More sharing options...
nightmare3519 Posted July 23, 2012 Share Posted July 23, 2012 Bak çoklu seçim yapmak istiyorsan dialog.filebrowse koduna gir aşağılarda multipleselect diye bi yer var onu true yaptınmı tamamdır Şu anda memeleketteyim amsyi indiremedim Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted July 23, 2012 Share Posted July 23, 2012 [color="#8B0000"]Yalnız multiple select yaparsa, programları tabloya alır. Onu da anca döngü ile kopyalarsınız.[/color] Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted July 23, 2012 Author Share Posted July 23, 2012 (edited) true yaptım ancak, birdenfazla dosya seçiliyor ama 1 tane dosya kopyalıyor. döngüyü nasıl yapacağız, örn verebilirmisin, Edited July 23, 2012 by wolfman.tr_ Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted July 23, 2012 Share Posted July 23, 2012 Sec[1] yazarsan ilk seçilen programı kopyalar tümünü kopyalama içün ; for index,program in pairs (Sec) do sDosya = String.SplitPath(program) File.Copy(program, _SourceFolder .. "\\Programlar\\" .. sDosya.Filename..".exe", false, true, false, true, CopyCallback) end ezbere yazdım, yanlış veya eksikse düzeltirsin artık. Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted July 23, 2012 Author Share Posted July 23, 2012 of.. yanlış yeremi yazıyorum ben.. [codebox]tDosya = Dialog.FileBrowse(true, "Dosya Seçin", _DesktopFolder, "EXE dosyaları (*.exe)|*.exe|", "", "", true, false) if tDosya[1] ~= "CANCEL" then for index,program in pairs (tDosya) do sDosya = String.SplitPath(program) end function CopyCallback(Source,Destination,Copied,Total) Progress.SetCurrentPos("Progress1", (Copied / Total) * 100); end File.Copy(tDosya[1], _SourceFolder .. "\\Programlar\\" .. sDosya, false, true, false, true, CopyCallback) Ekle() Dialog.Message("Silent Setup Box", "Program Başarıyla Eklendi!") end[/codebox] Quote Link to comment Share on other sites More sharing options...
nightmare3519 Posted July 23, 2012 Share Posted July 23, 2012 File.Copy(tDosya[index], .... ) Yazıpta deneyebilirmisin? Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted July 23, 2012 Author Share Posted July 23, 2012 [quote name='nightmare3519' date='23 July 2012 - 21:56 ' timestamp='1343073410' post='1224084'] File.Copy(tDosya[index], .... ) Yazıpta deneyebilirmisin? [/quote] olmadı Quote Link to comment Share on other sites More sharing options...
nightmare3519 Posted July 23, 2012 Share Posted July 23, 2012 (edited) [codebox]tDosya = Dialog.FileBrowse(true, "Dosya Seçin", _DesktopFolder, "EXE dosyaları (*.exe)|*.exe|", "", "", true, false) if tDosya[1] ~= "CANCEL" then for index,program in pairs (tDosya) do sDosya = String.SplitPath(program) end function CopyCallback(Source,Destination,Copied,Total) Progress.SetCurrentPos("Progress1", (Copied / Total) * 100); end File.Copy(tDosya[1], _SourceFolder .. "\\Programlar\\" .. sDosya, false, true, false, true, CopyCallback) Ekle() Dialog.Message("Silent Setup Box", "Program Başarıyla Eklendi!") end[/codebox] function CopyCallback(Source,Destination,Copied,Total) Progress.SetCurrentPos("Progress1", (Copied / Total) * 100); end buradaki end i en sona yazabilirmiain belki bi farkı olur Edited July 23, 2012 by nightmare3519 Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted July 23, 2012 Author Share Posted July 23, 2012 yok olmadı Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.