News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Proposal for a robust and simple Windows version

Started by obetz, May 16, 2019, 07:23:36 AM

Previous topic - Next topic

obetz

Quote from: herb on August 10, 2019, 09:47:12 AM
I have an additional question to default config file .exiftool_config.
Why must this file be stored inside subdirectory exiftool_files using your (Ppl)Exiftool.exe?

It is not used if it is stored inside the current directory parallel to (Ppl)Exiftool.exe.

Thanks for pointing this out.

Checking the directory of the Perl launcher exe requires a patch in ExifTool.pm

ExifTool.pm parses $0 pointing to the "script name" in a standard Perl environment. The par packer fills $0 with the exe path.

Since my package is "a standard Perl environment", $^X needs to be used instead of $0.

Phil, do you have any objections to duplicating this line as below (around line 8430)?

    -r $file or $config =~ /^\// or $file = ($0 =~ /(.*[\\\/])/ ? $1 : './') . $config;
    -r $file or $config =~ /^\// or $file = ($^X =~ /(.*[\\\/])/ ? $1 : './') . $config;


Oliver

herb

Hello Oliver,

thanks for your investigations and your detailed explanations.
Some points are now much clearer to me.

Thanks again and
best regards
Herb

Phil Harvey

Quote from: obetz on August 10, 2019, 10:38:22 AM
Phil, do you have any objections to duplicating this line as below (around line 8430)?

Would it be possible to instead set the EXIFTOOL_HOME environment?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

obetz

Quote from: Phil Harvey on August 11, 2019, 08:27:26 AM
Quote from: obetz on August 10, 2019, 10:38:22 AM
Phil, do you have any objections to duplicating this line as below (around line 8430)?

Would it be possible to instead set the EXIFTOOL_HOME environment?

it wouldn't make "my" ExifTool package compatible with the pp (PAR Packer) packed one.

The ExifTool documentation describes that the "exiftool application directory" is searched for ".ExifTool_config".

In case of "plain Perl" ExifTool, the "exiftool application" is the exiftool Perl script, it's path is in $0. No ambiguity here.

But in case of a "native" Windows ExifTool, users likely expect exiftool.exe being the "exiftool application". Therefore such a Windows variant of ExifTool should look in the directory containing exiftool.exe for ".ExifTool_config".

Perl distinguishes $0 (the script path) and $^X (the exe path), therefore a "native Windows" ExifTool should check $^X instead of $0.

The pp packed ExifTool.exe doesn't notice this difference, because pp sets $0 to the exe path and $^X to a non-existing "perl.exe". Kind of a hack, in my opinion.

I could try to duplicate this pp hack in my Perl environment and make $0 = $^X but I don't feel good about fiddling with well-defined Perl variables.

What do you think?

Oliver

Phil Harvey

If I add $^X to the mix, then the directory containing Perl will be checked for the ExifTool config file on Mac/Linux/Cygwin systems.  This is a behaviour change that would at least have to be documented, but it probably wouldn't cause any problems.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

obetz

Quote from: Phil Harvey on August 12, 2019, 07:28:15 AM
If I add $^X to the mix, then the directory containing Perl will be checked for the ExifTool config file on Mac/Linux/Cygwin systems.

That's true and would happen not only for Cygwin but all "installed Perl on Windows" users.

After spending a night on it, I don't like the idea of always evaluating both variables.

Maybe it's cleaner to let ExifTool check the environment and then use only one variable.

By the way, there is another "$0 vs. $^X" place: The code extracting parameters embedded in the ExifTool file name.

So I need a way to determine whether ExifTool is running as the "standalone Windows version".

The script filename $0 itself could hold this information. Maybe "ExifTool_winpack.pl" or an abbreviation?

Speaking of choosing names: Do you like the current directory name "exiftool_files" or do you have a better suggestion?

Oliver

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Eriksson

Are there any plans of releasing the alternate Windows version on the official ExifTool website?

Phil Harvey

This should happen eventually, but I need to find some time to be able to test this and build this version myself.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Eriksson

Thanks,

I am getting the following error at the moment when running ExifTools from another program on a Windows Server 2019 at the moment and I believe that it is related.

IO error: Can't open file C:\Users\john.doe\AppData\Local\Temp\2\par-626f622e6275696c646572\cache-exiftool-11.11\inc\l
ib\unicore\lib\WB\EX.pl for write : Permission denied

/Andreas

obetz

Quote from: Eriksson on October 02, 2019, 11:40:11 AM
IO error: Can't open file C:\Users\john.doe\AppData\Local\Temp\2\par-626f622e6275696c646572\cache-exiftool-11.11\inc\l
ib\unicore\lib\WB\EX.pl for write : Permission denied

this seems to be PAR related.

Do you want to try my package?

I had no time to keep my version current due to holidays and workload but can prepare it this weekend.

Oliver

Eriksson


obetz

I try to update to the current version tomorrow.

obetz

Quote from: Eriksson on October 03, 2019, 03:33:44 AM
I'm happy to test it, thanks.

The current version 11.69 is now available at https://oliverbetz.de/pages/Artikel/ExifTool-for-Windows as installer or plain ZIP package.

Andreas, please tell me whether it solved your problem (any other suggestions also welcome).

Oliver

Phil Harvey

I have added another link to this version from the top of the ExifTool home page.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).