Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

[PAR] Cannot Access extra files added within packaged executable

by tarunmudgal4u (Sexton)
on Oct 18, 2013 at 13:58 UTC ( #1058759=perlquestion: print w/ replies, xml ) Need Help??
tarunmudgal4u has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

Here I am, again with an another problem. I'm using PAR pp utility to pack my script with additional source directories (e.g. Java directory).

I was able to pack C:/Java directory within my packaged standalone TCExecutor.exe file. When I extract my TCExecutor.exe using 7zip, I see below directory structure-

C:\Perl\site\bin\TCExecutor>dir Volume in drive C has no label. Volume Serial Number is 9AA5-39F7 Directory of C:\Perl\site\bin\TCExecutor 10/18/2013 12:40 PM <DIR> . 10/18/2013 12:40 PM <DIR> .. 10/18/2013 12:40 PM <DIR> Java 10/18/2013 12:40 PM <DIR> lib 10/18/2013 12:35 PM 72,281 MANIFEST 10/18/2013 12:35 PM 221 META.yml 10/18/2013 12:40 PM <DIR> script 10/17/2013 08:24 PM <DIR> shlib 2 File(s) 72,502 bytes 6 Dir(s) 26,444,361,728 bytes free
This shows Java directory was packaged properly within TCExecutor.exe. I confirmed it by checking java.exe -version inside Java directory.

Problem begins when I run TCExecutor.exe. Actually, I called Java/bin/java.exe file inside TCExecutor.pl script using a system command as mentioned below-

system("..\\Java\\bin\\java.exe -jar Framework-1.0.1-tests.jar $testng +File")
and I get following error: ""..\Java\java.exe" failed to start: "The system cannot find the path specified..."

To breakdown this problem, I referred some documents related to PAR pp utility (e.g. PAR::Tutorial) and found that during execution, TCExecutor.exe is extracted in $ENV{PAR_TEMP} directory. This directory usually reside in user TEMP directory. I referred this directory and found Java directory is not extracted here. That is why my TCExecutor.exe is not able to find ..\\Java\\bin\\java.exe path. (this is what I assume, correct me if I'm wrong)

Below are the files available in $ENV{PAR_TEMP} directory -

C:\Users\ADMINI~1\AppData\Local\Temp\1\par-41646d696e6973747261746f72\ +cache-c683e77b9a89c807d6eafeca82ff209af7bf275f>dir Volume in drive C has no label. Volume Serial Number is 9AA5-39F7 Directory of C:\Users\ADMINI~1\AppData\Local\Temp\1\par-41646d696e697 +3747261746f72\cache-c683e77b9a89c807d6eafeca82ff209af7bf275f 10/18/2013 12:43 PM <DIR> . 10/18/2013 12:43 PM <DIR> .. 10/18/2013 12:43 PM 24,701 000c959d.dll 10/18/2013 12:42 PM 20,589 06c2d1e1.dll 10/18/2013 12:43 PM 28,776 0e6a4829.dll 10/18/2013 12:43 PM 32,878 16fbc221.dll 10/18/2013 12:42 PM 86,146 2026b6ac.dll 10/18/2013 12:43 PM 36,992 34cee907.dll 10/18/2013 12:43 PM 41,085 365ea864.dll 10/18/2013 12:42 PM 24,679 3ca67bd9.dll 10/18/2013 12:42 PM 20,590 3d6bfe4c.dll 10/18/2013 12:43 PM 82,048 49177082.dll 10/18/2013 12:42 PM 41,067 4b789922.dll 10/18/2013 12:43 PM 24,701 4f475e36.dll 10/18/2013 12:43 PM 82,033 615a54ca.dll 10/18/2013 12:43 PM 28,792 663e11bb.dll 10/18/2013 12:43 PM 24,681 6bc82cc9.dll 10/18/2013 12:43 PM 53,348 7b57d138.dll 10/18/2013 12:42 PM 24,698 9da5a0f2.dll 10/18/2013 12:43 PM 118,918 a12442c3.dll 10/18/2013 12:43 PM 31,555 c5fefe10.dll 10/18/2013 12:43 PM 20,593 d3979a66.dll 10/18/2013 12:42 PM 24,676 d43dc9e9.dll 10/18/2013 12:43 PM 57,463 d56fc451.dll 10/18/2013 12:43 PM 1,056,877 eb46b129.dll 10/18/2013 12:42 PM 24,670 f38abea4.dll 10/18/2013 12:43 PM 184,414 fca48d10.dll 10/18/2013 12:42 PM 20,603 feaf2452.dll 10/18/2013 12:42 PM 1,339,479 perl516.dll 10/18/2013 12:42 PM 53,248 TCExecutor.exe 28 File(s) 3,610,300 bytes 2 Dir(s) 26,444,226,560 bytes free

Please let me know your suggestions on how can I access Java/bin/java.exe file and trigger another child process using system call. What would be the root cause for this problem? OR if there are any other ways to access added directories using pp -a option.

Looking for your suggestions..

Comment on [PAR] Cannot Access extra files added within packaged executable
Select or Download Code
Re: [PAR] Cannot Access extra files added within packaged executable
by Anonymous Monk on Oct 19, 2013 at 02:26 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1058759]
Approved by hdb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2014-09-22 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (189 votes), past polls