Main Menu

Exiftool on BartPE

Started by Archive, May 12, 2010, 08:54:43 AM

Previous topic - Next topic

Archive

[Originally posted by milster111 on 2009-12-27 21:52:56-08]

Hi all. Having a small problem with running ExifTool on BartPE, the Windows preinstall environment. ExifTool keeps creating the [par-USER] cache in the folder of images wherever I apply EXIF changes.
ie. If I have jpg's in folder1, folder2 and folder3. I will get a 7.5MB cache written to each folder when I attempt to read EXIF info from each folder. For some reason EXIF tools won't use 1 single [par-USER] cache. I have tried moving exiftool and the cache to the windows directory but this makes no difference. BartPE does not usually build a "Documents and Settings" folder area, so I manually created one and put the cache into the temp folder where ExifTool would expect to find it but that won't fix the problem either. Anybody have any ideas for a workaround? Thanks

Archive

[Originally posted by milster111 on 2009-12-27 22:33:15-08]

One other thing. The name of my cache folder is [par-SYSTEM]. I am assuming that BartPE creates this as the default user account or I could be wrong and ExifTool is using SYSTEM as a default name.

Archive

[Originally posted by bogdan on 2009-12-28 05:07:14-08]

Hi,

I assume, there must be some TEMP variable defined in OS environment (i.e: SET TEMP=C:\MyTempDir). I assume (again), Exiftool reads this varible, to know where to store it's par files.

Because I don't know PartPE, I don't know how to do that -but from old DOS times, this variable was written inside autoexec.bat file (which was loaded when OS booted).

Bogdan

Archive

[Originally posted by exiftool on 2009-12-28 11:51:33-08]

Bogdan is correct, there should be an environment variable you can
set.  Here is an excerpt from the
PAR
documentation
:

Code:
User-defined environment variables, like PAR_GLOBAL_CLEAN, always overrides
the ones set in META.yml. The algorithm for generating caching/temporary
directory is as follows:
  - If PAR_GLOBAL_TEMP is specified, use it as the cache directory for
    extracted libraries, and do not clean it up after execution.
  - If PAR_GLOBAL_TEMP is not set, but PAR_CLEAN is specified, set
    PAR_GLOBAL_TEMP to TEMP/par-USER/temp-PID/, cleaning it after execution.
  - If both are not set, use TEMP/par-USER/cache-HASH/ as the
    PAR_GLOBAL_TEMP, reusing any existing files inside.

Here is a description of the variables the previous paths.
  - TEMP is a temporary directory, which can be set via
    $ENV{PAR_GLOBAL_TMPDIR}, $ENV{TMPDIR}, $ENV{TEMPDIR}, $ENV{TEMP} or
    $ENV{TMP}, in that order of priority. If none of those are set, C:\TEMP,
    /tmp are checked. If neither of them exists, . is used.
  - USER is the user name, or SYSTEM if none can be found. On Win32,
    this is $Win32::LoginName. On Unix, this is $ENV{USERNAME} or
    $ENV{USER}.
  - PID is the process ID. Forked children use the parent's PID.
  - HASH is a crypto-hash of the entire par file or executable,
    calculated at creation time. This value can be overloaded with pp's
    --tempdir parameter.

- Phil

Archive

[Originally posted by milster111 on 2009-12-29 03:13:19-08]

Thanks Bogdan and Phil!
Correct - there is a variable set in BartPE which leads to a ramdisk and other complications, however this is the windows temp folder and NOT the user temp folder. I still can't work out how to control the user temp variable.
So that takes me back to working on a solution based on some of the info Phil refers to. But this forum is way over my head!
I get the rough idea that the PAR package could be set to unpack to a given folder if one of the environment variables is set to a specific folder. But I can't work that out. Should it be done in the META.yml or the main.pl? I've no idea.
I would be happy to have the PAR unpack to "c:\My_Temp" or "\My_Temp" and have the files remain for future use.
Is anyone prepared to give some step-by-step instructions please?
Thanks very much!

Archive

[Originally posted by exiftool on 2009-12-29 11:52:31-08]

From the command line, I would guess you set the environment variables
in Windows like this:

Code:
set TEMP c:\temp

But I may be wrong.  In the old DOS days you would add a line
like this to autoexec.bat to set them at boot time, but I don't
know how to do this in Windows.

Hopefully Bogdan knows how.

- Phil

Archive

[Originally posted by davitof on 2009-12-29 13:07:20-08]

In Vista, the command is
Code:
set TEMP=u:\directory
Watch out, no spaces. Anything before and after the "=" is preserved, so that
Code:
set TEMP =u:\directory
and
Code:
set TEMP= u:\directory
will give results which you probably would not want

Archive

[Originally posted by davitof on 2009-12-29 13:10:30-08]

...but now that I think of it, if your BartPE relies on FreeDOS, there may be small syntax difference here. I already noted a small difference between FreeDOS's "choice" command and the original Microsoft version, for example.

Archive

[Originally posted by milster111 on 2010-01-01 20:59:18-08]

Hi all. No BartPE does not use FreeDOS, as I understand it is a legal use of the Windows pre-install environment that loads prior to performing a full Windows install on a machine. I was not able to set the temp directory on-the-fly. However, it can be done. This is not really relevant to this forum but in case anyone does end up here trying to find a solution to a problem like mine. When using PEbuilder you need to edit the ramdisk plugin to set a temp directory that ExifTool can use. Find these 2 lines:
Code:
0x2, "ControlSet001\Control\Session Manager\Environment", "temp", "%RamDiskDriveLetter%"
0x2, "ControlSet001\Control\Session Manager\Environment", "tmp", "%RamDiskDriveLetter%"
and edit them to something similar to:
Code:
0x1, "ControlSet001\Control\Session Manager\Environment", "temp", "TEMP"
0x1, "ControlSet001\Control\Session Manager\Environment", "tmp", "TEMP"
This is manipulating BartPE's registry construction in such a way that the Temp directory is set to a location named "TEMP" which hangs off the System32 folder of a Windows installation.
Cheers!