running a wine app from gambas

Post

Posted
Rating:
#1 (In Topic #1339)
Regular
theyikes is in the usergroup ‘Regular’
hello again! once again I'm back with another (what i hope) is a fairly simple question. Allow me to explain. I want to run a wine app from within gambas. It's kind of got me stuck. Anyway here's what i have so far:

Dim wineexePath As String
  wineexePath = "FileChooser1.SelectedPath"
  Dim wineCommand As String
  wineCommand = "wine " & wineexePath
  Shell wineCommand Wait

I've tried a lot of different snips of code but i'm drawing a complete blank. Am i even close to getting it right?

The Yikes
Online now: No Back to the top

Post

Posted
Rating:
#2
Banned
For running commands using Shell you need to make sure the path has no spaces if your not quoting it.

Ie use Shell() to wrap in single quotes

wineCommand = "wine " & Shell(wineexePath)
Shell wineCommand Wait

or

Code (gambas)

  1. wineCommand = "wine '" & wineexePath & "'
  2. Shell wineCommand Wait
  3.  

Or with Exec no quoting is needed

Code (gambas)

  1. Exec ["wine", wineexePath]
  2.  


help yourself using Debug to show the command you're about to run to see if it looks correct..

Code (gambas)

  1. Debug wineCommand ' see what's going on
  2. Shell wineCommand Wait
  3.  
Online now: No Back to the top

Post

Posted
Rating:
#3
Banned
 Hang on…  is this a copy of your code?

wineexePath = "FileChooser1.SelectedPath"


try without quotes

wineexePath = FileChooser1.SelectedPath

by quoting that you are trying to load a program called "FileChooser1.SelectedPath" and not the actual SelectedPath property of the FileChooser
Online now: No Back to the top
1 guest and 0 members have just viewed this.