PDA

View Full Version : Newbe question



NewsArchive
06-16-2017, 01:54 AM
I'm tring to copy the files from the old version to the new one.
It's working, but as they are almost 200 files it take a little time.
Can I make the progressbar uptading as a file is copied?
Here is my basic script:
If %_SB_INSTALLDIR%\PROCHEFF "File or Folder exists" Then
Display Message Box ("Do you want to import the old data?", "Import")
If %_SB_RETURN% Equals "6" Then
Progress Dialog: Set Status Text #1 to "Coping files:"
Progress Dialog: Set Progress Bar to "[Auto Update]"
Copy File(s) from "%_SB_INSTALLDIR%\ProCheff\*.tps" to
"%_SB_INSTALLDIR%\Exec\ProCheff" [Permanent] [RemoveReadOnly]
Rename File/Folder "%_SB_INSTALLDIR%\ProCheff" to
"%_SB_INSTALLDIR%\ProCheffv3"
Progress Dialog: Set Status Text #1 to "Instaling new files:"
End
End

Peter Kompier

NewsArchive
06-20-2017, 07:11 AM
Peter,

the Copy File(s) action does not support copying data with progress.

I'll check if it is possible to add an option to handle it.

Friedrich

NewsArchive
06-20-2017, 01:39 PM
Maybe with SHFileOperation.

Jeff Slarve
www.jssoftware.com

WAG, the dog?

NewsArchive
06-20-2017, 01:39 PM
Hi Jeff,

>
> Maybe with SHFileOperation.
>

I think Peter would like to display a separate (2nd) progress bar for the
"copy 200 files" action when using *.tps wildcards. Similar to the 2nd
progress bar when installing a large file.

To do this, the runtime internally has to execute the "Copy File(s)" action
twice (for wildcards). In the first call, count the number of *.tps files
to be processed and do not copy. Then in the second step, call the "Copy
File(s)" action again, but this time handle the "real" copy file process
(and update the 2nd progress bar for the 200 files).

Unfortunately, SHFileOperation is not (fully) backward compatible with older
Windows versions. The same is true for the CopyFileEx Windows API. So the
only solution is to use a CopyFile Windows API wrapper.

Friedrich