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:
mshirt 2017-01-01 18:25:11 -06:00
parent 102e0aea6c
commit 505f4214c1

View file

@ -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|