Main Menu

Portable ExifTool GUI?

Started by KenO, April 02, 2010, 10:22:52 AM

Previous topic - Next topic

Phil Harvey

Hi Ronin,

This .BAT file is included in the "RDpar.zip" attachment from an earlier post by Mike Lee.

Note that he attached files with this name to 2 posts.  The first contains the .BAT, and the second contains the .EXE.

- 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 ($).

RoninV

Phil

Thanks for the info. I logged in to reply only, and logged out immediately without re-reading my post. The attachments were not available to me until I logged in and looked for them.

RoninV

Jpette

#17
Yes no problem , this wonderfull programm runs "himlself" no registry etc..

If you want again optimize (reduce size) for example keep in your SD card of your camera.
you can "crunch" (reduce) in Auto-executable (No Ask Zip here), i say auto-execute
Yo searche with windows the free and great prg named UPX (Ultimate Packer)
With him you can reduce the Exe to average 30% of this original size (ex 3Mo = 1Mo after)
okay ;)

For help you the best cmd line for best crunch is:
@C:\Util\UPx\Upx307.exe --force --best --ultra-brute --lzma --all-filters -k --overlay=strip --strip-loadconf=1 --crp-ms=999999 %1 --compress-exports=0

The %1 Here is for the Parameter transmit per "Drag & Drop" if you make one "Crunch.Bat" (for more easy to know)

If you use directly line of Cmd windows throught dos box, replace the %1 with "Your_Name_exe.exe"

Best regards Jpette

TT

How to run ExifToolGUI/exiftool as portable...

1)  Put the exiftool folder 'par-Owner' (and contents) in the ExifToolGUI folder (move it there from the %temp% folder).

2)  Create a file 'StartExifToolGUI.bat' in the ExifToolGUI folder with the following three lines:

         set HOMEDRIVE=
         set TEMP=%CD%\par-Owner
         start ExifToolGUI.exe

3)  Now, run StartExifToolGUI.bat to launch ExifToolGUI.  Program will now run from an external drive, etc., and won't create or need the exiftool folder and files in the %temp% directory.

Tested on WinXP.  Let me know of any problems.

Phil Harvey

#19
A good suggstion, thanks.

I can see one possible problem:  Won't you be running as a different user on each system? (so the "par-Owner" directory name will be different.)

To get around this problem, it may be possible to specify the PAR temporary directory directly (probably by setting the PAR_GLOBAL_TEMP environment variable).  See here and here for details.

- Phil

Edit: Here is a thread with a similar discussion for the command-line version, and here is another.
...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 ($).

TT

Ah, yes.  It's never easy.  I guess 'par-Owner' would have to be 'par-whatever_the_username_is  instead'.  I'll look at the links you provided, but I wasn't able to get the environment variable ideas to work previously.  Hopefully someone will have a solution for this little hurdle...

TT

Actually, it doesn't matter what the username is.  Just be sure that the line in the batch file "set TEMP=%CD%\foldername" points to the the correct folder.  I just set 'foldername' to 'par-files' and renamed the folder on the flashdrive to match and all works well.

Phil Harvey

I don't understand this, because when running from the hard disk PAR looks for the temporary files inside "%TEMP%/par-Owner", but you say that it looks for them inside "%TEMP%" when running from the flash drive?

- 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 ($).

TT

No, if you use the batch file to launch ExifToolGUI, exiftool will look for the files in whatever folder is specified by "set TEMP=%CD%\foldername".

Just make sure that the folder 'foldername' is present in the ExifToolGUI folder.  It must be pre-populated with the required exiftool files, however.  If it's not, exiftool will create them in %temp% on the host system, as usual.

TT

The following will fix a bug I discovered with my batch-file attempt to run ExifToolGUI without the 1,000 exiftool files and 73 folders being written to %temp% .  Unfortunately, many 'cleanup' programs clear the temp directory, so it's necessary for this 10 MB of files and folders to be re-written each time exiftool runs after a cleanup.

