Ubiratã Silva
2005-Aug-25 09:33 UTC
[Wine]Problem calling executable with document as argument
Hello all, I'm performing some tests with Wine, since we have only one Windows server in our network, used for specific purposes. One of the services which I intend to migrate to Linux/Wine is called "SIAFI Gerencial", which runs EDM Client to update a local database from a remote database. Here's the deal. I've copied all EDM files to my desktop to perform the testing. If I run the application the following way: wine EDMCONSW.EXE it runs fine. However, executing it this way requires me to select manually the connection file , which is CONNECT.EXT, in an Explorer-like interface . If I run it exactly the way it is in my Windows box, which is: wine EDMCONSW.EXE CONNECT.EXT (using the filename as argument, exactly as in Windows box) I get an error "wine: cannot determine executable type" for CONNECT.EXT . It seems that Wine is attempting to run CONNECT.EXT, which I passed as an argument, as another executable file, however, it's a document file which EDMCONSW.EXE has to call. Other alternatives attempted: - use wine to run a batch file which calls "EDMCONSW.EXE CONNECT.EXT" (which works OK in the windows box, the result was the same error, for atualiza.bat (it does not seem to recognize batch files as executables. - compile the .bat file using bat2exe, and attempting to run it "wine atualiza.exe" , in the windows box it was OK, but in the linux box wine returnet the same error "wine: cannot determine executable type" for atualiza.exe. how can I pass the CONNECT.EXT file (yes, it is in all upper case) as an argument for EDMCONSW.EXE on wine? In the proposed production server, manually selecting the file CONNECT.EXT each time the program is run is not being considered as an option, as I have to cron this execution to be performed automatically every night without my direct intervention. The program is not critical and does not run full time, it only connects to the remote database to sync the data, in a proccess which takes approximately 10 minutes, then it closes itself. Distro is Mandriva 10.2 and Wine installation was made through urpmi, config file is standard, and "drive_c" is in my ~/.wine folder . Any help would be appreciated (I've searched Google and WineHQ for a solution and have found nothing useful for my problem). Thanks in advance, Ubirat? Muniz (Bira)
Holly Bostick
2005-Aug-25 10:13 UTC
[Wine]Problem calling executable with document as argument
Ubirat? Silva schreef:> Hello all, > > I'm performing some tests with Wine, since we have only one Windows > server in our network, used for specific purposes. > > One of the services which I intend to migrate to Linux/Wine is called > "SIAFI Gerencial", which runs EDM Client to update a local database > from a remote database. > > Here's the deal. I've copied all EDM files to my desktop to perform the testing. > > If I run the application the following way: > > wine EDMCONSW.EXE > > it runs fine. However, executing it this way requires me to select > manually the connection file , which is CONNECT.EXT, in an > Explorer-like interface . > > If I run it exactly the way it is in my Windows box, which is: > > wine EDMCONSW.EXE CONNECT.EXT > (using the filename as argument, exactly as in Windows box) > > I get an error "wine: cannot determine executable type" for CONNECT.EXT . > > It seems that Wine is attempting to run CONNECT.EXT, which I passed as > an argument, as another executable file, however, it's a document file > which EDMCONSW.EXE has to call. > > Other alternatives attempted: > - use wine to run a batch file which calls "EDMCONSW.EXE CONNECT.EXT" > (which works OK in the windows box, the result was the same error, for > atualiza.bat (it does not seem to recognize batch files as > executables.Instead of running it as a batch file called by wine, why not run it as a linux script that calls wine? This is the standard template I use for many applications that need some sort of special handling to be run in a single maneuver (although the special handling the type of apps I run is usually that the app must be started from the installation directory, making a script necessary if you want to create a destop icon or panel entry to start the app): #!/bin/sh cd /usr/local/games/WinRAR wine WinRAR.exe This simple text file is then named wrar_start.sh, made execuatable, and then can be run as /path/to/script/wrar_start.sh And it will start WinRAR, in this case. The crucial thing here (aside from the ability to now run the app with a single command) is the switching to the application directory before calling the application with Wine. I cannot tell you how many applications that fail to run properly when called by wine /path/to/application/application.exe run perfectly well when run with cd /path/to/application/directory wine application.exe The other thing I'm wondering is whether the application has any available command-line switch to distinguish the argument *as* an argument (the fact that Windows recognizes CONNECT.EXT as an argument does not necessarily mean that such an explicit switch does not exist, but only that the developers of the program or of Windows may have 'hacked around it', so that use of such a switch is not visible to the user. But any such hack would not be known by Wine). If that was the case, it would suggest that the *.EXT file extension is registered as a document type associated with the application (just as *.psd is registered as a document type to Photoshop, and *.mov is registered as a document type to Quicktime). That sort of thing is normally done by the Registry, and since you copied just the application files, it's quite possible that Wine has no way of knowing wtf :) an *.EXT file is, assumes it's an executable (since that's what Wine is designed to run), and gets confused (understandably). To test this, I would suggest that you either: 1) Export the registry entries from the Windows box and import them into the Wine registry (wine regedit), editing them as necessary to correct the paths; 2) install the program explicitly with Wine (which, if successful, will write the entries to the Wine registry during the course of installation). Hope this is in some way helpful, I know nothing about this specific application, or database management in general, so I could be totally off base. Holly
Holly Bostick
2005-Aug-25 12:06 UTC
[Wine]Problem calling executable with document as argument
Ubirat? Silva schreef:> Hi Holly, > > first of all, thanks for your quick reply.You're welcome. A tip, though-- please remember to use 'reply to all' when responding to list messages, rather than just 'reply'-- this message came only to me for that reason, though I'm sending this reply to both you and the list. Because of the way the list treats headers, using 'reply' will only go to the originator's personal email, wheras 'reply to all' goes to both the originator and the list.> > I've tried a different test. Instead of reinstalling the EDM Client on > my Linux box, I've tried something more simple. > > I have also a Windows partition on my HD (XP SP2), so I've tried to > run something more simple, say... notepad! > > the same problem occured. When I try to open a file in notepad > directly from command line (say "wine notepad.exe test.txt", executed > from the notepad directory and with test.txt on the same directory) , > here's what I've got in reply: > > wine: cannot determine executable type for L"C:\\windows\\test.txt" . > > However, if I run just "wine notepad.exe" it runs notepad with an new > empty file, just as it should do. >I've just tested this, trying to open a text file (the *.ini file for Morrowind, located in /usr/local/games/morrowind, where /usr/local/games is symlinked to Wine's d: drive in ~/.wine/dosdevices). After trying several variations, I found that the command wine notepad D:\\morrowind\\Morrowind.ini successfully opened the file in notepad. So maybe what you need to do is add the path to your text file to the name, rather than just the name. The double slashes escape the slash so that it is recognized as a slash, in the same way that using a slash in 'wine C:\\Program\ Files\\whatever.exe' enables the space between "Program" and "Files" to be recognized as an included space by Linux-- don't forget, Wine is a Linux program-- rather than the usual behaviour where a space indicates the end of the command. Hope this helps, and good luck. Holly
Detlef Riekenberg
2005-Aug-27 15:15 UTC
[Wine]Problem calling executable with document as argument
Am Donnerstag, den 25.08.2005, 11:33 -0300 schrieb Ubirat? Silva:> wine EDMCONSW.EXE CONNECT.EXT > (using the filename as argument, exactly as in Windows box)wine wcmd /c EDMCONSW.EXE CONNECT.EXT or wine wcmd /c batchfile.bat As an Example, when your wine-directory is not $HOME/.wine: ----- cut ---- #!/bin/sh if [ -n "$WINEPREFIX" ] then wine wcmd /c _pm__w32.bat $* else echo "\$WINEPREFIX is empty" fi ----- cut ---- I use this to compile for windows with Pelles-C in wine and I was to lazy to change all my bat-files, when I switched from windows to linux. -- By By ... ... Detlef