Error on compile

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Error on compile

Post by SandyDoss » Tue Sep 13, 2016 11:31 pm

Hi,
I'm attempting to compile my script to an executable as the recipient of the .exe does not have MacroScheduler installed.

The script uses an Include> tag for a script that connects to and logs onto a remote server, then opens an application on that server.

I have tried several different variations of compile parameters. Each time, however, I get an External Exception error (see attached image) immediately after launching the compile. I press 'ok' on that window, and, eventually a window pops up that says I'm successful. When I go to run the executable, I get an Access Violation error that repeats itself until I stop the process via the Windows Task Manager (as at this point, SHIFT+ESC doesn't work).

Obviously, I need schooling. Attempted to attach images of the various things I can: compile settings, compile error, compile success, files in the compile to location, and access violation, but you dont allow .bmp files :roll:

So, the External Exception displays C06D007F.
The Access violation: Access violation at address 004FBE68 in module 'TransferCredits.exe'. Read of address 00000050.

If you need the complete script I can provide.
As a sidenote, if I run the .exe, the rdp connection and login does happen, but the execution of the remote application does not.

Thanks in advance for any/all suggestions--Sandy

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Error on compile

Post by Marcus Tettmar » Wed Sep 14, 2016 8:32 am

Is the include using a static literal path OR %SCRIPT_DIR% ?

If so it is possible to compile the include into the .exe if you have this option selected in compiler options - are you doing that?

If not then you will need to provide the include file WITH the .exe as the compiler will have no idea where the include is and it will still be a dynamic include.

Either way nothing here should cause an access violation!
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Re: Error on compile

Post by SandyDoss » Wed Sep 14, 2016 2:52 pm

The INCLUDE> statement points to a static path.
I've compiled with the static path, without the static path, and even without the INCLUDE statement.
Am still getting the same External Error, but once I click OK on that window, it continues to (I believe) go through the compile process, presents a window saying that the .exe has been created, and I can see 2 files in the directory where I pointed the output of the compile: TransferCredits.exe (file type Application, 2,177kb, with todays date/time modified); and ircv.dll (file type Application Extension, 1,862kb, with a date modified of 07/25/2013 13:07).

I'm thinking it's a setup deal, since I am getting the external exception. The compile process is seeing something that it perceives as an external reference or external file and can't find it?

I'll post my setup momentarily, meanwhile, here is the script I'm trying to compile. I have commented the INCLUDE statement. Know that the script does run in debug mode with no problems. Lots of comments, and it's unfinished, but does what I've told it to do. Comments at the end are what I'm trying to accomplish.

Code: Select all

// COMPILE_OPTS|C:\DiamondD_Robots\Robots\TransferCredits\TransferCredits.exe||CONSOLE=0|INCLUDES=1| /NOSYSTRAY|RUNTIMES=1|BMPS=0
GetFileList>S:\customer\Southwest University\Robot project\credit transfers\*.xls*,ws-file-list,|
Separate>ws-file-list,|,ws-name-files
If>ws-name-files_count = 0
  MessageModal>No excel files to process, ending script
  GoTo>EndRoutine
endif
//INCLUDE>C:\Documents and Settings\Administrator\My Documents\Macro Scheduler 14\swu_rdp_login.scp
SetFocus>SWUniversity4*
wait>1
//Bring up the student master select by clicking on Registrar, then Student Master from the dropdown
FindImagePos>C:\DiamondD_Robots\MacroScreenShots\MenuOptions\Registrar\registrar.bmp,SCREEN,0.2,1,RegX,RegY,NumFound,CCOEFF
If>NumFound>0
  MouseMove>RegX_0,RegY_0
  Lclick
  Wait>1
  FindImagePos>C:\DiamondD_Robots\MacroScreenShots\MenuOptions\Registrar\studentMaster.bmp,SCREEN,0.2,1,XArr,YArr,NumFound,CCOEFF
  If>NumFound>0
    MouseMove>XArr_0,YArr_0
    LClick
  Else
    MessageModal>Error opening Student Master/Select student screen
    GoTo>EndRoutine
  Endif
else
  MessageModal>Error clicking on registrar dropdown
  GoTo>EndRoutine
Endif
wait>1
let>i=0
Repeat>i
  let>i=i+1
//open an xls file
  XLOpen>ws-name-files_%i%,0,ws-name-xl-handle
//pull the ssan, school, and term. remove - from ssan
  XLGetCell>ws-name-xl-handle,Sheet1,7,2,ws-no-ssan
  XLGetCell>ws-name-xl-handle,Sheet1,4,4,ws-name-school
  XLGetCell>ws-name-xl-handle,Sheet1,9,2,ws-date-term
