Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

[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 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..

Replies are listed 'Best First'.
Re: [PAR] Cannot Access extra files added within packaged executable
by Anonymous Monk on Oct 19, 2013 at 02:26 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1058759]
Approved by hdb
[marioroy]: Well, that's why there must be angels around, invisible or not.
[marioroy]: Lady_Aleena yes, ladder.
[marioroy]: Corion, no not intentionally. not at all.
[Lady_Aleena]: /ne tries to decide whther or not to take a hammer to hubby's alarm clock.
[Lady_Aleena]: He never hears it.
[marioroy]: Back in HighSchool, I came late to Gym class. There was a fellow who was picked last, no team wanted him for racketball. So it was us two against everybody. I looked at him in the eye and said to let your body loose and let the powers to be help us win.
[marioroy]: We made it all the way to the end. The expience was magical. I not good at sports. Someone or thing was there.
erix considers extracting a catalog ...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2017-05-29 08:41 GMT
Find Nodes?
    Voting Booth?