Jump to content

Solution Unable to open the script file...?


 Share

Recommended Posts

After compiling the .au3 on Win 7 64-bit get the "Auto it error : Unable to open the script file" on executing the exe.

searched the forum tried solutions like disabling Trend Micro etc.

Is there any better solution...? Need help.. 

post-87416-0-32968700-1427801638.png

Link to comment
Share on other sites

  • 5 months later...

I'm having the same problem.  The strange thing is that it's intermittent; I can compile it one time and I get the "Unable to open the script file" when I try to run the exe, and another time it works fine.  Computer has Trend antivirus which I'm not able to disable.

It does seem related to the compiler options.  At first I thought it was the compiler not liking the file version I was using (e.g. 1.1 vs. 1.1.0.0) but I couldn't repeat it.  I most recently got it (actually two similar programs, both of which had the same problem) to compile by removing the compiler directives that the previous run had created and making only one change (target file name) in the compiler dialog.

What does that error mean?  What script file is it looking for that it can't find at runtime?

Link to comment
Share on other sites

I have since the very beginning always had issues compiling, it sometimes works first shot, sometimes I may have to do it 10 times before it works.

I was able to track down the problem to explorer holding open the file in some sort of cache making the compile fail.  I worked around it by making a compile script that would close the explorer process, compile, and then re-launch explorer again.

I eventually just gave up on that and compile it as many times as needed until it works and I keep an eye on the file size as thats the giveaway for me if it worked properly or not. 

As far as I can tell this problem follows me around on multiple computers with multiple setups of OS and AV so it was not an AV issue in my case, probably very similar to the "read only" bug with Office files where the Preview Pane causes that issue.

Edited by ViciousXUSMC
Link to comment
Share on other sites

The antivirus scans the RCDATA before the compiler attaches it to AutoIt3.exe to complie your program... This will lead to a missing RCDATA resource in the compiled executable, So AutoIt throws a "Script not found error :)

 

@Dana How to Disable Trend Antivirus ;)

Edited by TheDcoder
@Dana

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

The antivirus scans the RCDATA before the compiler attaches it to AutoIt3.exe to complie your program... This will lead to a missing RCDATA resource in the compiled executable, So AutoIt throws a "Script not found error :)

@Dana How to Disable Trend Antivirus ;)

I know how to disable the antivirus, it was the first thing I tried, but the corporate policy where I work won't allow me to (it's password protected at the corporate level).  I'm sure if I asked I could get it temporarily disabled, but the fact that the issue is intermittent as I described above makes me believe it's not an antivirus issue.  At any rate I was able to get it compiled but it does seem to be a bug...

Link to comment
Share on other sites

  • 1 month later...

Sorry... AutoIt 3.3.14.1, SciTe 3.5.4, Win7Pro.  I can sort of see what's happening... compiling the x86 version, it instantly blows through "creating resource file", whereas when it's compiling the 64 bit version, it pauses on the "creating resource file" and whatever it is gets included, hence the larger file size.  With the other program which compiled intermittently, I could tell whether it would work by how long it took to compile.

Link to comment
Share on other sites

Update:  It is related to the antivirus... I got our IT guy to temporarily disable Trend Officescan, and I was able to successfully compile the program... turned it back on and I couldn't compile again.  The intermittent nature of the problem with the older script makes me think it's a timing thing as to when the AV releases the resource file?  But as JohnOne said, disabling the AV is not a proper answer.

 

Link to comment
Share on other sites

Today I noticed the same problem here. We moved to TM and now only compiling as 64 always works but compiling for 32 bit most of the time gives the "unable to open" message.
Any solution?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • 4 weeks later...

Hi, I am having the same problem, even stated it as a bug here in the bug tracker

https://www.autoitscript.com/trac/autoit/ticket/3183

As you can see, the bug (it IS a bug) was closed shortly after creation.

Why it is a bug: Trust me I am a pro in computers. If something doesn't function in a normal environment (and having anti virus software in W7 is quite normal) it is a bug. It doesn't matter wether the problem lies in Windows (MS won't care much) or in the anti virus software (they won't care either) is not relevant. Because the x64 compiler works perfectly is another hint that it IS a bug.

Because I work with AutoiT in my companies W7 environment I am not able to disable anti virus. So what.... If it is a race condition: Make a wait/sleep optional parameter in the aut2exe compile process as a workaround or just fix the BUG.

