[1.0.1] Windows8: App.open() does not work sometimes --- workaround: use run()

Bug #1238197 reported by Shawn Robertson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Confirmed
Medium
RaiMan

Bug Description

******** workaround
you might use the run(cmd) instead of App.open()
--- Windows
result = run('start /i /b "%s"'%(app))

--- Mac
result = run('open "%s"'%(app))

--- Linux
??? (use a similar command to run something in an independent process)

result contains the textual output, that would be seen if you run the command on commadline
the first line might contain
*** error ***
if the trial to run the command returned an error (e.g. program not found)

on the Java level (might change in the future!)
import org.Sikuli.basics.SikuliScript
.....
String result = SikuliScript.run(" ... some command ... ");

-----------------------------------------------------------------------------

I have Sikuli R930 installed on Windows 8 Enterprise x64 currently.

I have a script that installs software and it is not seeming to work properly.

I have 2 App open commands and one works fine and the other just never works.

the one that works fine is this:

Settings.tscode = App(os.path.join(r"\\tsarchive", "Storage", "Timeslips", "Installations", Settings.tsVersion, "utilities", "TSCodes.exe"))

When this is called it opens a code generator application no problem

The one that does not work is this:

Settings.tssetup = App(os.path.join(r"\\tsarchive", "Storage", "Timeslips", "Installations", Settings.tsVersion, Settings.tsBuild, "setup.exe"))

It never opens and says App not found.

Same exact script works perfectly on Windows 7 Pro x64

even if I dumb the APP open command to this:

tssetup = App(r'"c:\BUILD\Setup.exe"')

and call tssetup.open()

it says App not found.

If i dumb down the App that does work TSCODE to this:

TSCode = App(r'"c:\BUILD\TSCode.exe"')

Retested all above with latest V1.01 with same results.

Revision history for this message
RaiMan (raimund-hocke) wrote :

at least this
tssetup = App(r'"c:\BUILD\Setup.exe"')

should be:
tssetup = App(r"c:\BUILD\Setup.exe")

because in your version the " will be part of the app file name and hence does not exist.
Additional quoting is not necessary with the App feature.

The App open feature will be revised in version 1.1.0

For now you might try the following:
app = os.path.join(r"\\tsarchive", "Storage", "Timeslips", "Installations", Settings.tsVersion, Settings.tsBuild, "setup.exe")
import java.lang.Runtime as RT
cmd = ("start", "/i", "/b", app)
RT.getRuntime().exec(cmd)

this will be used in version 1.1.0 for all situations, where we need to start something in parallel to Sikuli.

Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.0
summary: - Sikuli unable to open some Apps in windows 8
+ [1.0.1] Sikuli unable to open some Apps in windows 8
Revision history for this message
RaiMan (raimund-hocke) wrote : Re: [1.0.1] Sikuli unable to open some Apps in windows 8

I just realized, that the following is already available with version 1.0.1 ;-)

app = os.path.join(r"\\tsarchive", "Storage", "Timeslips", "Installations", Settings.tsVersion, Settings.tsBuild, "setup.exe")
result = run('start /i /b "%s"'%(app))

result contains the textual output, that would be seen if you run the command on commadline

the first line might contain
*** error ***

if the trial to run the command returned an error (e.g. program not found)

generally:
result = run(cmd)

where command contains a string as you would have written it on command line, means correctly quoted, what has to be quoted on command line.

summary: - [1.0.1] Sikuli unable to open some Apps in windows 8
+ [1.0.1] Sikuli unable to open some Apps in windows 8 --- workaround
RaiMan (raimund-hocke)
description: updated
summary: - [1.0.1] Sikuli unable to open some Apps in windows 8 --- workaround
+ [1.0.1] Windows8: App.open() does not work sometimes --- workaround
RaiMan (raimund-hocke)
description: updated
description: updated
summary: - [1.0.1] Windows8: App.open() does not work sometimes --- workaround
+ [1.0.1] Windows8: App.open() does not work sometimes --- workaround: use
+ run()
RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 1.1.0 → 1.2.0
RaiMan (raimund-hocke)
Changed in sikuli:
status: In Progress → Confirmed
milestone: 2.0.0 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.