Open JacobNolan1 opened 2 months ago
Attempted a build to test this, but wasn't successful. Was missing a couple dlls and haven't managed to track down why I don't have them yet.
Thanks - note if you go to "checks" and dig around you can find artifacts for your PR - in this case it is at https://github.com/mhammond/pywin32/actions/runs/8890105083?pr=2251
Awesome thanks Mark. This sorted my issue. I may change the exception output "Failed to move host exe" in the case where the file already exists, it did deceive me for a moment there thinking the process failed completely.
The current error output from MoveFile is "Cannot create a file when file already exists". So I think in this case, where the destination file is still used, MoveFile does fail to replace. Which makes sense.
The install does work regardless if pythonservice.exe is present in the destination dir.
It's important that the move replace the file - if the source file exists it implies pywin32 has been upgraded so the existing target may not work. MoveFileEx
should offer the semantics you needs.
During install perform move of pythonservice.exe instead of file copy to handle .exe always being present in src location.
Additional try-except added to handle continuation of program if fileMove fails.