I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-12-27 21:52:56-08 by milster111
Exiftool on BartPE
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
Direct Responses: 12029 | Write a response
Posted on 2009-12-27 22:33:15-08 by milster111 in response to 12028
Re: Exiftool on BartPE
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.
Direct Responses: 12030 | Write a response
Posted on 2009-12-28 05:07:14-08 by bogdan in response to 12029
Re: Exiftool on BartPE
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
Direct Responses: 12032 | Write a response
Posted on 2009-12-28 11:51:33-08 by exiftool in response to 12030
Re: Exiftool on BartPE
Bogdan is correct, there should be an environment variable you can set. Here is an excerpt from the PAR documentation:

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
Direct Responses: 12035 | Write a response
Posted on 2009-12-29 03:13:19-08 by milster111 in response to 12032
Re: Exiftool on BartPE
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!
Direct Responses: 12037 | Write a response
Posted on 2009-12-29 11:52:31-08 by exiftool in response to 12035
Re: Exiftool on BartPE
From the command line, I would guess you set the environment variables in Windows like this:

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
Direct Responses: 12038 | Write a response
Posted on 2009-12-29 13:07:20-08 by davitof in response to 12037
Re: Exiftool on BartPE
In Vista, the command is
set TEMP=u:\directory
Watch out, no spaces. Anything before and after the "=" is preserved, so that
set TEMP =u:\directory
and
set TEMP= u:\directory
will give results which you probably would not want
Direct Responses: 12039 | Write a response
Posted on 2009-12-29 13:10:30-08 by davitof in response to 12038
Re: Exiftool on BartPE
...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.
Direct Responses: 12059 | Write a response
Posted on 2010-01-01 20:59:18-08 by milster111 in response to 12039
Re: Exiftool on BartPE
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:
0x2, "ControlSet001\Control\Session Manager\Environment", "temp", "%RamDiskDriveLetter%" 0x2, "ControlSet001\Control\Session Manager\Environment", "tmp", "%RamDiskDriveLetter%"
and edit them to something similar to:
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!
Direct Responses: Write a response