Archive: File Overwrite problem


File Overwrite problem
kind Attn. Afrow UK

Dear sir,

!macro Overwrite Source Destination
File `/oname=${Destination}.new` `${Source}`
Rename /rebootok `${Destination}.new` `${Destination}`
!macroend
!define Overwrite `!insertmacro Overwrite`

I have included above said code in my program. But problem with this is even if the program which is to be overwritten is not running, the source file will be renamed to .new and ask for reboot. pls let me know how to check whether the file exists, if exists whether it is running then only rename it to .new and reboot if not overwrite the file. thanks in advance.

regards.
Devdas M. kamath:cool:


!macro Overwrite Source Destination
File `/oname=${Destination}.new` `${Source}`
Delete /rebootok `${Destination}`
Rename /rebootok `${Destination}.new` `${Destination}`
!macroend
!define Overwrite `!insertmacro Overwrite`

Stu