Installation of ExifTool on non-Perl Windows systems and the Temp data

Started by mpegleg, June 17, 2019, 10:22:34 PM

Previous topic - Next topic

mpegleg

Hi. (Sorry for the length of this... it wasn't going to be a TL;DR type of question), but I have a question regarding the non-Perl install of ExifTool on Windows systems for real n00bs.

I've read the ExifTool installation page, but I didn't see much mention of this, unless I missed it. (Feel free to point me to a better discussion of this if it already exists).


(What I have outlined in BOLD text below cuts to the chase).


When I first decided to try out ExifTool, just a few weeks ago... rushing through in excitement as one does, I thought it was simply a matter of just unzipping the exe file; renaming to exiftool.exe and I was good to go. Yep. Everything worked well. I wasn't initially aware of just how powerful a little utility it really was.

Anyway. At first I downloaded a couple of different GUI programs, like ExifMixer and ExifToolGUI, and tried them out. I initially copied exiftool.exe into their run folders. I now realize (and I certainly didn't at the time), that that was a bad move, as obviously exiftool is very aware of where it is run from (based on the Temp folder settings it creates).

So now I have followed proper install docu info; deleted the Temp folder: (C:\Users\USER\AppData\Local\Temp\par-xxx) as Phil suggested to me, and done the right thing and copied exiftool to my Windows folder.



What puzzles me is, being so aware of where it is run from (and I know it is, as I get different results depending on which folder I run exiftool.exe from), wouldn't it be better if exiftool.exe could automatically clear the Temp folder settings if...

a). it detects a new version is running
(it may already do this, I'm not sure) or more importantly,...

b). It senses that it is being run from a different folder than the previous time.




It may not be all of a big deal to most folks, as they probably wouldn't bother moving the exe file around like I did, but when I perform a system restore, it deliberately only restores my C: drive, not my main data drive which is D:.

This has so often got me out of a deep hole, when Windows gets corrupted (as you may well be aware happened to me yesterday if you had read that mountain of posts in my previous thread).    What? You haven't read it all?! :o Actually I don't blame you. lol.

Anyway, doing that restore which seemed to fix all my errors, it occurred to me that exiftool was now an older version (as it was at the time that I did the initial auto image backup... a week prior).

So, you see the situation was, now my ExifTool Temp folder would have been restored with the older version data, yet I now had a later version of exiftool.exe sitting on D: drive.

When I now ran it, it would be using the older data it gets from the restored Temp folder, and could inherently cause issues.

     EDIT: I'm now aware of the version specific Temp directories, so I guess this shouldn't be a source of issues.

Yes I know that this is my fault for not having C: and D: restored at the same time, but that would defeat the purpose of it, as all of my new data from the past week would be gone. All of my Windows data folders like Desktop, Pictures, Videos, etc, are on D:

What do you think? Yes, I know I should, and am now correctly running it from C:\Windows, but any n00b like I was (I still am) wouldn't be aware of this.



I guess my question is... is there any reason that the data contained in the Windows Temp folder really needs to be retained? I don't know enough about the type of data that it stores there to make any assumptions. Couldn't exiftool.exe just do a clearing of old data, when it senses that things have changed, as I have outlined above?



Sorry for such a long question, but I wanted to explain myself fully!

Cheers,
-Paul

ps. My guess after thinking about this for a bit, is that it has to do with how you can drag or drop image files onto different exiftool.exe files that have been specifically renamed with different arguments.

Thus different sets of data are probably created.

Is my assumption correct here?
OS: Windows 11 Pro

StarGeek

Quote from: mpegleg on June 17, 2019, 10:22:34 PM
What puzzles me is, being so aware of where it is run from (and I know it is, as I get different results depending on which folder I run exiftool.exe from), wouldn't it be better if exiftool.exe could automatically clear the Temp folder settings if...

a). it detects a new version is running
(it may already do this, I'm not sure) or more importantly,...

b). It senses that it is being run from a different folder than the previous time.

I could be wrong about what I say next, but this is how I believe it works.

First, what if you're running multiple versions of exiftool.  For example, I usually keep my main exiftool up to date.  But I also regularly use IMatch and Geosetter, both of which run exiftool behind the scenes.  I don't necessarily keep the version of exiftool those programs are running up to date and I often switch between them and my regular command line many times.  If exiftool cleared the temp dir every time a new version ran, I would suffer from a noticeable delay as exiftool would have to unpack all the code each time I switched.

QuoteAnyway, doing that restore which seemed to fix all my errors, it occurred to me that exiftool was now an older version (as it was at the time that I did the initial auto image backup... a week prior).

The code that gets extracted is version sensitive.  You may have the code for an older version in your temp directory, but if you run a newer version, the perl code gets unpacked into a new directory.

Here's my current temp/par-blahblah directory


I could be wrong but I don't believe it matters where you run exiftool from, it will default to the proper subdirectory.

If you feel the need, you can have Windows clear your temp directory on a regular basis.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

mpegleg

Ok. I took note of all that you said. (I didn't really take much notice beforehand of what was in the Temp folder, but I do notice now that there are version specific Temp subfolders, and that does make good sense to do it that way).


What puzzled me was that... earlier today, I ran a very simple "command window" exiftool expression from D:\Tests. (exiftool.exe was in with the image files).

...just to show the dates of some image files. I can't unfortunately remember what it was, but it was a very basic expression, (and I don't think it would have mattered what it was).

