Jump to content

FileInstall() with Progress Bar


HiSoftDev
 Share

Recommended Posts

i need to FileInstall() Many Files before starting my program and their size is too big.

FileInstall("F:\Demo.avi", @SystemDir & "\Demo.avi")
FileInstall("F:\Search.avi", @SystemDir & "\Search.avi")
FileInstall("F:\Beat.avi", @SystemDir & "\Beat.avi")
FileInstall("F:\Sound1.MP3", @SystemDir & "\sound1.mp3")
FileInstall("F:\SOUND2.mp3", @SystemDir & "\sound2.mp3")
FileInstall("F:\sound3.mp3", @SystemDir & "\sound3.mp3")
FileInstall("F:\Front.bmp", @SystemDir & "\Front.bmp")
FileInstall("F:\Logo.JPG", @SystemDir & "\Logo.jpg")

now problem is that program starts very late because of installing files to computer and i want to show a Progress Bar in GUI (Loading...) which will tell the user about installing files like a installer telles :)

can any of you point me to direct link? i search but no success... i am still a newbie.

any example please???

thanks in advance for your effort for me!

Edit: there were many \\\ in code. changed to [ code]

Edited by HiSoftDev
Link to comment
Share on other sites

FileInstall is a synchronous function which means it doesn't return until it is finished. You won't be able to do anything while the function is running so there isn't a progress bar that can be updated.

You may look at using a binary data resource and extracting that yourself using a progress bar you also code yourself.

Link to comment
Share on other sites

This should be a bit easier.

ProgressOn(\"Progress Meter\", \"Install Progress\", \"0 percent\")
ProgressSet( 0, 0 & \" percent\")
FileInstall(\"F:\\Demo.avi\",@DesktopDir & \"\\\")
ProgressSet( 50, 50 & \" percent\")
FileInstall(\"F:\\Search.avi\",@DesktopDir & \"\\\")
ProgressSet(100 , \"Done\", \"Complete\")
thanks for it but how can i use in gui Progress?
Link to comment
Share on other sites

I had this one in my "folder-with-old-scripts" (was created by Jos)

;~ 4 Do not display a progress dialog box.  
;~ 8 Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.  
;~ 16 Respond with "Yes to All" for any dialog box that is displayed.  
;~ 64 Preserve undo information, if possible. 
;~ 128 Perform the operation on files only if a wildcard file name (*.*) is specified.  
;~ 256 Display a progress dialog box but do not show the file names.  
;~ 512 Do not confirm the creation of a new directory if the operation requires one to be created.  
;~ 1024 Do not display a user interface if an error occurs.  
;~ 2048 Version 4.71. Do not copy the security attributes of the file. 
;~ 4096 Only operate in the local directory. Don't operate recursively into subdirectories. 
;~ 9182 Version 5.0. Do not copy connected files as a group. Only copy the specified files.  

_FileCopy("C:\Installed Apps\Patches\WindowsXP-KB835935-SP2-ENU.exe","C:\temp")

Func _FileCopy($fromFile,$tofile) 
    Local $FOF_RESPOND_YES = 16
    Local $FOF_SIMPLEPROGRESS = 256
    $winShell = ObjCreate("shell.application")
    $winShell.namespace($tofile).CopyHere($fromFile,$FOF_RESPOND_YES)
EndFunc

Greetz,

Neo

[center][font="Arial"]--- The Neo and Only --- [/font][font="Arial"]--Projects---[/font]Image to Text converterText to ASCII converter[/center]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...