Jump to content

File.copy De Progresste Gösteremedim


WolfmanTR_
 Share

Recommended Posts

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 by wolfman.tr_
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

[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]

Link to comment
Share on other sites

[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]

Link to comment
Share on other sites

[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]

Link to comment
Share on other sites

[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 :D Ama Divane abi son noktayı koymuş ;)

Edited by nightmare3519
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

[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 :D

Edited by nightmare3519
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...