SteveSchumacher

AutoIT Error: Unable to open the script file

7 posts in this topic

#1 ·  Posted (edited)

New simple script written today. Runs/works perfectly run on the commandline, or double-clicked from Windows Explorer, or right-clicked run as administrator from Windows explorer. Just doesn't run in the context I need it to; called from a compiled Wise script, also 32bit. Have used AutoIT for some years though not a developer or an expert. Almost no errors or problems ever, with any version, so this is weird.

So; if I kick off this Wise script/installer wrapper, it tries to run this compiled AutoIT script without waiting for it to return, so that can float around until the user gets a dialog our users have proven to be incapable of following the onscreen directions for; it waits for 1 dialog, next's to the next dialog, unclicks a selection, and clicks next before exiting, so the rest of the wise script can run a 2nd part of the overall install. As said; if I just kick off the AutoIT program manually, then run the installer manually that AutoIT is waiting for the dialog from, it detects those dialogs, does its job, and exits.

Compiler output and code follow (I am unable to turn off a/v at work, but if the program was broken by a/v, would it run in the contexts it DOES run in?

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /NoStatus /prod /in "G:\Techlog_Delivery\2011.2.2_AllInOne\AutoIT\TL_RTFI.au3"
+>14:40:37 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0   Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0409)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\schustec\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\schustec\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.12.0)  from:C:\Program Files (x86)\AutoIt3  input:G:\Techlog_Delivery\2011.2.2_AllInOne\AutoIT\TL_RTFI.au3
+>14:40:37 AU3Check ended.rc:0
>Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\aut2exe\aut2exe.exe  /in "G:\Techlog_Delivery\2011.2.2_AllInOne\AutoIT\TL_RTFI.au3" /out "C:\Users\schustec\AppData\Local\AutoIt v3\Aut2exe\~AU3uhvqhjz.exe" /nopack /comp 2
+>14:40:39 Aut2exe.exe ended.C:\Users\schustec\AppData\Local\AutoIt v3\Aut2exe\~AU3uhvqhjz.exe. rc:0
>14:40:39 Performing the Program Resource Update steps:
...>Updating Program Version information.
...>Setting Program ExecutionLevel Manifest information to asInvoker
...>Setting Program Compatibility Manifest information to Windows8.1
...>Updating Program Manifest information.
>14:40:39 Program Resource updating finished successfully.
+>14:40:39 Created program:G:\Techlog_Delivery\2011.2.2_AllInOne\AutoIT\TL_RTFI.exe
+>14:40:40 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 2.728
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=TL_RTFI.exe
#AutoIt3Wrapper_Res_Fileversion=1.0
#AutoIt3Wrapper_Res_Language=1033
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;
; TL RTFI
; Written: Steve Schumacher
; History:
; 07May2017 Written

; Dialog-Related
Const $IAM = "TL_RTFI"
Const $TL_COMPLETE_TITLE = "Techlog 2011.2.2 (r100227) Setup"
Const $TL_COMPLETE_TEXT  = "Installation Complete"
Const $TL_RUN_TITLE = "Techlog 2011.2.2 (r100227) Setup"
Const $TL_RUN_TEXT  = "&Run Techlog 2011.2.2 (r100227)"
Const $WAIT_FOR_DIALOG = "300"

; **************************************
; Techlog completed, block input and
; click Next
; **************************************
$RC = WinWaitActive ($TL_COMPLETE_TITLE, $TL_COMPLETE_TEXT)
If $RC = 0 Then
    MsgBox ( 0, $IAM, "Expected dialog not detected; proceed manually per onscreen instructions" )
    Exit (9)
Else
    BlockInput(1)
    WinActivate ($RC)
    ;NEXT
    ControlClick($RC,"",1)
EndIf
; **************************************
; Techlog Finished click OK to run title
; **************************************
$RC = WinWaitActive ($TL_RUN_TITLE, $TL_RUN_TEXT, 10)
If $RC = 0 Then
    BlockInput(0)
    MsgBox ( 0, $IAM, "Expected dialog not detected; proceed manually per onscreen instructions" )
    Exit (9)
Else
    WinActivate ($RC)
    ; Deselect Run Techlog
    ControlClick($RC,"",1203)
    ; Finish
    ControlClick($RC,"",1)
    ;Return mouse/keyboard control
    BlockInput(0)
    MsgBox ( 0, $IAM, "The rest of the install will now proceed...",6)
EndIf

Would appreciate any suggestions. While I can't turn off a/v at work, I can rebuild this at home tonight, retest this on a PC that does have a/v turned off, etc. And run what I've already compiled on other Win7-64 PCs and in a Win10 VM this needs to support also.

Recompiled 32bit and 64bit, tried 32bit exe from a remote share, this worked perfectly in the desired context on original PC and a Win10 VM.
Copied same files to a local directory on the original PC, reran, "Unable to open the script file" again. The directory I created is C:\software\subdir, nothing special about it, no disk errors logged, will retry local on that Win10 VM in a couple of minutes...

5:29pm [7May2017]

Copied same exact install files including the AutoIT-built one into a local directory on the Win10 VM, works perfectly, so running local isn't causing the breakage, will try local on another Win7-64bit box...

Edited by SteveSchumacher
Additional testing done

Share this post


Link to post
Share on other sites



#2 ·  Posted

You need to disable the AntiVirus software during build en when the program is finished send it to the AV company to check if it's a false positive.

If so, they will add an exception so it will not be flagged as a virus

 


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

#3 ·  Posted

I can send you a link to a problem I posted with "my" A/V company a few years ago that they never responded to, after our IT never responded either, [a different issue]I am not their customer, our IT is, and our IT doesn't give 2 flips about what A/V breaks, they won't even turn it off for 2 minutes so you can demonstrate "look, a/v off, now it works, a/v on, now it quit working." I just recompiled 32bit AND 64bit, and am testing the 32bit, and it's working now in the real-life context that it needs to. In the process of updating my post when I saw your response. Thanks man -

Share this post


Link to post
Share on other sites

#4 ·  Posted

...think it might have something to do with building 64bit, used or not, another guy posted something similar and not sure he knew why it magically started working. not that I do either...

 

Share this post


Link to post
Share on other sites

#5 ·  Posted

unless it's because of using the remote share, earlier test was all-files-local...will retest local after uninstall/cleanup..

 

Share this post


Link to post
Share on other sites

#6 ·  Posted

Worked local on 2 of 3 PCs/VMs, just have to figure out why it didn't work if local on the original test PC, since this install has a couple of hundred consumers, most of whom will install from local copy.

Share this post


Link to post
Share on other sites

#7 ·  Posted

I actually get this error a lot when compiling on Windows 7 x64 especially on network drives, not so much on Windows 10 x64.  It does appear to occur more frequently if Windows Explorer is open at the script folder.  Ways around it for me were to delete the compiled script and try again or open Windows Explorer and view the compiled script size that's giving the error, I then recompile until the compiled script file size changes, I can usually guarantee that once the file size has changed it will work.  Hope that makes sense.

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