From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4083 invoked by alias); 7 Mar 2016 18:46:54 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 4074 invoked by uid 89); 7 Mar 2016 18:46:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS,TBC autolearn=no version=3.3.2 spammy=intel64, Intel64, Greetings, USER X-HELO: resqmta-po-07v.sys.comcast.net Received: from resqmta-po-07v.sys.comcast.net (HELO resqmta-po-07v.sys.comcast.net) (96.114.154.166) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 07 Mar 2016 18:46:51 +0000 Received: from resomta-po-18v.sys.comcast.net ([96.114.154.242]) by resqmta-po-07v.sys.comcast.net with comcast id T6kS1s0065E3ZMc016mpZU; Mon, 07 Mar 2016 18:46:49 +0000 Received: from AndyWork ([73.223.74.29]) by resomta-po-18v.sys.comcast.net with comcast id T6mp1s0030dvCo9016mp9L; Mon, 07 Mar 2016 18:46:49 +0000 From: "Andy Hall" To: References: <002c01d176fc$ba3ed090$2ebc71b0$@comcast.net> <113344667.20160306004441@yandex.ru> In-Reply-To: <113344667.20160306004441@yandex.ru> Subject: RE: Simple .cmd file works under Cygwin but not Window's cmd interpreter. Date: Mon, 07 Mar 2016 18:46:00 -0000 Message-ID: <000301d178a1$ae19cfd0$0a4d6f70$@comcast.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0004_01D1785E.9FFB4AC0" X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00063.txt.bz2 ------=_NextPart_000_0004_01D1785E.9FFB4AC0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 6523 Andrey - Thank you for the response. I had already tried most of your suggestions = in one form or another. So below is my latest try (reduced to the essentials) to find what works and what doesn=92= t. The essential idea was to take the PATH out of consideration by reducing it to a minimum in both the CMD and Cygwin env= ironments. This did not change the result at all. This is expected, because Crystal Reports does not itself depend o= n anything in the PATH. The user defined functions are dynamically loaded and installed when run under Cygwin but no= t when run in a Windows command window. There are differences in the environments (attached) but I don=92t see anyt= hing Cygwin has added or changed that would make a difference. After all, Crystal Reports knows nothing about Cygwin s= pecific environment variables so anything added by Cygwin should not affect the behavior. There are a few things th= at are different (oddly) , but manually setting these in either environments is a bit tedious. Now there are some details about the way user defined functions are install= ed that are peculiar. First of all, the CLASSPATH settings are obviously read from the registry by Crystal Reports,= not from the environment. This is one of the nasty manual configuration settings I mentioned below. It also reads= the path to a JVM .dll from a registry setting and this also has to be set to get user defined functions working.= When running the script below in a Windows CMD window, Crystal reports loads and runs, but it fails to load t= he user defined functions. That works from a bash prompt. From experimentation, I know setting this registry value is = necessary as running in the Cygwin environment fails if this is not set. It is possible, that there is someth= ing strange about .dll loading which causes it to work in Cygwin but not on a CMD Window, but that seems unlikely. @Echo off set CR_HOME_DIR=3DC:\Program Files (x86)\Business Objects\Crystal Reports 1= 1.5 :: Display CLASSPATH echo CLASSPATH echo %CLASSPATH% echo. :: Set and display JAVA_HOME set JAVA_HOME=3DC:\Program Files (x86)\Java\jdk1.6.0_45 echo JAVA_HOME echo %JAVA_HOME% echo. :: Set minimal path and add 32-bit JDK to PATH and display set PATH=3D.;%JAVA_HOME%\bin echo PATH echo %PATH% echo. :: Display environment.=20=20 set java.exe -version "%CR_HOME_DIR%"\crw32.exe I am still very puzzled, Andy Hall > Greetings, Andy Hall! >=20 > > This is a puzzle that I have not been able to sort out despite trying a= ll > > sorts of variations.=A0Basically,=A0I maintain a bunch of Crystal Repor= ts based > > on Crystal reports XI R2. Sorry, I have no choice there. > > I have this installed and running on a Widows 10 machine.=A0How I did t= hat is > > another story. > > Recently I was asked what it would take to internationalize these repor= ts. > > Fortunately, CR has a mechanism that allows you to define your own func= tions > > that can be used in reports which =A0allow you to access properties fil= es > > containing the localized entities just as you would for a > > normal Java app.=A0=A0 All well and good. >=20 > > So I set about trying to get this to work.=A0The plugin to CR XI R2, is= not > > well integrated with the base system and a bit of not so nice manual > > configuration is necessary. > > You have to follow this to the letter, but that is not sufficient. > > Out of the box I could not get it to work. So to debug what was going o= n I > > wrote a simple bash script to try to get it to work. > > Lo and behold this simple script works: >=20 > > #!/bin/bash >=20 > > echo " " > > echo "CLASSPATH =3D $CLASSPATH" > > echo " " > > #JAVA_HOME=3DC":\Program Files (x86)\Java\jdk1.6.0_45" > > echo "JAVA_HOME =3D $JAVA_HOME" > > echo " " > > echo "PATH =3D $PATH" >=20 > > cd "/cygdrive/c/Program Files (x86)/Business Objects/Crystal Reports 11= .5" > > java -version > > crw32.exe >=20 > > Notice that this seem to do nothing but display some key variables and = the > > run CR in its installation directory, just as the normal shortcut does. > > It launches CR which finds the plugin and loads it. >=20 > > Now I have a need to do the same outside of the Cygwin environment, so I > > wrote a simple equivalent .cmd file: >=20 > > @Echo off >=20 > > :: Display CLASSPATH > > set CLASSPATH >=20 > echo %CLASSPATH% >=20 > > :: Set and display JAVA_HOME > > ::set JAVA_HOME=3DC:\Program Files (x86)\Java\jdk1.6.0_45 > > set JAVA_HOME >=20 > echo %JAVA_HOME% >=20 > > :: Add 32-bit JDK to PATH and display > > ::set PATH=3D%JAVA_HOME%\bin;%PATH% > > set PATH >=20 > Just start Java from %ProgramData%\Oracle\Java\javapath\java.exe > In truth, it IS ALREADY in your %PATH%, if you didn't removed it. >=20 > > pushd C:\Program Files (x86)\Business Objects\Crystal Reports 11.5 >=20 > CD /D "C:\Program Files (x86)\Business Objects\Crystal Reports 11.5" >=20 > > java.exe -version > > crw32.exe > > popd >=20 > > If I run this from a bash command prompt it works as well.=A0 It also w= orks > > if I launch cmd from bash and then run the cmd > > file.=A0 That makes sense. >=20 > > But here is the puzzle,=A0If I simply click on the runCR.cmd file, say = from > > the file explorer, CR launches but does not find the plugin. > > The same happens if I launch a Windows cmd window and run the cmd file = outside of Cygwin. >=20 > Then the environment is different. > "set > file" in both CMD prompts and diff the output. >=20 > > So the question is: =93What could possibly be the difference between the > > Cygwin environment and the Windows cmd environment that makes this work= in > > one and not the other?=94 > > I have examined the PATH used in the Cygwin environment and set the PAT= H in > > the Windows environment to be identical.=A0No change. >=20 > It may be some other environment variable. >=20 > > I thought it might have to do with whether or not a 32-bit or 64-bit JV= M is > > configured in the path, but that does not seem to make a difference. > > It fails if the JVM in the path is 32-bit or 64-bit probably because CR > > really gets its JVM from a registry setting. >=20 > > I am at a loss,=A0Does anybody have an idea? >=20 > > BTW, I would have expected the reverse to be the case:=A0 works in Wind= ows but not Cygwin. >=20 > If I were you, I'd remove all Java versions and then install only one, an= d see > if it works or not. >=20 >=20 > -- > With best regards, > Andrey Repin > Sunday, March 6, 2016 00:31:40 >=20 > Sorry for my terrible english... ------=_NextPart_000_0004_01D1785E.9FFB4AC0 Content-Type: text/plain; name="envcmd.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="envcmd.txt" Content-length: 2035 ALLUSERSPROFILE=3DC:\ProgramData APPDATA=3DC:\Users\Andy\AppData\Roaming BINDIR=3DC:\cygwin64\home\Andy\CRUFLS\ BINDRIVE=3DC: BINPATH=3D\cygwin64\home\Andy\CRUFLS\ CLASSPATH=3DC:\Program Files (x86)\Business Objects\Common\3.5\java\lib\Cry= stalFormulas.jar;C:\Program Files (x86)\Business Objects\Common\3.5\java\li= b\CrystalReportingCommon.jar;C:\Program Files (x86)\Business Objects\Common= \3.5\java\lib\u211java.jar;C:\Program Files (x86)\Business Objects\Common\3= .5\java\lib\external\icu4j.jar;C:\Program Files (x86)\Business Objects\Comm= on\3.5\java\lib\external\log4j.jar;C:\cygwin64\home\Andy\CRUFLS\lib\MyFunct= ions.jar CommonProgramFiles=3DC:\Program Files\Common Files CommonProgramFiles(x86)=3DC:\Program Files (x86)\Common Files CommonProgramW6432=3DC:\Program Files\Common Files COMPUTERNAME=3DANDY-WORK ComSpec=3DC:\WINDOWS\system32\cmd.exe CR_HOME_DIR=3DC:\Program Files (x86)\Business Objects\Crystal Reports 11.5 FP_NO_HOST_CHECK=3DNO HOMEDRIVE=3DC: HOMEPATH=3D\Users\Andy JAVA_HOME=3DC:\Program Files (x86)\Java\jdk1.6.0_45 LOCALAPPDATA=3DC:\Users\Andy\AppData\Local LOGONSERVER=3D\\ANDY-WORK NUMBER_OF_PROCESSORS=3D2 OS=3DWindows_NT Path=3D.;C:\Program Files (x86)\Java\jdk1.6.0_45\bin PATHEXT=3D.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PROCESSOR_ARCHITECTURE=3DAMD64 PROCESSOR_IDENTIFIER=3DIntel64 Family 6 Model 15 Stepping 11, GenuineIntel PROCESSOR_LEVEL=3D6 PROCESSOR_REVISION=3D0f0b ProgramData=3DC:\ProgramData ProgramFiles=3DC:\Program Files ProgramFiles(x86)=3DC:\Program Files (x86) ProgramW6432=3DC:\Program Files PROMPT=3D$P$G PSModulePath=3DC:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ PUBLIC=3DC:\Users\Public SESSIONNAME=3DConsole SystemDrive=3DC: SystemRoot=3DC:\WINDOWS TEMP=3DC:\Users\Andy\AppData\Local\Temp TMP=3DC:\Users\Andy\AppData\Local\Temp USERDOMAIN=3DAndy-Work USERDOMAIN_ROAMINGPROFILE=3DAndy-Work USERNAME=3DAndy USERPROFILE=3DC:\Users\Andy windir=3DC:\WINDOWS windows_tracing_flags=3D3 windows_tracing_logfile=3DC:\BVTBin\Tests\installpackage\csilogfile.log ------=_NextPart_000_0004_01D1785E.9FFB4AC0 Content-Type: text/plain; name="envcyg.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="envcyg.txt" Content-length: 2795 ALLUSERSPROFILE=3DC:\ProgramData APPDATA=3DC:\Users\Andy\AppData\Roaming BINDIR=3DC:\cygwin64\home\Andy\CRUFLS\ BINDRIVE=3DC: BINPATH=3D\cygwin64\home\Andy\CRUFLS\ CLASSPATH=3DC:\Program Files (x86)\Business Objects\Common\3.5\java\lib\Cry= stalFormulas.jar;C:\Program Files (x86)\Business Objects\Common\3.5\java\li= b\CrystalReportingCommon.jar;C:\Program Files (x86)\Business Objects\Common= \3.5\java\lib\u211java.jar;C:\Program Files (x86)\Business Objects\Common\3= .5\java\lib\external\icu4j.jar;C:\Program Files (x86)\Business Objects\Comm= on\3.5\java\lib\external\log4j.jar;C:\cygwin64\home\Andy\CRUFLS\lib\MyFunct= ions.jar COMMONPROGRAMFILES=3DC:\Program Files\Common Files COMPUTERNAME=3DANDY-WORK COMSPEC=3DC:\WINDOWS\system32\cmd.exe CommonProgramFiles(x86)=3DC:\Program Files (x86)\Common Files CommonProgramW6432=3DC:\Program Files\Common Files CR_HOME_DIR=3DC:\Program Files (x86)\Business Objects\Crystal Reports 11.5 EXECIGNORE=3D*.dll FP_NO_HOST_CHECK=3DNO HOME=3DC:\cygwin64\home\Andy HOMEDRIVE=3DC: HOMEPATH=3D\Users\Andy HOSTNAME=3DAndy-Work INFOPATH=3D/usr/local/info:/usr/share/info:/usr/info INSTALL_DIR=3D/home/Andy JAVA_HOME=3DC:\Program Files (x86)\Java\jdk1.6.0_45 LANG=3Den_US.UTF-8 LOCALAPPDATA=3DC:\Users\Andy\AppData\Local LOGONSERVER=3D\\ANDY-WORK NUMBER_OF_PROCESSORS=3D2 OLDPWD=3D/home/Andy ORIGINAL_PATH=3D/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/WI= NDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdr= ive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Per= force:/cygdrive/c/Program Files (x86)/QuickTime/QTSystem:/cygdrive/c/Progra= m Files (x86)/SSH Communications Security/SSH Secure Shell OS=3DWindows_NT PATH=3D.;C:\Program Files (x86)\Java\jdk1.6.0_45\bin PATHEXT=3D.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PRINTER=3DHP LaserJet 400 M401 PCL 6 PROCESSOR_ARCHITECTURE=3DAMD64 PROCESSOR_IDENTIFIER=3DIntel64 Family 6 Model 15 Stepping 11, GenuineIntel PROCESSOR_LEVEL=3D6 PROCESSOR_REVISION=3D0f0b PROFILEREAD=3Dtrue PROGRAMFILES=3DC:\Program Files PROMPT=3D$P$G PS1=3D\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$=20 PSModulePath=3DC:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ PUBLIC=3DC:\Users\Public PWD=3D/home/Andy/CRUFLS ProgramData=3DC:\ProgramData ProgramFiles(x86)=3DC:\Program Files (x86) ProgramW6432=3DC:\Program Files SESSIONNAME=3DConsole SHELL=3D/bin/bash SHLVL=3D1 SYSTEMDRIVE=3DC: SYSTEMROOT=3DC:\WINDOWS TEMP=3DC:\cygwin64\tmp TERM=3Dxterm TMP=3DC:\cygwin64\tmp TZ=3DAmerica/Los_Angeles USER=3DAndy USERDOMAIN=3DAndy-Work USERDOMAIN_ROAMINGPROFILE=3DAndy-Work USERNAME=3DAndy USERPROFILE=3DC:\Users\Andy WINDIR=3DC:\WINDOWS _=3D./CRcyg.cmd windows_tracing_flags=3D3 windows_tracing_logfile=3DC:\BVTBin\Tests\installpackage\csilogfile.log ------=_NextPart_000_0004_01D1785E.9FFB4AC0 Content-Type: text/plain; charset=us-ascii Content-length: 218 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple ------=_NextPart_000_0004_01D1785E.9FFB4AC0--