For this to work, it's necessary to have a folder named "parfiles" inside the folder that contains ExifToollGUI.exe , exiftool.exe , and what I am calling StartExifToolGUIPortable.bat containing the following lines...


rename parfiles par-%USERNAME%
set HOMEDRIVE=
set TEMP=%CD%
start /wait ExifToolGUI.exe
rename par-%USERNAME% parfiles


Running the batch file will rename the "parfiles" folder to "par-user", where 'user' is the current username.  When you quit ExifToollGUI the folder will revert to "parfiles". 

Obviously you must be able to write to the disk where all the files exist.  Only the first time the batch file is run, and each time exiftool.exe is updated, will the "parfiles" folder be populated with the necessary files.

Don't quit the DOS batch window that pops up .. quit ExifToollGUI to exit. 

I hope this does the job...

BogdanH

Hi TT,

I've tried your solution and it seems to work very well. Just a notice for other visitors interested on this:

I can imagine, that this would be used from USB stick (read/write media, that is) most of the time. When the bat file is running for the very first time, GUI will appear quickly as supposed to. However don't just start clicking on GUI; wait until ExifTool finishes writting it's files into parfiles folder (watch blinking led on USB stick). After writting is finished (about 10Mbytes), you can start using GUI normally -if you start using GUI before writting is finished, GUI might show "Not responding". As mentioned, this is important only on first usage: next time you start bat file, there's no waiting.

Ok, back to topic... I'm no batch expert, so the question: is it somehow possible to run batch file inside hidden window? Or at least automatically minimize window? -just an idea.
Anyway, your solution is simple and elegant; so if you don't mind, I would add this on my "Metadata related articles" here -credit goes to you, of course  :)

Bogdan

TT

Bogdan,

There are some ways of running a batch file without the DOS window showing, but they require feeding the batch file into yet another program, so I chose not to go that route.  Instead, I just Minimize (not Close!) the window.  I'm hoping someone else has a solution for this.

One variation of the batch file I'm looking into is setting the temp folder to, say, the root directory of the flash drive.  That way the same batch idea could be applied to other programs on the drive which call on exiftool so only one copy of all those little files is required on the drive which, by the way, takes over 37 MB! on the flash drive due to the 32kB cluster size.

Anyway, I don't have a problem with you posting this elsewhere with the usual 'use at your own risk' disclaimer.

Wayne (TT)

BogdanH

Hi Wayne,

I agree, that feeding batch from another program isn't the best idea; I just asked in case somebody would care about visible cmd-window. In short, I like the solution as it is: simple.

Of course, it depends on flash drive formatting settings, how much space temp files will occupy. But net total file size is about 10MB (~13MB occupied for default 4kB cluster size).

Bogdan

TT

This slight variation of the batch file mentioned in Reply #24 will allow the ExifTool files to reside in the root directory of a flash drive.  The advantage of this is that only one copy of these files is needed on the drive, which can be used by any program that calls ExifTool.exe .  This way the different programs can each reside in their own folder, though each will require their own copy of ExifTool.exe  AND their own batch file 'launcher' similar to this "StartProgram.bat" file...


rename \parfiles par-%USERNAME%
set HOMEDRIVE=
set TEMP=%CD:~0,3%
start /wait Program.exe
rename \par-%USERNAME% parfiles


Obviously "Program.exe" would be the name of whatever program was calling ExifTool, e.g., ExifToolGUI.exe .

As in the previous example, the first time the batch file is run and whenever ExifTool.exe is updated, the required files will be written to the "par-%USERNAME%" folder in the root directory.  Upon exit the folder will be renamed to "parfiles" so that changing the computer or user won't require re-writing the ExifTool files.

Samuel

My first post.... excuse me if resurrecting an old thread is a violation.

To automatically minimize the command prompt, we can create a shortcut to the .bat file and set 'Run -> Minimized' in the shortcut's properties. we can even set icon from the executable, in this case 'ExifTool GUI' for the shortcut. so launching the shortcut instead of the batch-file will keep the command prompt minimized.