Sign in to follow this  
Followers 0
emendelson

Exe files not included when compiled?

4 posts in this topic

#1 ·  Posted (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 by Edward Mendelson

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

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...)

Share this post


Link to post
Share on other sites

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)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0