Sign in to follow this  
Followers 0
HiSoftDev

FileInstall() with Progress Bar

9 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

but i have no idea on how to do it. any little example of info will be really appreciated.

thanx


Share this post


Link to post
Share on other sites

It was a suggestion. I don't know how to work with resources in AutoIt, sorry.

Share this post


Link to post
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")

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Switch ProgressOn with GUICtrlCreateProgress and ProgressSet with GUICtrlSetData. Look in the help file if you need syntax.

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

Hi, this script, will copy the file, but not with a dialog. My information is in my signature, OS, AutoIt ver, etc.

Share this post


Link to post
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
Sign in to follow this  
Followers 0