Jump to content

Exe files not included when compiled?


Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
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...)

Link to comment
Share on other sites

  • Developers

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...