ExifTool 12.88 Windows package

Started by stoffball, July 12, 2024, 11:11:00 AM

Previous topic - Next topic

stoffball

Hi Phil,

I integrate exiftool.exe in a Windows installer of Hugin panorama stitcher.

Until now it were a 2 liner in CMake (Hugins build system) to put exiftool.exe into the installer:
  FIND_PATH(EXIFTOOL_EXE_DIR exiftool.exe ...
  INSTALL(FILES ${EXIFTOOL_EXE_DIR}/exiftool.exe DESTINATION ${BINDIR})

With the new Windows packages starting with 12.88 this becomes troublesome.
Now I have the parse the whole exiftool_files folder structure and recreate it in the installer.
The brute force method would be to get a recursive list of all files, then make the filename relative to the base folder and create for each file a separate INSTALL(FILES ... command. This will result in nearly 500 additional separate INSTALL commands. (The Hugin installer has currently about 250 files.)
Not sure how efficient this is? I will try it in the next days.

But before starting to code I have some questions:
Will this structure be fixed in further versions? Or can it change?
Currently the folder structure has up to 6! level. Is such a deep nested structure necessary?

I'm also open if there is a CMake expert which can propose a simple and efficient way to do with the changed installer.

I can understand that the new structure can solve some problems with the old structure. But for redistribution of exiftool.exe I find the new package not so nice.

Phil Harvey

Quote from: stoffball on July 12, 2024, 11:11:00 AMWill this structure be fixed in further versions? Or can it change?

The structure shouldn't change unless we find a significant problem, but this is unlikely because this structure has withstood 3 years of testing already.

QuoteCurrently the folder structure has up to 6! level. Is such a deep nested structure necessary?

We could have done this with 1 less level, but I don't want to change it now.

QuoteI'm also open if there is a CMake expert which can propose a simple and efficient way to do with the changed installer.

I can understand that the new structure can solve some problems with the old structure. But for redistribution of exiftool.exe I find the new package not so nice.

Why can't you just expand the .zip file in the target folder?

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

soundbyte

I found a solution that works for me with Windows 10 applications that only use local copies of exiftool.exe. YMMV.

Extract the files from the new version zip file into c:\windows as suggested.

Use Windows Explorer to select c:\windows, find exiftool.exe and create a shortcut for exiftool.exe.

Once you have that shortcut, copy the shortcut into the application location/s that only use local copies of exiftool.exe.
This allows applications that use the standalone old version/s to find the new version.

stoffball

Quote from: Phil Harvey on July 12, 2024, 03:02:13 PMWhy can't you just expand the .zip file in the target folder?

We are using a MSI installer package. This is already a zipped package. It is probably not possible to additionally insert an "extract the extracted file" step (and then rename exiftool(-k).exe to exiftool.exe) into the installer.

FrankB

Quote from: soundbyte on July 12, 2024, 07:51:09 PMExtract the files from the new version zip file into c:\windows as suggested.

I know that suggestion has been made often. But I strongly advise to use a different folder and add that folder to your PATH. MS makes it harder with every Windows version to use C:\Windows for your own purposes.

FrankB

Quote from: stoffball on July 13, 2024, 02:13:14 AMWe are using a MSI installer package. This is already a zipped package. It is probably not possible to additionally insert an "extract the extracted file" step (and then rename exiftool(-k).exe to exiftool.exe) into the installer.

Without any knowledge from your MSI installer it's hard to tell. But here are a 2 suggestions (no solutions!).
- Create a self extractor, with WinRar for example, and call that self extractor from within your MSI installer.
- Have a look at the installer for ExifToolGui. It downloads and unzips the ExifTool package and installs it as a subdirectory in the GUI program folder.
Installer created with Inno Setup, source is here:
https://github.com/FrankBijnen/ExifToolGui/blob/main/Redist/ExifToolGUI_install.iss

Viktor Nemeth

Hi Phil,

I didn't quite want to open a separate thread for this but are we allowed to build and distribute exiftool ourselves?
I am totally noob to perl but managed to take the source code and compile it into a single-exe Windows file (like it used to be). Is it okay (mostly in terms of licence agreement) to distribute this within my own app (indicating that this was build in such as way etc.) - basically the new structure doesn't work for me much either but if there's a way around it like so that'd make life a fair bit easier.

Phil Harvey

How did you generate the single-exe?  I'm open to new ideas.  The old PAR-packaged version had some problems.

But yes, you are allowed to distribute ExifTool yourself as long as you don't charge for it.

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

FixEUser

Quote from: Viktor Nemeth on July 13, 2024, 11:59:40 AMI am totally noob to perl but managed to take the source code and compile it into a single-exe Windows file (like it used to be)

Would you mind to share this single-exe file?
Could you provide a DL link for it?

Or if it is more convenient for you:
Can you tell us what steps are required to compile such a single exe file by ourself?

StarGeek

Quote from: FixEUser on July 13, 2024, 03:30:58 PMCan you tell us what steps are required to compile such a single exe file by ourself?

There's some discussion on the subject here with links to previous posts. There are probably more. Search the forums for "PAR Packer"
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Viktor Nemeth

Quote from: FixEUser on July 13, 2024, 03:30:58 PMOr if it is more convenient for you:
Can you tell us what steps are required to compile such a single exe file by ourself?

- Get Perl for Windows (eg Strawberry Perl, I used that one)
- run the below in cmd
- cpanm PAR::Packer
- cpanm https://github.com/exiftool/exiftool.git --force
- pp -o d:\temp\exiftool.exe d:\StrawberryPerl\perl\site\bin\exiftool
(replace relevant bits in the last one as...relavant...)

Though Phil might suggest better ways as I didn't do any config and haven't fully tested beyond the fact that it launches.

Phil Harvey

Thanks.  It was the PAR packer we are trying to avoid.

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

soundbyte

#12
Quote from: FrankB on July 13, 2024, 04:45:26 AM
Quote from: soundbyte on July 12, 2024, 07:51:09 PMExtract the files from the new version zip file into c:\windows as suggested.

I know that suggestion has been made often. But I strongly advise to use a different folder and add that folder to your PATH. MS makes it harder with every Windows version to use C:\Windows for your own purposes.

Agreed not a really good idea but I used what is mentioned in the installation instructions https://exiftool.org/install.html "Windows" Point 5.
I had some problems getting the 2 latest versions working for me so I posted one solution.

Zip install (118 sub-directories and 498 files ~33,611,776 bytes) works and standalone applications can find exiftool.exe if the shortcut is copied as I mentioned.
The installer version (Everyone Settings - 1453 files in 125 sub-directories ~49,393,664 bytes) for me failed, it did not change the PATH environment variable when asked to do so, no application could find exiftool.exe.
Manually changing the PATH environment variable works.

obetz

Quote from: soundbyte on July 14, 2024, 01:17:15 AMThe installer version (Everyone Settings - 1453 files in 125 sub-directories ~49,393,664 bytes) for me failed, it did not change the PATH environment variable when asked to do so, no application could find exiftool.exe.
Manually changing the PATH environment variable works.
Sorry about the size - I'll investigate why the installer copies all files regardless the selection.

Regarding the path variable: Are you aware that only command windows started after the installation get the updated path? The environment in running CMD sessions is not changed.

obetz

Installer fixed now. In an earlier change, I didn't set the matching exclude rules. Now the default installation is approx. 540 files.

I also checked the path setting and found no problem. It works only for cmd windows opened after the installation, though.