//split the ssan into 3 parts - can't send '-' to diamondd
  MidStr>ws-no-ssan,1,3,ssan-1
  MidStr>ws-no-ssan,5,2,ssan-2
  MidStr>ws-no-ssan,8,4,ssan-3
//from here: show vars as a debug.  this will be removed on install
  MessageModal>SSAN: %ws-no-ssan%  SCHOOL: %ws-name-school% TERM: %ws-date-term%
//to here
  SetFocus>SWUniversity*
  Wait>1
  Press TAB
  wait>1
  Send>%ssan-1%
  Wait>1
  Send>%ssan-2%
  Wait>1
  Send>%ssan-3%
  Press Enter
  Wait>3
//need to determine error handling here.  no error is displayed on invalid ssan entry
//maybe if we are still seeing 'Select a Student' on the screen?
//First time through, CTRL TAB puts us on the history tab. Subsequent opens already are focused on History
  SetFocus>SWUniversity*
  If>i<2
    Press CTRL
    Press TAB
    Release TAB
    Release CTRL
    Wait>1
  EndIf
//here, we need to compare the First Term Date and Program in the excel spreadsheet to the fields
//First Term Date and Program.  If they don't match, this file errors out and we close it, move to errors,
//and try the next file.  need to figure out how to do this
//
//Now, pull up the transfer credits screen under Registrar/Transfer Credits
  FindImagePos>C:\DiamondD_Robots\MacroScreenShots\MenuOptions\Registrar\registrar.bmp,SCREEN,0.2,1,RegX,RegY,NumFound,CCOEFF
  If>NumFound=0
    MessageModal>Can't pull up transfer credits
    goto>EndRoutine
  Endif
  MouseMove>RegX_0,RegY_0
  Lclick
  Wait>1
  FindImagePos>C:\DiamondD_Robots\MacroScreenShots\MenuOptions\Registrar\transferCredit.bmp,SCREEN,0.2,1,XArr,YArr,NumFound,CCOEFF
  If>NumFound=0
    MessageModal>Error opening Registrar/Transfer Credit
    GoTo>EndRoutine
  Endif
  MouseMove>XArr_0,YArr_0
  LClick
  wait>1
//now. start at row 16. while our course-id is not 'Total', find a blank hours cell. perform subroutine
  let>row=16
  let>ws-flag-first=Y
  XLGetCell>ws-name-xl-handle,Sheet1,row,1,ws-id-course
  while>ws-id-course<>Total
    XLGetCell>ws-name-xl-handle,Sheet1,row,3,ws-hours
    If>ws-hours<1
      Gosub>processCredits
    EndIf
    let>row=row+1
    XLGetCell>ws-name-xl-handle,Sheet1,row,1,ws-id-course
  EndWhile
  SetFocus>SWUniversity*
  FindImagePos>C:\DiamondD_Robots\MacroScreenShots\exit.bmp,SCREEN,0.2,1,XArr,YArr,NumFound,CCOEFF
  If>NumFound=0
    MessageModal>Error exiting Registrar/Transfer Credit
    GoTo>EndRoutine
  Endif
  MouseMove>XArr_0,YArr_0
  LClick
  Wait>1
//Press the select button in prep for the next ssan to be sent
  FindImagePos>C:\DiamondD_Robots\MacroScreenShots\select.bmp,SCREEN,0.2,1,XArr,YArr,NumFound,CCOEFF
  If>NumFound=0
    MessageModal>Error going to select the next student
    GoTo>EndRoutine
  Endif
  MouseMove>XArr_0,YArr_0
  LClick
  XLQuit>ws-name-xl-handle
  MessageModal>Pausing here to go to next file
Until>i,ws-name-files_count
//We've reached the end of the directory listing, so close out windows and log off of DiamondD
SetFocus>SWUniversity4*
FindImagePos>C:\DiamondD_Robots\MacroScreenShots\cancel.bmp,SCREEN,0.2,1,XArr,YArr,NumFound,CCOEFF
If>NumFound=0
  MessageModal>Error cancelling the select screen
  GoTo>EndRoutine
Endif
MouseMove>XArr_0,YArr_0
LClick
Wait>1
FindImagePos>C:\DiamondD_Robots\MacroScreenShots\exit.bmp,SCREEN,0.2,1,XArr,YArr,NumFound,CCOEFF
If>NumFound=0
  MessageModal>Error exiting the student master screen
  GoTo>EndRoutine
