+ if (!(cmd.CmpNoCase("?EXECUTE"))) {
+ int waitflag = P_NOWAIT;
+ bool ret;
+ wxString currentdir;
+ wxString filename, path, ext;
+
+ // Parse the params sent to the execute command. For now the only
+ // parm is "wait". wait will cause spawn wait, default is nowait.
+ // Since we only need one param for now I am not going to make this
+ // any smater then it needs to be. If we need more params later i'll
+ // fix it.
+ int i = cmdValue.Find('(');
+ if (i != -1) {
+ wxString param = cmdValue.AfterFirst('(');
+ cmdValue.Truncate(i);
+ if (!param.CmpNoCase("wait)"))
+ waitflag = P_WAIT;
+ }
+
+ currentdir = wxGetCwd();
+ //we don't want to change the path of the virtual file system so we have to use these
+ //functions rather than the filesystem
+ wxSplitPath(cmdValue, &path, &filename, &ext);
+ if (path.CmpNoCase("") != 0) wxSetWorkingDirectory(path);
+
+ ret = !spawnl( waitflag, cmdValue , NULL );
+ //HACK should use wxExecute
+ //ret = wxExecute(filename, bool sync = FALSE, wxProcess *callback = NULL)
+ wxSetWorkingDirectory(currentdir);
+
+ return ret;