Anyway... the command executed perfectly, and I got the results of the dates listed in the command window.

So... I thought... it's time to get the exiftool.exe into the Windows folder, so I only have to worry about keeping that one up-to-date.


I got the non-admin command window up again; CD'd my way to D:\Tests; deleted the exiftool.exe file in there; and I ran exactly the same command as before, but this time I got... *crickets chirping*... nothing.

It just returned straight to the command prompt. No errors. No output. No abuse. :o Just the command prompt again.

I repeated the command (and it was a cut & paste, so I know it was identical), but got the same thing. No errors. No output. No "GET ME OUT OF THIS FOLDER NOW !!"

So you see, that's really weird and confusing. The exact same exiftool.exe, just copied from one location to another (albeit being run from within the Windows System folder (C:\Windows\System32). I later decided it should be in just C:\Windows, and hence moved it there).

It's not a big issue, now that I know I should clear the Temp folder regularly, (but how many n00bs do that?!) but certainly not something I was expecting, esp. with no error output. Probably just a normal run-of-the-mill Windows Permissions thing. It usually is!

No doubt the "C:\Windows\System32" folder probably is a special permissions nightmare (being a system folder after all), and I might have just struck it unlucky by trying my test from having exiftool.exe in there... but why no error messages or output?

Note: The install instructions do say... Move "exiftool.exe" to the "C:\WINDOWS" directory (or any other directory in your PATH).
OS: Windows 11 Pro

mpegleg

Ah. I just read this from the ExifTool GUI Install text file... "ExifToolGUI_readme.txt"

Quote
ExifToolGUI can be saved anywhere on disk, but to avoid troubles, I recommend you to create new directory (outside Windows system directories) and put ExifToolGUI.exe there; for example:

   C:\ExifToolGUI
or   C:\WinTools\ETGUI

However, for exiftool.exe, the BEST place is inside C:\Windows directory.



Might be worth including that (ie. Don't install into C:Windows\System32 or other system directories) into the ExifTool documentation also, if it's not already there. (I don't remember seeing it).
OS: Windows 11 Pro

StarGeek

I have no idea what might have happened but there are occasionally problems with Windows 10 and where it runs from.  Myself, I keep most of my command line programs (many unix ports) in a separate directory that's part of the PATH env variable and have never had a problem.  I know I probably don't have the same security doing so that keeping things in C:\Program Files has, but I'm also not pulling my hair out trying to get things to work.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

StarGeek

From the docs

4. Move "exiftool.exe" to the "C:\WINDOWS" directory (or any other directory in your PATH).

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

mpegleg

Yep. I saw that.

Makes sense. As I wrote in my edited previous post... it might also be worth stating firmly "Don't install exiftool.exe into C:Windows\System32 or other system directories, although C:\Windows is an exception" in the ExifTool documentation, if it's not already there. (I don't remember seeing it there).

but it should perhaps state... "any other directory in your PATH EXCEPT for C:Windows\System32 or other system directories" !

ps. I've always thought of C:\Windows folder as being a system folder, so have avoided putting anything in there too, because of possible permissions issues, but I guess the permissions are different as compared to System32 or SYSWOW64, etc.? As I'm not a programmer, I'm not sure.

I think if I have any issues in future, the first thing I will do do is rip exiftool.exe out of C:\Windows, and ban it from ever setting foot in that scary space ever again ;)
OS: Windows 11 Pro

StarGeek

My main reason for putting exiftool in its own personal directory is because I use a lot of config and args files.  I keep those in the same directory because exiftool will look in its home directory for those files first.  It allows me to use those files without having to either specify the full path or have exiftool in the current working directory.  Putting all those files in c:\Windows would be too messy.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

mpegleg

OS: Windows 11 Pro

obetz

just for the records: I disagree with Bogdan's recommendation in ExifToolGUI_readme.txt that "the BEST place is inside C:\Windows directory".

The Windows directory is for Windows, not for user programs.

https://exiftool.org/install.html should also drop this suggestion. BTW: ExifTool also does not require admin rights unless something else went wrong.

For the moment, I suggest to put ExifTool in a separate directory and add it to the path variable - like StarGeek described.

Even better for the average Windows user might be an installer. It's rather easy with NSIS. Then, you can install ExifTool easily to a subdirectory in %programfiles(x86)% with the usual UAC confirmation.

No clutter in %temp%, no startup delay, no problems with execution policies prohibiting programs running in %temp% etc.

Providers bundling ExifTool with their own software might prefer to incorporate the "unpared" ExifTool in their installation package.

Oliver

mpegleg

Hi Oliver.

I agree wholeheartedly.

I also don't like placing anything in the Windows directory, and I agree that a Windows installer would be a great idea.

I know ExifTool is not really designed for n00bs like me... but, when I see raw power. I want it! ExifTool has that in spades. 8)

-Paul
OS: Windows 11 Pro

obetz

Quote from: mpegleg on June 19, 2019, 06:56:45 AM
I also don't like placing anything in the Windows directory, and I agree that a Windows installer would be a great idea.

If you want to try an installer: https://exiftool.org/forum/index.php/topic,10128.msg53384.html#msg53384 has a short description and a link to an installer resp. archive.

Oliver

mpegleg

OS: Windows 11 Pro