mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Fixing EACCES error
That occurs when trying to copy the ______.exe when you already have it running in the destination folder.
This commit is contained in:
parent
102e0aea6c
commit
505f4214c1
1 changed files with 9 additions and 5 deletions
|
|
@ -279,13 +279,17 @@ module Script
|
|||
def self.copy_journal
|
||||
Dir.mkdir(Oneshot::DOCS_PATH + "\\My Games") unless File.exists?(Oneshot::DOCS_PATH + "\\My Games")
|
||||
Dir.mkdir(Oneshot::DOCS_PATH + "\\My Games\\Oneshot") unless File.exists?(Oneshot::DOCS_PATH + "\\My Games\\Oneshot")
|
||||
File.open("_______.exe", "rb") do |input|
|
||||
File.open(Oneshot::DOCS_PATH + "\\My Games\\Oneshot\\_______.exe","wb") do |output|
|
||||
while buff = input.read(4096)
|
||||
output.write(buff)
|
||||
begin
|
||||
File.open("_______.exe", "rb") do |input|
|
||||
File.open(Oneshot::DOCS_PATH + "\\My Games\\Oneshot\\_______.exe","wb") do |output|
|
||||
while buff = input.read(4096)
|
||||
output.write(buff)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
rescue Errno::EACCES => e
|
||||
#this probably means the clover.exe already exists and is running, so no need to create it again
|
||||
end
|
||||
if File.exists?("README.txt")
|
||||
File.open("README.txt", "rb") do |input|
|
||||
File.open(Oneshot::DOCS_PATH + "\\My Games\\Oneshot\\README.txt","wb") do |output|
|
||||
|
|
|
|||
Loading…
Reference in a new issue