AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

right-click compile - fails but original file gets deleted

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
corrupt



Joined: 29 Dec 2004
Posts: 2381

PostPosted: Sun Sep 16, 2007 5:09 am    Post subject: right-click compile - fails but original file gets deleted Reply with quote

On the PC I'm currently using I have a few mapped drives that do not connect automatically. I had set ahk2exe to use an icon that resides in one of these locations but had not connected to make the location accessible. When right-clicking to compile I got the following message:
Quote:
---------------------------
Ahk2Exe Error
---------------------------
Error changing icon: Unable to read icon or icon was of the wrong format.
---------------------------
OK
---------------------------

Although the message is to be expected, I was a bit surprised to see that the original .exe was deleted in the process anyway. Shouldn't ahk2exe either produce an exe with the default icon instead or display an error message and leave the original .exe alone? Deleting the original .exe without producing a file to replace it seems like a bug to me...
Back to top
View user's profile Send private message Visit poster's website
Lexikos



Joined: 17 Oct 2006
Posts: 2472
Location: Australia, Qld

PostPosted: Sun Sep 16, 2007 6:26 pm    Post subject: Reply with quote

I think I've seen that before, when the script fails to compile because of a script error (or maybe it was also icon-not-found?). I guess ahk2exe opens the file for writing (implicitly deleting the existing file) before it knows for sure if it will succeed. Perhaps it should rename the original file first?
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Sun Nov 11, 2007 11:13 pm    Post subject: Reply with quote

Sorry for the late reply. The compiling process goes through a fairly large number of stages, many of which require that the EXE be open for writing. So retaining the original file would probably require that a backup be made and the original restored at each point of failure (as was suggested). However, since the consequences of deleting the EXE file are seldom of concern, and since I'm not well versed in the ahk2exe code, this modification seems to have a poor benefit/cost and thus a low priority.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group