Standalone Wine for console Win32 executables
Standalone Wine for console Win32 executables
Hi,
First of all, I've searched for a while about this topic both on google and using the search form of this forum before posting and couldn't find anything, so I'm asking it here in the hope someone knows the answer.
I have a lot of simple old console executables for windows that I'd like to execute under Linux using bash scripts. They work well with Wine, but I'd like my scripts to work even if wine isn't installed. I don't have access to the sourcecode of these executables, and I can't reverse engineer them because of a lack of skills on the topic.
So I was wondering if there's any way to get a minimalistic wine build that would be standalone and could be used to launch a win32 console program with a command line similar to this: ./winestandalone win32program
I'd like to avoid dependencies for anything else than what's in the working directory. I don't care if I have to include libraries as well, as long as it works from a usb-drive under Ubuntu without wine installed.
I know something similar exists for OSX, it's called WineBottler.
Thank you very much!
FG
First of all, I've searched for a while about this topic both on google and using the search form of this forum before posting and couldn't find anything, so I'm asking it here in the hope someone knows the answer.
I have a lot of simple old console executables for windows that I'd like to execute under Linux using bash scripts. They work well with Wine, but I'd like my scripts to work even if wine isn't installed. I don't have access to the sourcecode of these executables, and I can't reverse engineer them because of a lack of skills on the topic.
So I was wondering if there's any way to get a minimalistic wine build that would be standalone and could be used to launch a win32 console program with a command line similar to this: ./winestandalone win32program
I'd like to avoid dependencies for anything else than what's in the working directory. I don't care if I have to include libraries as well, as long as it works from a usb-drive under Ubuntu without wine installed.
I know something similar exists for OSX, it's called WineBottler.
Thank you very much!
FG
with Wineskin (Mac OS X) I have to put basically everything Wine may need including Wine all in a folder... this is mainly tons of libraries... this ends up being close to 300 files, mainly since I have to have a full X server as well... you'll have to get it all handled right so the libraries look for other libraries in the right places, etc... not sure how to do that on Linux, but it must be possible.
Thank you for this quick reply, it's fun to know it's at least doable under OSX.
Furthermore, I'm not even looking for a full-featured "standalone" wine, I "only" want it to executes old and simple win32 exes in console mode.
If someone could point me out to which files I'd need or if it's possible at all to do considering how wine works on windows I'd greatly appreciat
Thank you very much!
FG
Furthermore, I'm not even looking for a full-featured "standalone" wine, I "only" want it to executes old and simple win32 exes in console mode.
If someone could point me out to which files I'd need or if it's possible at all to do considering how wine works on windows I'd greatly appreciat
Thank you very much!
FG
-
- Level 5
- Posts: 336
- Joined: Mon Nov 24, 2008 8:10 am
I'll check what WINEDEBUG outputs and post it once I'll have access to my Linux computer.
I really think it would work without X11, it's a 1997 exe with it's own dll that comes with it.
Does anyone know what is the bare minimum wine files needed to execute a "hello world" compiled under windows with g++?
Thank you very much for the support!
FG
I really think it would work without X11, it's a 1997 exe with it's own dll that comes with it.
Does anyone know what is the bare minimum wine files needed to execute a "hello world" compiled under windows with g++?
Thank you very much for the support!
FG
Here's what WINEDEBUG=+loaddll wine program.exe outputs:
So the only wine dlls needed seems to be KERNEL32.dll, which is not a surprise, and msvcrt.dll, am I right?
Now how could I create a smallish "portable" wine with only those dlls? By portable I mean that I could use it from a thumb drive on a pc with linux, but without wine.
Thank you all for the support again,
FG
Code: Select all
trace:loaddll:load_builtin_dll Loaded L"KERNEL32.dll" at 0x7b810000: builtin
trace:loaddll:load_native_dll Loaded L"Z:\\home\\me\\Desktop\\program.exe" at 0x400000: native
trace:loaddll:load_builtin_dll Loaded L"C:\\windows\\system32\\msvcrt.dll" at 0x681c0000: builtin
trace:loaddll:load_native_dll Loaded L"Z:\\home\\me\\Desktop\\program.dll" at 0x10000000: native
Now how could I create a smallish "portable" wine with only those dlls? By portable I mean that I could use it from a thumb drive on a pc with linux, but without wine.
Thank you all for the support again,
FG
Re: Standalone Wine for console Win32 executables
So you're looking for Portable Wine, I guess.FamilyGuy wrote: So I was wondering if there's any way to get a minimalistic wine build that would be standalone and could be used to launch a win32 console program with a command line similar to this: ./winestandalone win32program
I'd like to avoid dependencies for anything else than what's in the working directory. I don't care if I have to include libraries as well, as long as it works from a usb-drive under Ubuntu without wine installed.
Here's how to strip it down to just the files needed:
strace -e trace=open -o files.log -f wine myexe.exe
grep -v ENOENT files2.log | grep -v home | sed 's/.*("//;s/",.*//' | grep / | sed 's,/bin/\.\.,,' | grep wine | sort -u > files.txt
files.txt contains just the needed files.
To make this portable, you need to do that on an uninstalled
copy of wine (in the source tree where it was built).
Et voila!
Re: Standalone Wine for console Win32 executables
Here's the file.txt I get:
Again, I'm impressed by the support, thank you guys!
FG
Code: Select all
/usr/bin/wine
/usr/lib/libwine.so.1
/usr/lib/wine/kernel32.dll.so
/usr/lib/wine/msvcrt.dll.so
/usr/lib/wine/ntdll.dll.so
I don't understand that part sorry. Do I only need to copy these files next to my executable and run wine myexe.exe or am I missing something?DanKegel wrote:To make this portable, you need to do that on an uninstalled copy of wine (in the source tree where it was built).
Again, I'm impressed by the support, thank you guys!
FG
the problem with just taking a minimal Wine install.. is assuming that the dependencies it needs are already installed on the machine its going to be running on.... i'm talking about stuff like freetype or libjpeg or whatever, not just Wine.
If you just want Wine, you can always build from source setting a different prefix (./configure --prefix=<where to install wine>) for install then when you do the make install it will install it to the folder you specified as a prefix, and you have just Wine in that folder and usable now... even copied from machine to machine, so you'd probably just want to add it as is in a Wine folder along with your program.. then a script that launches by adding the CurrentFolder/Wine/bin to the front of $PATH, then doing wine name.exe to launch.... but you can run into tons of problems between distros and what dependencies they have and where they might put them, and what versions they are.
If you really want to make sure it will never have a problem, you need to get copies of all the libraries that are dependencies and have portable copies of them, and set LD library paths and stuff so it uses the right ones and junk like that, which can get very complicated and confusing.
If you just want Wine, you can always build from source setting a different prefix (./configure --prefix=<where to install wine>) for install then when you do the make install it will install it to the folder you specified as a prefix, and you have just Wine in that folder and usable now... even copied from machine to machine, so you'd probably just want to add it as is in a Wine folder along with your program.. then a script that launches by adding the CurrentFolder/Wine/bin to the front of $PATH, then doing wine name.exe to launch.... but you can run into tons of problems between distros and what dependencies they have and where they might put them, and what versions they are.
If you really want to make sure it will never have a problem, you need to get copies of all the libraries that are dependencies and have portable copies of them, and set LD library paths and stuff so it uses the right ones and junk like that, which can get very complicated and confusing.
This would be a problem for a wide-use intended wine portable. While my goal is to run two or three very very very simple binaries. As show by WINEDEBUG=+loaddll wine program.exe the dependencies seems to be KERNEL32.DLL, msvcrt.dll and a dll that goes with the program.
Correct me if I'm wrong.
I'd like a small insight to how to finish the portable stripped-down wine version I need, I don't quite understand what DanKegel meant by:
FG
Correct me if I'm wrong.
I'd like a small insight to how to finish the portable stripped-down wine version I need, I don't quite understand what DanKegel meant by:
Thank you,To make this portable, you need to do that on an uninstalled
copy of wine (in the source tree where it was built).
FG
Standalone Wine for console Win32 executables
On Wed, Apr 13, 2011 at 1:20 PM, FamilyGuy <[email protected]> wrote:
wine from source then do not do the install stage and run your above
command to produce the list.
John
He meant do not use the distribution package. Uninstall that. BuildThis would be a problem for a wide-use intended wine portable. While my goal is to run two or three very very very simple binaries. As show by WINEDEBUG=+loaddll wine program.exe the dependencies seems to be KERNEL32.DLL, msvcrt.dll and a dll that goes with the program.
Correct me if I'm wrong.
I'd like a small insight to how to finish the portable stripped-down wine version I need, I don't quite understand what DanKegel meant by:
To make this portable, you need to do that on an uninstalled
copy of wine (in the source tree where it was built).
wine from source then do not do the install stage and run your above
command to produce the list.
John
Ok, so I've compiled wine from sources but I haven't installed it:
Now wine works using the "wine" script found in the main folder of the sources, or using the loader/wine executable. However when I do these commands:
The resulting files.txt is empty if ran from loader/wine, or only contains ./wine, if ran from main folder script.
Maybe there's a modification to make to those commands to fit a portable install, it was spitting filenames out when I tried it with a installed version of wine.
Also, how is it possible to separate the compiled files from the sources without installing wine with make install?
Thank you very much!
FG
Code: Select all
./configure
make depend
make
Code: Select all
strace -e trace=open -o files.log -f ./wine myexe.exe
grep -v ENOENT files.log | grep -v home | sed 's/.*("//;s/",.*//' | grep / | sed 's,/bin/\.\.,,' | grep ./wine | sort -u > files.txt
Maybe there's a modification to make to those commands to fit a portable install, it was spitting filenames out when I tried it with a installed version of wine.
Also, how is it possible to separate the compiled files from the sources without installing wine with make install?
Thank you very much!
FG
Standalone Wine for console Win32 executables
On 4/15/11 6:28 AM, FamilyGuy wrote:
I may have time to look at this today and provide a solution to what you
need. However, don't count on it.
James McKenzie
The grep ./wine is why...Ok, so I've compiled wine from sources but I haven't installed it:
Code:
./configure
make depend
make
Now wine works using the "wine" script found in the main folder of the sources, or using the loader/wine executable. However when I do these commands:
Code:
strace -e trace=open -o files.log -f ./wine myexe.exe
grep -v ENOENT files.log | grep -v home | sed 's/.*("//;s/",.*//' | grep / | sed 's,/bin/\.\.,,' | grep ./wine | sort -u> files.txt
The resulting files.txt is empty if ran from loader/wine, or only contains ./wine, if ran from main folder script.
I may have time to look at this today and provide a solution to what you
need. However, don't count on it.
James McKenzie
I just got it working. Here's the files I kept:
It stills have some errors when launching my program because of missing dlls, but it works anyway for my program. Is there anyway to stop wine from outputting errors?
Thank you all for your support!
FG
Code: Select all
dlls libs loader programs server mydll.dll myexe.exe tools wine
./dlls:
advapi32 kernel32 msvcrt ntdll
./dlls/advapi32:
advapi32.dll.so
./dlls/kernel32:
kernel32.dll.so
./dlls/msvcrt:
msvcrt.dll.so
./dlls/ntdll:
ntdll.dll.so
./libs:
wine
./libs/wine:
libwine.so.1
./loader:
wine wine-preloader
./programs:
wineboot
./programs/wineboot:
wineboot.exe.so
./server:
wineserver
./tools:
winewrapper
Thank you all for your support!
FG
Hey, that's pretty minimal!
You can suppress Wine errors with WINEDEBUG=-all
See
http://wiki.winehq.org/FAQ#head-51e2c09 ... e97170c503
You can suppress Wine errors with WINEDEBUG=-all
See
http://wiki.winehq.org/FAQ#head-51e2c09 ... e97170c503
Hi again,
WINEDEBUG=-all didn't do the trick, so I added the files that caused error messages but that were not required for my executables. My minimalistic (11.5MiB) portable wine setup is now:
The file named wine in the main folder is the winewrapper. I modified it to run my portable wine in its own prefix in order to avoid problem with a hypothetical wine install. I used this command: export WINEPREFIX=$HOME/.wine-portable/
Now I got 2 small problems.
1) I can't find how to delete ~/.wine-portable/ using the wrapper (for those who might want to check the wrapper is the /tools/winewrapper/ files in the wines sources)
No matter where I insert a rm -r $HOME/.wine-portable command it does not get executed.
2) It always output this error: wine: failed to update /home/user/.wine-portable with /home/user/Desktop/test3/wine/loader/../tools/wine.inf: No such file or directory
Any help would be greatly appreciated!
Thank you in advance!
FG
WINEDEBUG=-all didn't do the trick, so I added the files that caused error messages but that were not required for my executables. My minimalistic (11.5MiB) portable wine setup is now:
Code: Select all
wine:
dlls libs loader programs server wine
wine/dlls:
advapi32 kernel32 msvcrt ntdll rpcrt4
wine/dlls/advapi32:
advapi32.dll.so
wine/dlls/kernel32:
kernel32.dll.so
wine/dlls/msvcrt:
msvcrt.dll.so
wine/dlls/ntdll:
ntdll.dll.so
wine/dlls/rpcrt4:
rpcrt4.dll.so
wine/libs:
wine
wine/libs/wine:
libwine.so.1
wine/loader:
wine wine-preloader
wine/programs:
services wineboot
wine/programs/services:
services.exe.so
wine/programs/wineboot:
wineboot.exe.so
wine/server:
wineserver
Now I got 2 small problems.
1) I can't find how to delete ~/.wine-portable/ using the wrapper (for those who might want to check the wrapper is the /tools/winewrapper/ files in the wines sources)
No matter where I insert a rm -r $HOME/.wine-portable command it does not get executed.
2) It always output this error: wine: failed to update /home/user/.wine-portable with /home/user/Desktop/test3/wine/loader/../tools/wine.inf: No such file or directory
Any help would be greatly appreciated!
Thank you in advance!
FG