Endif
MouseMove>XArr_0,YArr_0
LClick
Wait>1
//and here, close the rdp window - need to also close out diamondD!
//WindowAction>3,SWUniversity4*
MessageModal>Finished looping thru spreadsheets
SRT>processCredits
//Now we transfer/enter info to the screen by sending keystrokes to tab
//After F9 to save, exit the Transfer Credit screen
//First time thru - If the student has multiples, focus on a blank record
  If>ws-flag-first=N
    GoTo>Continue
  EndIf
  Let>ws-flag-first=N
  SetFocus>SWUniversity4*
  FindImagePos>C:\DiamondD_Robots\MacroScreenShots\endRecords.bmp,SCREEN,0.2,1,Xarr,Yarr,NumFound,CCOEFF
  If>NumFound>0
    MouseMove>Xarr_0,Yarr_0
    Lclick
  Else
    FindImagePos>C:\DiamondD_Robots\MacroScreenShots\CreditTransfers\ScreenShot.bmp,SCREEN,0.2,1,Xarr,Yarr,NumFound,CCOEFF
    If>NumFound>0
      MouseMove>Xarr_0,Yarr_0
      LClick
    else
      MessageModal>Can't click on blank screen to set focus
      GoTo>EndRoutine
    EndIf
  EndIf
  Label>Continue
  SendText>%ws-name-school%
  Wait>1
  Press TAB *3
  Wait>1
  SendText>ws-id-course
  Wait>1
  Press TAB *5
  SendText>A
  Wait>1
  Press TAB
  SendText>30
  Wait>1
  Press TAB
  SendText>3
  Press TAB
  Wait>1
  Press Enter
  MessageModal>%ws-id-school%,%ws-id-course%,%ws-id-program% on line %row%
  SetFocus>SWUniversity*
END>processCredits
//OPEN THE DIRECTORY LISTING FILE
//LOOP THIS:
//  READ A LINE FROM DIRECTORY LISTING
//    AT END GO TO EXIT-LOOP
//  OPEN THE .XLS FILE
//  SAVE THE SSAN, SCHOOL, TERM
//  INQUIRE IN REGISTRAR/STUDENT MASTER ON SSAN
//  ERROR HANDLING:
//    IF NOT FOUND GO TO HANDLE ERROR SRT
//    IF NOT CURRENT TERM GO TO HANDLE ERROR SRT
//  SAVE STUDENT ID
//  INITIATE REGISTRAR/TRANSFER CREDITS
//  SELECT BY STUDENT ID
//  LOOP THIS: -- LIKE A DO/WHILE
//    SEARCH WORKSHEET FOR BLANK HOURS
//      AT END OF WORKSHEET GO TO COMPLETE-FILE
//    POPULATE COURSE, SCHOOL HOURS, CREDITS
//    ENTER
//    ERROR HANDLING:
//      CLOSE TRANSFER CREDITS SCREEN
//      GO TO HANDLE ERROR SRT
//    GO TO LOOP
//  END OF THIS LOOP
//
//  COMPLETE-FILE
//    F9 TO SAVE SCREEN
//    CLOSE TRANSFER CREDITS SCREEN
//    CLOSE XLS FILE
//    MOVE XLS FILE TO /COMPLETED
//    GO TO OUTER LOOP
//
//  HANDLE-ERROR
//    CLOSE XLS FILE
//    MOVE XLS FILE TO /ERRORS
//    GO TO OUTER LOOP
//EXIT-LOOP
//
//FINISH SCRIPT:
//CLOSE STUDENT MASTER SCREEN
//EXIT DIAMONDD
//TERMINATE REMOTE SESSION
//CLOSE DIRECTORY LISTING?
//(RE)MOVE DIRECTORY LISTING?
//END
Label>EndRoutine
Thanks

SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Re: Error on compile

Post by SandyDoss » Wed Sep 14, 2016 3:23 pm

And, setup:

C:\Program Files\Macro Scheduler 14\ appears to have the base code for the application.
C:\Documents and Settings\Administrator\My Documents\Macro Scheduler 14\ is where the scripts are created/stored.
C:\Documents and Settings\All Users\Start Menu\Programs\Macro Scheduler 14 has shortcuts

and
Shortcuts on the desktop and tray

Don't know if this helps or not :/ but I find that any script I've run from the debugger doesn't compile. Even this simple script:

Code: Select all

// COMPILE_OPTS|C:\Documents and Settings\Administrator\My Documents\test.exe||CONSOLE=0|INCLUDES=0||RUNTIMES=1|BMPS=1
//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
Run>Notepad.exe
WaitWindowOpen>Untitled - Notepad
Send>Here is a test
Press Enter
Results in the External Exception

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Error on compile

