What exactly does "start" do?

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
rlaggren
Level 1
Level 1
Posts: 9
Joined: Mon Apr 11, 2016 10:25 pm

What exactly does "start" do?

Post by rlaggren »

Eg. "wine start WinApp.exe" -

I have spent many hours trying to get an old app to run. I have used a CXOffice installation in Chicago that runs it well, so it seems like there is a way. In order to control everything closely and repeatably I'm using a script to run wine, and I wish to fully understand the command line used to execute wine and the windows app.

What _exactly_ is different about a command line using "wine start WinApp.exe" compared w/simply "wine WinApp.exe", to run the program? In dozens of faqs, forum posts, etc I have seen it recommended about equally both ways. But I have a problem and I am trying to leave no stone unturned. I could just test it repeatedly but because of other options that can vary and might interact, it turns into a _lot_ of work w/great uncertainty. It would be nice to know the specs for wine's command line options and I haven't found this anywhere yet.

Thanks

Rufus
rlaggren
Level 1
Level 1
Posts: 9
Joined: Mon Apr 11, 2016 10:25 pm

Re: What exactly does "start" do?

Post by rlaggren »

> 1st link
Should have mentioned - reviewed that. Doesn't clarify what is going on.

> 2nd link - C pgm

So decoding the C program is the only way to find out exactly what "start" does? In the header comments it says "Compatible w/MS ... start". Does that mean the MS documentation on their "start" will tell what wine's "start" does?

Since "start" is a program, not a static argument, it appears the wine runs "start" and "start" runs the WinApp.exe. Presumably this is to create a separate terminal, process, shell, thread, some form of execution that removes WinApp.exe from wine's environment? Correct?

But, also presumably, WinApp.exe can access some things from wine - like the correct prefix and the wine API. Please comment or point to discussion of this type of run procedure.

Thanks
User avatar
dimesio
Moderator
Moderator
Posts: 13205
Joined: Tue Mar 25, 2008 10:30 pm

Re: What exactly does "start" do?

Post by dimesio »

rlaggren wrote:> removes WinApp.exe from wine's environment? Correct?
No. The .exe is still running in Wine.

Using wine start sets the working directory to the one containing the .exe file. The wine command alone won't do that, and some apps will crash.
rlaggren
Level 1
Level 1
Posts: 9
Joined: Mon Apr 11, 2016 10:25 pm

Re: What exactly does "start" do?

Post by rlaggren »

When running notepad.exe from a shell as below, notepad does NOT think it's working in c:\windows. Note the fully specified path in the command finds the exe in c:\windows and as I understand what has been said (and all the info I've found in hours of looking). using the "start" command in this way should make notepad think it's working directory is where the executable is.

I say that notepad does not recognize the \windows directory as the working directory because when I click menu/File/Save-As (in notepad) the dialog box opens on /rufus, my home directory, NOT in c:\windows where I executed the program from.

This is contrary to what I understand has be said about using "start" and seems to me to be a real potential source of problems.

Code: Select all

WINEPREFIX="/home/rufus/.wine32/SmartSketch/"; wine start "c:\windows\notepad.exe"
Now. If I use _this_ command, notepad _will_ open it's save dialog in the c:\windows directory.

Code: Select all

WINEPREFIX="/home/rufus/.wine32/SmartSketch/"; wine start /D "c:\windows"  "c:\windows\notepad.exe"
Using the following command line I can get notepad to open it's dialog box in an arbitrary directory:

Code: Select all

 WINEPREFIX="/home/rufus/.wine32/SmartSketch/"; wine start /D "z:/Library" "c:\windows\notepad.exe"
To me this means all the instructions to "use 'start' to set the working directory", showing an example line similar to the first code snip above, is seriously wrong or at best critically incomplete.

Where have I missed something here? Does not notepad open it's save-as dialog (at least the first time) in its working directory? Please do advise here.

Thanks

Rufus
User avatar
dimesio
Moderator
Moderator
Posts: 13205
Joined: Tue Mar 25, 2008 10:30 pm

Re: What exactly does "start" do?

Post by dimesio »

I just checked the behavior of using start to run notepad.exe from the command line in Windows XP, and it is exactly the same as in Wine. If I simply specify

Code: Select all

start c:\windows\notepad.exe
notepad opens its Save and Save as dialog in the directory I was in at the command prompt, not c:\windows. Using /D forces it to whatever directory I specify.

Wine's start has one parameter that doesn't exist on Windows, /Unix, and using that with the full unix-style path does set the working directory to the location of the executable.

I have updated the wiki page for start to match what is in the current help file.
rlaggren
Level 1
Level 1
Posts: 9
Joined: Mon Apr 11, 2016 10:25 pm

Re: What exactly does "start" do?

Post by rlaggren »

OK. That corresponds, I think, to what I experienced. Unfortunately it's been many years since I did this stuff and I left out the prompt from my quotes, so I can't verify I was executing from my home dir.

My main confusions stemmed from this passage in the guide:
https://wiki.winehq.org/Wine_User's_Gui ... wine_start
=====
3.1.1.1 Using wine start

In some cases you may need to specify the full path to an executable file. For example, if you need to install a program from multiple CDs, entering the directory in the terminal will prevent you from removing the CD.

You need to use wine start if you specify a full path, because that allows Wine to set the working directory for the program if it needs it.

You can provide Wine with a DOS or Windows style path inside single quotes like so:

wine start 'C:\Games\Tron\tron.exe'

You can also use double quotes, but you need two backslashes instead of one:

wine start "C:\\Games\\Tron\\tron.exe"

If you prefer to use a Unix style pathname, use the /Unix option to start, e.g.

wine start /Unix "$HOME/installers/TronSetup.exe"

=====

That passage is not clear. It makes no mention of the existence or use of "start" arguments; it says "start" is needed when a full path is used to run wine which makes no sense because fully qualified paths are used all the time everywhere when starting programs, including wine; it gives an example making no mention that because of not using the /d argument "start" will set the working directory to the command line directory SO ONE MUST CD to the working directory one needs when using that form (or you your working directory won't be right), before running wine (this is where all my confusion began because all I could imagine it meant was that wk-dir was set to executable dir); it does not link to the wiki page with the "start" reference info.

Thank you for you help and references. I go forth now to the next problem.
Locked