perl-web-script should start a application with wine
perl-web-script should start a application with wine
I need some help.
I have a windows application which load a file, do something and put the output in the same file. This tool is called ct.exe. Now I use wine to start this application, everything works fine.
My problem starts if a try to write a perlscript which start this wine application.
my perl script:
1 #!/usr/bin/perl
2
3 use strict;
4 use CGI;
5 use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
6
7 my $cgi = new CGI;
8 my $html = q();
9
10 print $cgi->header(q(text/html));
11 print $cgi->start_html(-title => q(lustiger wine test)),
12 $cgi->h1(q( is not an Emulator)),
13 my $output = exec("wine /usr/share/weblicgen/bin/ct.exe
14 -open /usr/share/weblicgen/bin/coreTechLeer.lic ");
15 print "$output";
16 $cgi->end_html();
17 print $html;
Error_log:
191 [error] [client 10.113.201.215] fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.VC80.CRT"
192 [error] [client 10.113.201.215] Application tried to create a window, but no driver could be loaded.
193 [error] [client 10.113.201.215] Make sure that your X server is running and that $DISPLAY is set correctly.
194 [error] [client 10.113.201.215] Application tried to create a window, but no driver could be loaded.
195[error] [client 10.113.201.215] Make sure that your X server is running and that $DISPLAY is set correctly.
196 [error] [client 10.113.201.215] err:module:attach_process_dlls "MSVCR80.dll" failed to initialize, aborting
197 [error] [client 10.113.201.215] err:module:LdrInitializeThunk Main exe initialization for L"Z: >\\\\usr\\\\share\\\\weblicgen\\\\bin\\\\ct-licensegenerator.exe" failed, status c0000142
Note: If I type: perl webscript.pl, then It works. If I write this script as a normal perlscript without using it from a browser, then it works too.
Can someone help me?
I have a windows application which load a file, do something and put the output in the same file. This tool is called ct.exe. Now I use wine to start this application, everything works fine.
My problem starts if a try to write a perlscript which start this wine application.
my perl script:
1 #!/usr/bin/perl
2
3 use strict;
4 use CGI;
5 use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
6
7 my $cgi = new CGI;
8 my $html = q();
9
10 print $cgi->header(q(text/html));
11 print $cgi->start_html(-title => q(lustiger wine test)),
12 $cgi->h1(q( is not an Emulator)),
13 my $output = exec("wine /usr/share/weblicgen/bin/ct.exe
14 -open /usr/share/weblicgen/bin/coreTechLeer.lic ");
15 print "$output";
16 $cgi->end_html();
17 print $html;
Error_log:
191 [error] [client 10.113.201.215] fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.VC80.CRT"
192 [error] [client 10.113.201.215] Application tried to create a window, but no driver could be loaded.
193 [error] [client 10.113.201.215] Make sure that your X server is running and that $DISPLAY is set correctly.
194 [error] [client 10.113.201.215] Application tried to create a window, but no driver could be loaded.
195[error] [client 10.113.201.215] Make sure that your X server is running and that $DISPLAY is set correctly.
196 [error] [client 10.113.201.215] err:module:attach_process_dlls "MSVCR80.dll" failed to initialize, aborting
197 [error] [client 10.113.201.215] err:module:LdrInitializeThunk Main exe initialization for L"Z: >\\\\usr\\\\share\\\\weblicgen\\\\bin\\\\ct-licensegenerator.exe" failed, status c0000142
Note: If I type: perl webscript.pl, then It works. If I write this script as a normal perlscript without using it from a browser, then it works too.
Can someone help me?
-
- Level 5
- Posts: 336
- Joined: Mon Nov 24, 2008 8:10 am
Most likely there are two things. First of all msvcrt80.dll could be missing. Second as the error says no display driver can be found (wine's x11 driver). A lot of apps even if they appear commandline only require a display driver because they require functionality from it while they aren't showing a window themselves.
Likely when you were executing the script by hand you had a display variable set, so that winex11.drv could be loaded.
Likely when you were executing the script by hand you had a display variable set, so that winex11.drv could be loaded.
-
- Level 5
- Posts: 336
- Joined: Mon Nov 24, 2008 8:10 am
You don't need a real Xserver which is connected to a monitor. For instance you could use Xvnc or whatever. Is there no other way to do what you need? Starting wine and then closing it again is a relative heavy operation if it needs to happen frequently. The first thing I would test is if you really need X. Try to run script without a display variable (e.g. when you are in a terminal outside X) as a normal user.
This won't work. You have to properly install vc2005 redist. You can use winetricks to install it as wellAndreasus wrote:Thank you for the answer.
Unfortunately the msvcrt80.dll is in /var/www/ (which should be the home directory for apache)
You need a valid X session. It doesn't have to be started by your web application. But it have to be able to connect to it:Andreasus wrote:and a web application is not able to start a x server ? Am I right?
- DISPLAY env var needs to point to it
- X session needs to allow connections from anyone (xhost +)
How can I install vc2005 ?
I tried:
[andrac1@chbeinwil ~]$ wine vcredist_x86.exe
fixme:advapi:DecryptFileA "C:\\windows\\temp\\IXP000.TMP\\" 00000000
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
fixme:advapi:DecryptFileA "C:\\windows\\temp\\IXP001.TMP\\" 00000000
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
fixme:advapi:LookupAccountNameW (null) L"andrac1" (nil) 0x33f7fc (nil) 0x33f800 0x33f7f4 - stub
fixme:advapi:LookupAccountNameW (null) L"andrac1" 0x125508 0x33f7fc 0x120ac8 0x33f800 0x33f7f4 - stub
fixme:msi:ACTION_HandleStandardAction unhandled standard action L"SetODBCFolders"
fixme:msi:msi_unimplemented_action_stub RemoveExistingProducts -> 1 ignored L"Upgrade" table values
fixme:msi:msi_unimplemented_action_stub MsiUnpublishAssemblies -> 10 ignored L"MsiAssembly" table values
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
[andrac1@chbeinwil ~]$
Any ideas?
I tried:
[andrac1@chbeinwil ~]$ wine vcredist_x86.exe
fixme:advapi:DecryptFileA "C:\\windows\\temp\\IXP000.TMP\\" 00000000
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
fixme:advapi:DecryptFileA "C:\\windows\\temp\\IXP001.TMP\\" 00000000
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
fixme:advapi:LookupAccountNameW (null) L"andrac1" (nil) 0x33f7fc (nil) 0x33f800 0x33f7f4 - stub
fixme:advapi:LookupAccountNameW (null) L"andrac1" 0x125508 0x33f7fc 0x120ac8 0x33f800 0x33f7f4 - stub
fixme:msi:ACTION_HandleStandardAction unhandled standard action L"SetODBCFolders"
fixme:msi:msi_unimplemented_action_stub RemoveExistingProducts -> 1 ignored L"Upgrade" table values
fixme:msi:msi_unimplemented_action_stub MsiUnpublishAssemblies -> 10 ignored L"MsiAssembly" table values
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
err:msi:ITERATE_PublishAssembly Component not set for install, not publishing assembly
[andrac1@chbeinwil ~]$
Any ideas?
Andreasus wrote:How can I install vc2005 ?
Code: Select all
wget http://www.kegel.com/wine/winetricks
sh winetricks vcrun2005