emendelson Posted May 21, 2006 Posted May 21, 2006 (edited) I'm working on a script that runs perfectly when it's run as an .au3 file, but fails in various places when compiled - and I finally figured out that the three 16-bit DOS executable EXE files which I FileInclude() in the script were not getting written to disk from the compiled version. Is this an issue that everyone except me knows how to resolve? I couldn't find anything about it here, but it seems fairly consistent. Any advice would be very welcome. Here's a bit of relevant code: If Not FileExists(@TempDir & "\macascii.exe") Then FileInstall("V:\DirMonFiles\macascii.exe", @TempDir, 1) EndIf If Not FileExists(@TempDir & "\wp.mrs") Then FileInstall("V:\DirMonFiles\wp.mrs", @TempDir, 1) EndIf In the compiled version, only wp.mrs gets written to disk, not macasii.exe. In the script version, both get written to disk. Edited May 21, 2006 by Edward Mendelson
Moderators SmOke_N Posted May 21, 2006 Moderators Posted May 21, 2006 (edited) All you have is @TempDir, the help file says Dest with Trailing Backslash... Try @TempDir & '\macascii.exe' , I don't know if that will make a difference. Edit: Also, it looks like you altered the code. I say that because the Indentation for the second If statement is over as if it were a secondary statement at one time. Edited May 21, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
emendelson Posted May 21, 2006 Author Posted May 21, 2006 All you have is @TempDir, the help file says Dest with Trailing Backslash... Try @TempDir & '\macascii.exe' , I don't know if that will make a difference.Edit:Also, it looks like you altered the code. I say that because the Indentation for the second If statement is over as if it were a secondary statement at one time.I was about to come back and say that I found the same answer, more or less. There's an inconsistency between the way scripts work when run by the interpreter (as scripts) and the way they run as executables.The syntax in my original post works when the script is run through the interpreter because the interpreter correctly copies \path\file.exe to @TempDir. However, when the script is compiled the destination has to read @TempDir & "\file.exe". This seems to be a fairly serious stumbling block - maybe the interpreter should be less forgiving?Anyway, as soon as I made this change, the executable worked.(The inconsistent indentation resulted from copying and pasting - it's correct in my Tidy-treated code...)
Developers Jos Posted May 21, 2006 Developers Posted May 21, 2006 I was about to come back and say that I found the same answer, more or less. There's an inconsistency between the way scripts work when run by the interpreter (as scripts) and the way they run as executables.The syntax in my original post works when the script is run through the interpreter because the interpreter correctly copies \path\file.exe to @TempDir. However, when the script is compiled the destination has to read @TempDir & "\file.exe". This seems to be a fairly serious stumbling block - maybe the interpreter should be less forgiving?Anyway, as soon as I made this change, the executable worked.(The inconsistent indentation resulted from copying and pasting - it's correct in my Tidy-treated code...)You have to at least add a "\" after tempdir for the fileinstall to work properly in compiled scripts:FileInstall("V:\DirMonFiles\macascii.exe", @TempDir & "\", 1) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now