Jump to content
Sign in to follow this  
dleigh

"Run" to launch java app seems to be architecture dependant (32/64 bit)

Recommended Posts

dleigh

Hello - I've got a situation for which I'd like to get some insight from those more knowledgeable than I:

  • I have an Autoit application that I deploy as an executable. 
  • I can be deployed (I hope) to any level of Windows (2K - 8) both 32 and 64 bit. 
  • I has a sub-component that is a java app (BaseX XML database). 
  • I develop on a Win 7 Pro 64bit machine.

Just recently (last 4 months), I had not touched it since its last version and I started coding/testing again for another release.  It no longer worked!  I'd not changed the code but both the compiled and non-compiled versions now failed on my development machine.  Banged my head for quite a while to figure out what the deal was! :mad2:

I finally narrowed it all down to:

This command:

Local $pid = run(@ComSpec & " /c " & "java -cp BaseX.jar org.basex.BaseXServer","C:\Users\David\DOCUME~1\OPENSO~3\TESTIN~1\OPENSO~1\BaseX",@SW_HIDE,$STDERR_MERGED) ;starts the basex server to facilitate queries

worked when I commented out:

#AutoIt3Wrapper_UseX64=n

when it was NOT commented out (I had it uncommented to create 32bit executables for multi-architecture deployment) I received this message from the run command:

 

'java' is not recognized as an internal or external command, operable program or batch file.

I've uninstalled ALL of java and then just reinstalled the most recent version to see what that would do - same behavior.  I'm guessing that perhaps java, in more recent versions, has changed the way it is deployed for distinguishing between 32 and 64 bit machines.

So it would appear that my tactic to develop and deploy as a single 32-bit application that would cover all 32 and 64 bit machines will no longer work.  Is my only choice to create/use an installer that installs EITHER the 32 bit or 64 bit executable? Or is there some way to change my Run command such that it finds "java" no matter how it is intalled on my machine?

Thanks!


Share this post


Link to post
Share on other sites
dleigh

Ok - edit of the situation. 

I found that I wasn't at the latest AutoIt version.  I then updated to 3.3.8.1 and then it didn't work at all! :

I had updated to make the simplesort work in x64 but it broke my call to java.  So I went and looked into the help file about x64 issues and found this piece of code:

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

So I added it to my script.  Now the java call works AND the simplesort works.  Next step will be the compile and testing under 32 bit systems.

