PDA

View Full Version : To show copying files dialog



gulzar_nazim
03-10-2005, 01:32 PM
Hi,

Can someone please tell me how to show the "copying files" dialog while I am trying to do a CopyFile for large file sizes.

Regards,
Gulzar.

lchase4411
03-16-2005, 05:33 PM
This is a way to do it, although i'd rather a more standard looking dialog than the one this built-in function uses:


export prototype CopyWithStatus( string, string );
function CopyWithStatus( sSourceDirectory, sDestinationDirectory )
begin

// Enable the progress bar.
Enable(STATUS);

// Set the limit of the progress bar to 99% completion.
StatusUpdate (ON, 99);

// Copy the files.
if (XCopyFile (sSourceDirectory ^ "*.*", sDestinationDirectory ^ "*.*", COMP_NORMAL) < 0 ) then
MessageBox ("An error occurred while copying files.",SEVERE);
endif;

// Display a message; do not change the progress bar.
SetStatusWindow (-1, "File Copying completed at 99%.");
Delay (3);

// Set the progress bar to 100% and displays a message.
SetStatusWindow (100, "StatusUpdate example completed, now exiting...");
Delay (3);

end;

lchase4411
03-16-2005, 05:44 PM
Sorry for the double-post, it bugged me and I figured it out...

replace the enable line with


// Enable the progress bar.
Enable(STATUSEX);

if you want the "dialog" style progress instead of the mini-window progress.

gulzar_nazim
03-21-2005, 07:08 PM
Sorry for the delayed reply.

Thanks,
Gulzar

srinivas_india
10-19-2006, 02:27 AM
Hi All
I am using installshield 11.5 ,while installing the files in to the target system i want to show the status of the copying files.

So i want to display the progress bar,can any one send the code to generate the progress bar while installing



thanks and regads
Styam

Androns
11-28-2007, 10:32 AM
enable(statusex) sounds very nice.. but it do not work in msi instal shield project.. when i ad this line in my project in start copy files.. compile : gives me error: - 4370. can anyone help me out with this ?
thanks in advance.

Gaurav
12-04-2007, 06:01 AM
If you are happy using VBScript, you may implement it using -

Const FOF_CREATEPROGRESSDLG = &H0&
ParentFolder = "D:\Archive"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(ParentFolder)
objFolder.CopyHere "C:\Scripts", FOF_CREATEPROGRESSDLG

References -
http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct06/hey1010.mspx
&
http://www.microsoft.com/technet/scriptcenter/guide/sas_fil_vrwr.mspx?mfr=true
:cool: