in reply to Can you change the location PAR packer pp unpacks to at runtime?

I'm not sure if it's the most well documented feature ever, but you can change the unpack location by setting the environment variable: $ENV{PAR_TEMP}.

-Paul

  • Comment on Re: Can you change the location PAR packer pp unpacks to at runtime?
  • Download Code

Replies are listed 'Best First'.
Re^2: Can you change the location PAR packer pp unpacks to at runtime?
by Anonymous Monk on Sep 09, 2008 at 07:26 UTC
    PAR::Environment
    Users should set PAR_GLOBAL_TEMP instead. PAR_TEMP is calculated from a variety of other variables. See the NOTES section in the pod for PAR.pm for a complete description of how the calculation proceeds. PAR_TEMP, once calculated, is used as the location where PAR stores its extracted, temporary file cache.
    http://search.cpan.org/src/SMUELLER/PAR-Packer-0.982/contrib/docs/who_am_i.txt
    So far the temp dir has been based on the current value of $ENV{TEMP}. + What if we want the temp dir to be some specific place for our application, re +gardless of system values ? C:\Par>set PAR_GLOBAL_TEMP=c:\Par\temp C:\Par>demo.exe a b c My basename is demo $0 = C:\Par\demo.exe My args are: a b c My @INC is: c:\Par\temp/inc/lib c:\Par\temp/inc CODE(0xdb2718) + . I am a PAR package I am a binary file I am running as '$0 @ARGV' C:\Par\demo.exe a b c My temp dir is c:\Par\temp and it will NOT be deleted after the script finishes A copy of this script was extracted as C:\Par\temp\d2f130a4.pl PAR environment: PAR_0=C:\Par\temp\d2f130a4.pl PAR_ARGC=4 PAR_ARGV_0=demo.exe PAR_ARGV_1=a PAR_ARGV_2=b PAR_ARGV_3=c PAR_GLOBAL_CLEAN=1 PAR_GLOBAL_TEMP=c:\Par\temp PAR_INITIALIZED=2 PAR_PROGNAME=C:\Par\demo.exe PAR_SPAWNED=1 PAR_TEMP=c:\Par\temp C:\Par> PAR_TEMP is set to PAR_GLOBAL_TEMP, but PAR_GLOBAL_CLEAN is overidden. + If you chose a fixed temp dir, you also clean up after yourself. There is cur +rently no way to define a fixed temp dir inside the PAR package, and since te +mp dir creation is done before the script runs, PAR_GLOBAL_TEMP must be set b +efore running the PAR package.
Re^2: Can you change the location PAR packer pp unpacks to at runtime?
by BioNrd (Monk) on Sep 08, 2008 at 21:02 UTC
    Thanks for the reply. This looks like what I might want to go ahead and try. However, when you say set the envi var am I changing the source? In this case par.pl and setuptemp.pm? To be honest, looking at that code and trying to make sense of it does go a little over my head.

    If I do need to go in and change the guts, I will post what I need specific help with once I fumble around a bit more.
    -Bio.

    ---- Even a blind squirrel finds a nut sometimes.
      No...

      I only really speak unix, but from the shell you can PAR_TEMP=/my/location executable.elf2, I'm sure there's a way to set an environment variable in win32...

      It's some thing like set PAR_TEMP=blahblahblah I imagine.

      -Paul

        Thanks again for your help.

        For win32 you are 100% right it is: SET PAR_TEMP=C:\____. However, one more question.

        Do I set the envi var on the machine doing the packing, or the machine doing the unpacking?

        I really appriciate the help!
        -Bio.

        ---- Even a blind squirrel finds a nut sometimes.