So, we're good for now - more testing to do!


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  

  • Similar Content

    • rudi
      By rudi
      Hello,
      for a script to display PDF files I'd like to simply use the default program for PDF files, so I used "ShellExecute(<pdf-file-full-path>)" to open these files.
       
      The result for *SOME* of the workstations is, that the Adobe Reader starts up with asking for its language. (English/German). When starting AcroRd32.exe through "ShellExecute()", this "choose your language" dialog is showing up *ALWAYS*.
       
      Just to have mentioned it: Process Explorer is presenting this command line, it looks the same for both, PCs with and without that question "Choose Language? [English|German]"
      "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" --channel=4680.0.860715181 --type=renderer "\\pc0009\Y_DRV_H\Daten\TIF\08\32\G000110832_Freigegeben.idw.pdf"  
      The next approach I thought of was to use Foxit Portable (instead of Acrord32.exe), started from a Network Drive, but it's starting up ugly slowly...
      So I tried to "Run()" instead to "ShellExecute()" the Adobe Reader. Now the result looks more stange, the "select your language" dialog shows up every now and then, but not always for the Win7 installations affected.
       
      If I place a "msgbox()" just in front of the "run()" command, it seems never to show this "select your language" dialog.
      If I take out this MsgBox() the "select your language" dialog shows up sometimes.
      When I "ClipPut()" the run command prior the "Run()" and paste that one to a CMD box, then it seems to *NEVER* happen, that this "select your language" dialog shows up.
       
      "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" "\\pc0009\Y_DRV_H\Daten\TIF\08\32\G000110832_Freigegeben.idw.pdf" $AcroRead='"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"' $PDF='"Y:\Temp\DRV_H\Daten\TIF\33\85\153385_Freigegeben.dwg.pdf"' MsgBox(0,"Values",$AcroRead & @CRLF & $PDF,1) $MyCommand=$AcroRead & " " & $PDF ClipPut($MyCommand) Run($MyCommand)  
      It looks like, that this "--channel=... --type=renderer" parameters are always fact for the AcroRd32.exe instance, that is opening the PDF to be displayed. The Instance opening the "PDF Display GUI" seems to always be a child process of another AcroRd32.exe process.
       
      Any clue, what's going on "backstage" here? How to avoid this "Choose your language" dialog? Or maybe someone can mention a different "portable" PDF viewer, I could use for this purpose?  
      Any suggestions appreciated, regards, Rudi.
    • rkr
      By rkr
      Hi, I have a software which has a 'run file'-ie; when i double click on that file, the input file of the software is run by the software. I wish to double click/execute this run file using autoit. how do i achieve this. i opened the software and it shows the input file and run file in same folder, i will put my autoitscript file too in same location. how do i simulate double clicking the run file (using its file name, say - abc.run ). I entered the following lines to make software window active - it became active, dont know how to go forward
      Winactivate("program title")
      winwaitactivate("program title")
      controlclick("program title","abc.run",1000,"primary",2) ; 1000 is ctrl id
    • tremolux66
      By tremolux66
      Initial Problem
      I've written several scripts with the following sequence:
      Execute a program using Run w/stdout+stderr captured Typically processes all the files in one directory tree to populate a second tree Execute a second program (also with Run) to monitor the products of the first program and Display a progress bar (percentage of output files complete) Also monitor the first program's process and exit when it terminates The script then calls ProcessWaitClose (no timeout) on the first program's process and Checks the first program's results Kills the monitor program if it hasn't already exited on its own. Sometimes, ProcessWaitClose returns 1 with @error = 0 and @extended = 0xCCCCCCCC (actually, 0xFFFFFFFFCCCCCCCC), which seems ambiguous: the documentation says that @error = non-zero and @extended = 0xCC... means an invalid PID (unclear what the return value is), and 1 is returned for non-existent processes (but no mention of @extended). The 1/0/0xCC... result seems to occur when the first program exits very quickly (with or without an error). Since the exit value is not available, the script scans the program's output and tries to determine whether it ran successfully. This has gotten complicated and unreliable.
      Partial Fix
      I've now implemented a much simpler approach that works for most cases:
      Modify the monitor program so that it ignores the other program's process (the monitor always gets killed by the script anyway) Execute the monitor program first using Run, then execute the processing program with RunWait When RunWait returns, the child process exit value is available, so the script can ignore its output (which isn't available anyway) If the monitor program is still running, kill it. Remaining Issue
      However, there are still a couple of cases where it's necessary to get both the exit value from the processing program and its output. Since RunWait doesn't capture stdout and stderr for the parent script, it's looking like I'll have to call RunWait and redirect the 2 streams to a temp file and then scan it. Also, to do the redirect, I think I'll have to use @ComSpec to execute the processing program, which adds an undesired layer.
      Does anybody have a better (cleaner) way to handle these cases?
    • e45678mail
      By e45678mail
      Hi~
      I have some question about how to enable the test mode via "Run" or "shellexecute" of command,
      was to tried :
      -----
      Run("bcdedit.exe /-set testsinging on", "C:\Windows\System32")
      and
      shellexecute("bcdedit.exe /-set testsinging on", "C:\Windows\System32")
      -----
      since this command must to run through administrator competence,
      have any method can accomplish it?
       
       
    • BlazerV60
      By BlazerV60
      Hello all,
      I've written the code below which launches chrome in incognito mode and then proceeds to go to the autoit website.
      From my understanding, the Run() command is also supposed to output the PID number related to the application that got launched from the Run command.
      However when I run the below lines, it outputs a PID number that is different from the newly launched chrome browser's PID number, does anyone know why and possibly explain how I could retrieve the accurate PID number associated with the newly launched browser?
      Global $iPid = Run(@ComSpec & ' /c start chrome.exe https://www.autoitscript.com/forum/ -incognito' ,"", "") msgbox(0,"",$iPid) Thank you,
      Brian
×