droide01
Wanderer

using XCopyFiles with open processes

Hi,

I´m using XCopyFiles to copy all files from a directory include SubDirectories. 

nRes = XCopyFile(sourceDir, TargetDir,COMP_NORMAL | INCLUDE_SUBDIR) ;

My problem is there is some files exe, that could be executing and when I try to copy them, I recieve an error Message and the process finalize.

I have seen some instalators that show a standard windows indicating " there is a process that not permitted to copy the file. Please, close it.

Has someone know to use that dialog.

is there any way to solve the problem.

I have thougth that a solution, making my own XCopyFile as a recursive process using fileCopy, but i don`t know if it´s the best solution.

Thanks for your help.

Best regards

Labels (1)
0 Kudos
7 Replies
varul
Revenera
Revenera

What is your project type?

 

Is any process or service is using the files being copied then kill or stop the service before copying the files, try killprocess customaction or stop service function

https://docs.revenera.com/installshield22helplib/helplibrary/CAKillProcess.htm#:~:text=Right%2Dclick....

https://docs.revenera.com/installshield26helplib/LangRef/ServiceStopService.htm

0 Kudos

It is a InstallScript MSI proyect.

Thanks for your help, Kudos. I`m going to see the links.

 

BR

 

0 Kudos

Thanks varul,

I have seen the links, but my problems is that I dont know what is the process.

I have a folder with 300 files, and I don´t know which exe file is started. So when I going to copy all files, the process is stopped because of one exe file is executing.

I would like to control this sequence and show a message for avoiding the error.

Is there any way to do this?

 

BR

0 Kudos

Could you please explain your use case, why you are moving this file from one folder to other? 

when you are doing this at the time of upgrading (like from upgrading from version1 to version2 time)

0 Kudos

Ok,

I have a file in SRC_DIR called bin, when I execute the setup, I check one variable in the Registry.

After that, I use this value, for example, C:\Target to copy the files from SRC_DIR.

These files dont belong to any component. 

The problem ocurrs when one file that I going to copy is in execution

 

 

 

 

 

0 Kudos

You need to find the specific file which is holding the process, until the files process is stopped we wont be able to copy the files.

0 Kudos

The problem is the XCopyFile. It´s a atomic function and don´t give me any information about the error.

Any ideas?

0 Kudos