So pretty pretty please: Reopen the bug in the bug tracker ;-)

 

Link to comment
Share on other sites

Actually where the error condition comes from is 100% relevant. If the AV software is preventing the exe to be compiled, then it's the AV software causing the problem. If it's a bug in Windows causing it, then the problem is in Windows.

I can compile x86 and x64 exes in AutoIt without a problem, so to me it's probably not a bug in Aut2Exe because it's not happening for everyone or even in similar situations.

There are plenty of AV programs out there that suck and no one can write software to get around every POS AV software program to make it work.

I used to run into compiling problems when I had my scripts in a Dropbox synced folder, every time I updated it, dropbox would try to send it up to my online storage, locking the file and preventing the compilation. I had to disable Dropbox when I was testing scripts. That's not something Aut2Exe should be made to handle, that was a Dropbox issue, and an issue on my computer, and had nothing to do with AutoIt or Aut2Exe.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Developers

Hi, I am having the same problem, even stated it as a bug here in the bug tracker

https://www.autoitscript.com/trac/autoit/ticket/3183

As you can see, the bug (it IS a bug) was closed shortly after creation.

Why it is a bug: Trust me I am a pro in computers. If something doesn't function in a normal environment (and having anti virus software in W7 is quite normal) it is a bug. It doesn't matter wether the problem lies in Windows (MS won't care much) or in the anti virus software (they won't care either) is not relevant. Because the x64 compiler works perfectly is another hint that it IS a bug.

Because I work with AutoiT in my companies W7 environment I am not able to disable anti virus. So what.... If it is a race condition: Make a wait/sleep optional parameter in the aut2exe compile process as a workaround or just fix the BUG.

Honestly initially though "Fuck It, I am not going to answer this guy when he is incapable of asking a question and is telling us what to do", but hey, it is Christmas time. :)

I closed the Bug report as it is NOT an AUT2EXE bug and actually has NOTHING to do with AUT2EXE.
The problem likely lies in the fact that when a script program is started and the runtime module wants to read the packed script source, it isn't able to do so due to your AV activities.

So, I am not going to re-open it unless you do what is being asked and prove to us it is AutoIT3 having the issue and not your AntiVirus software. 
Your other option obviously is ask the supplier of your payed software to fix their sofware..... right?

Merry Christmas,
Jos

Edited by Jos

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

  • 2 weeks later...

Actually where the error condition comes from is 100% relevant. If the AV software is preventing the exe to be compiled, then it's the AV software causing the problem. If it's a bug in Windows causing it, then the problem is in Windows.

I can compile x86 and x64 exes in AutoIt without a problem, so to me it's probably not a bug in Aut2Exe because it's not happening for everyone or even in similar situations.

There are plenty of AV programs out there that suck and no one can write software to get around every POS AV software program to make it work...

If it's happening for lots of people with different AV software packages, then while technically it's not an AutoIt bug per se, it is, as ToBeSeen says, an inability of AutoIt to work in a common environment.  If it was an obscure AV freeware it'd be one thing, but Trend is one of the more common packages used at the corporate level, and the guys like us running into the problem aren't at the corporate level where the AV is administered.  And it's not even just AV software; as mentioned above Dropbox synced folders can do it as well (assuming it's the same error mechanism), so probably there are still more situations where this will be an issue.

If it could be fixed by adjusting the timing (either overall or as a compile option) that would be "the right thing to do".  But there should at least be an error message when the compile fails (Aut2Exe creates an invalid executable), and that certainly IS a bug.

Link to comment
Share on other sites

I'm pretty sure that there is an error message that it can't be created, although creating it isn't the problem because the exe is created before the error occurs, the error is that it doesn't delete the exe after it fails to add the resources. This is the only bug that I can see here.

Whether it's possible to add a delay in between creating the exe and attempting to add the resources I can't say, but it's probably possible. I'd request that it be optional and maybe configurable, because I don't want the process to have a built-in delay if I'm not having the issue, it just makes the process needlessly take longer.

A locked file isn't AutoIt's problem, whether because of AV software or in my case Dropbox, it's a problem on that computer. There are hundreds of AV software programs out there, and not all of them cause the issue, and I don't think that a developer of AutoIt can account for every contingency. You aim for the lowest common denominator and rely on the users to figure out the AV issues on their end.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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