Post by Marcus Tettmar » Wed Sep 14, 2016 3:51 pm

I can't replicate.

As you say it sounds like something external. Two possibilities come to mind:

1. Your antivirus tool is terrified of the creation and modification of a .exe file on your system and is trying to block the compiler. Or something like that. See if you can temporarily disable your security software and see if that prevents the problem.

2. Maybe there's an issue with upx.exe - the compression tool which compresses the .exes. Try renaming upx.exe to upx.bak to disable it - it's in the Macro Scheduler 14 program folder. See if the problem goes away.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Re: Error on compile

Post by SandyDoss » Wed Sep 14, 2016 5:19 pm

Marcus,

No luck. I've uninstalled MicroTrend. Compiler resulted in same error.
I've renamed UPX.exe to UPX.bak in the program files folder. Compiler resulted in same error.
I've turned OFF Windows Firewall. Same error.

Is there a way to watch the compiler do what it's doing? Maybe I can catch it there....

SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Re: Error on compile

Post by SandyDoss » Wed Sep 14, 2016 6:26 pm

*TrendMicro. Not MicroTrend :cry:
Ok, as an update:

I re-installed MacroScheduler on a more current version of Windows (8.1), was able to compile the notepad test to a .exe, no problem, and the .exe worked.
Am off to recompile all else. Will post results.

SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Re: Error on compile

Post by SandyDoss » Thu Sep 15, 2016 5:23 pm

So, an update.

All scripts are compile-able on the Windows 8.1 machine.
Googling the external error code of course results in a million links, but a predominant one is possible missing .dll's.
So my XP machine is probably broken. All's well that ends well.

andyz
Newbie
Posts: 5
Joined: Wed Oct 19, 2016 7:43 pm

Re: Error on compile

Post by andyz » Wed Oct 19, 2016 7:53 pm

I am currently evaluating this software, among others, for use in automating software operations in a production environment. Our equipment is mainly comprised of XP machines.

To validate this software I put together a bare bones virtual machine, XP 64bit, all default Windows configuration. I installed MS and the compiler, loaded the calculator sample and compiled it to an EXE. I am seeing the same type of failures that SandyDoss mentioned above:
  • During compiling I received the same exception (C06D007F), although it completes.
  • When attempting to run I receive repetitive access violations.
Everything has worked fine in a Win7 environment. Strangely enough, successfully compiled versions in Win7 also fail when run on WinXP with exception errors (no repetitive access violations).

Unfortunately this is a blocker for us as we need to continue to use XP machines.

Any advice?

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Error on compile

Post by Marcus Tettmar » Wed Oct 19, 2016 10:18 pm

How up to date is your XP - is it SP3? I haven't experienced any problems compiling on XP SP3. A major client of ours still uses XP and we regularly build scripts for them and compile on those systems. So I'm not sure why it is failing for you. That said, the time when we will no longer be able to support XP is marching closer all the time.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

andyz
Newbie
Posts: 5
Joined: Wed Oct 19, 2016 7:43 pm

Re: Error on compile

Post by andyz » Thu Oct 20, 2016 1:02 pm

Thanks for the quick reply, Marcus.

Yes, the test virtual machine is on SP3. Is it possible that only the trial version (compiler or MS) has this issue?

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Error on compile

Post by Marcus Tettmar » Thu Oct 20, 2016 1:55 pm

I've identified the cause of the issue - turns out it was introduced in 14.3 as a result of adding support for ultra high definition monitors and DPI awareness. This doesn't play well with XP. We have today added a workaround to ignore this code if running XP. Should have the update out within the next hour. Will let you know when it's available.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Error on compile

Post by Marcus Tettmar » Thu Oct 20, 2016 2:22 pm

The update (14.3.07) is now available. You'll need to re-download the compiler evaluation if you are using the trial version. Registered users will find the update in their account.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

andyz
Newbie
Posts: 5
Joined: Wed Oct 19, 2016 7:43 pm

Re: Error on compile

Post by andyz » Thu Oct 20, 2016 3:17 pm

Wow, thank you for the quick support on this. I tested in my virtual machine and it worked. Tried it on the actual production machines and it worked perfectly.

Thanks again!

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Re: Error on compile

Post by CyberCitizen » Fri Oct 28, 2016 2:40 am

Another reason why Marcus is a legend and Macro Scheduler is an awesome tool.
FIREFIGHTER

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts