Author Topic: Proposal for a robust and simple Windows version  (Read 12736 times)

obetz

  • Sr. Member
  • ****
  • Posts: 244
Re: Proposal for a robust and simple Windows version
« Reply #60 on: August 10, 2019, 10:38:22 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)?
Code: [Select]
    -r $file or $config =~ /^\// or $file = ($0 =~ /(.*[\\\/])/ ? $1 : './') . $config;
    -r $file or $config =~ /^\// or $file = ($^X =~ /(.*[\\\/])/ ? $1 : './') . $config;

Oliver

herb

  • ExifTool Freak
  • *****
  • Posts: 334
Re: Proposal for a robust and simple Windows version
« Reply #61 on: August 11, 2019, 05:46:21 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16519
    • ExifTool Home Page
Re: Proposal for a robust and simple Windows version
« Reply #62 on: August 11, 2019, 08:27:26 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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

obetz

  • Sr. Member
  • ****
  • Posts: 244
Re: Proposal for a robust and simple Windows version
« Reply #63 on: August 11, 2019, 10:00:27 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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16519
    • ExifTool Home Page
Re: Proposal for a robust and simple Windows version
« Reply #64 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.  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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

obetz

  • Sr. Member
  • ****
  • Posts: 244
Re: Proposal for a robust and simple Windows version
« Reply #65 on: August 12, 2019, 09:35:26 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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16519
    • ExifTool Home Page
Re: Proposal for a robust and simple Windows version
« Reply #66 on: August 12, 2019, 09:48:40 AM »
"exiftool_files" is fine by me

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

Eriksson

  • Jr. Member
  • **
  • Posts: 14
Re: Proposal for a robust and simple Windows version
« Reply #67 on: October 02, 2019, 04:34:46 AM »
Are there any plans of releasing the alternate Windows version on the official ExifTool website?

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16519
    • ExifTool Home Page
Re: Proposal for a robust and simple Windows version
« Reply #68 on: October 02, 2019, 07:01:12 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Eriksson

  • Jr. Member
  • **
  • Posts: 14
Re: Proposal for a robust and simple Windows version
« Reply #69 on: October 02, 2019, 11:40:11 AM »
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

  • Sr. Member
  • ****
  • Posts: 244
Re: Proposal for a robust and simple Windows version
« Reply #70 on: October 02, 2019, 04:39:28 PM »
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

  • Jr. Member
  • **
  • Posts: 14
Re: Proposal for a robust and simple Windows version
« Reply #71 on: October 03, 2019, 03:33:44 AM »
I'm happy to test it, thanks.

/Andreas

obetz

  • Sr. Member
  • ****
  • Posts: 244
Re: Proposal for a robust and simple Windows version
« Reply #72 on: October 04, 2019, 01:39:17 AM »
I try to update to the current version tomorrow.

obetz

  • Sr. Member
  • ****
  • Posts: 244
Re: Proposal for a robust and simple Windows version
« Reply #73 on: October 05, 2019, 03:55:56 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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16519
    • ExifTool Home Page
Re: Proposal for a robust and simple Windows version
« Reply #74 on: October 07, 2019, 08:11:38 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).