Skip to content

Commit

Permalink
Merge pull request #451 from FrankBijnen/Development
Browse files Browse the repository at this point in the history
 Update installer to support downloading and installing ExifTool V12.…
  • Loading branch information
FrankBijnen authored Jul 12, 2024
2 parents cacb378 + 3353b0b commit a442db3
Show file tree
Hide file tree
Showing 19 changed files with 140 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Docs/ExifToolGUI_V6.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ The portable version is still available, and will be continued to be released. R

<a name="m_reqs_exiftool">
<h3>1. ExifTool</h3>
Starting with V12.88 the ExifTool the distribution has changed. Please follow the instructions <a href="https://exiftool.org/install.html"><b>here</b></a>
if you want to install ExifTool manually. Starting with GUI V6.3.4 the installer can perform these steps also.
Starting with V12.88 the ExifTool distribution has changed. Please follow the instructions on <a href="https://exiftool.org/install.html"><b>https://exiftool.org/install.html</b></a>
if you want to install ExifTool manually. The GUI installer V6.3.4. can also perform these steps. <br><br>

ExifTool (version 12.78 and later) comes standard with a DB used for the <font color="CC0000">GeoLocation</font> feature. An alternate (larger) DB is also provided.<br>
The installer (V6.3.2) can download and install this larger DB automatically, See <a href="https://exiftool.org/geolocation.html">https://exiftool.org/geolocation.html</a> for more info how to do this manually.<br><br>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Postponing development until this is settled.<br><br>

This is an updated version of the ExifToolGui program created by Bogdan Hrastnik. Many thanks go out to him.

<b>Released version: <b>V6.3.3</b> updated June 7, 2024</b><br>
<b>Released version: <b>V6.3.4</b> updated July 12, 2024</b><br>

- 2 small bugfixes.<br>
- Changed compression of installer from lzma2 to zip, to prevent it from being flagged as virus.<br>
- Some small bugfixes.<br>
- Changed installer to support the new ExifTool distribution format, introduced with V12.88.<br>
- For the complete info see the changelog.<br>

[Change log](Docs/changelog.txt)<br>
Expand Down
135 changes: 135 additions & 0 deletions Redist/ExifToolGUI_install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#define DownloadGeoDB "DownloadGeoDB"
#define DownloadGeoDBDesc "Download alternate (larger) GeoLocation database."
#define GeoLocationDir "Geolocation500"
;
#define AddToPath "AddToPath"

[Setup]
AppPublisher={#ExifToolGUIPublisher}
Expand Down Expand Up @@ -82,6 +84,7 @@ DisableProgramGroupPage=yes
LicenseFile=License.rtf
; Will be overriden
InfoAfterFile=InfoDownload.rtf
ChangesEnvironment=true

[Messages]
FinishedHeadingLabel=[name] has been installed. Exiftool will be installed using the Oliver Betz installer.
Expand All @@ -102,6 +105,8 @@ Name: LanguagesWin64; Description: "Install Language DLL's (Wi
[Tasks]
Name: desktopicon; Description: "Create a &desktop icon"; \
GroupDescription: "Icons";
Name: {#AddToPath}; Description: "Add ExiftoolGUI to PATH"; \
GroupDescription: "Environment";
Name: {#DownloadExifToolManual}; Description: "&Manual. Download links will be presented after installing."; \
GroupDescription: "Download ExifTool. (Currently installed: {code:ShowInstalledVersion})"; \
Flags: exclusive; Check: EnableAutoDownload;
Expand Down Expand Up @@ -202,7 +207,120 @@ const
ET = 'exiftool';
GEODBVER = 'geo.txt';
EXIFTOOL_FILES = '\exiftool_files';
const
RootKeyAdmin = HKEY_LOCAL_MACHINE;
EnvironmentKeyAdmin = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';
RootKeyNonAdmin = HKEY_CURRENT_USER;
EnvironmentKeyNonAdmin = 'Environment';
procedure SetRegKey(var RootKey: integer; var EnvironmentKey: string);
begin
if (IsAdminInstallMode) then
begin
RootKey := RootKeyAdmin;
EnvironmentKey := EnvironmentKeyAdmin;
end
else
begin
RootKey := RootKeyNonAdmin;
EnvironmentKey := EnvironmentKeyNonAdmin;
end;
end;
function AddSemiColons(Paths: string; Prefix, Suffix: boolean): string;
var
L: integer;
begin
result := Paths;
L := Length(result);
if (L > 0) then
begin
if (Suffix) and
(Copy(result, L, 1) <> ';') then
result := result + ';';
if (Prefix) and
(Copy(result, 1, 1) <> ';') then
result := ';' + result;
end;
end;
function RemoveSemiColons(Paths: string; Prefix, Suffix: boolean): string;
var
L: integer;
begin
result := Paths;
L := Length(result);
if (L > 0) then
begin
if (Suffix) and
(Copy(result, L, 1) = ';') then
Delete(result, L, 1);
if (Prefix) and
(Copy(result, 1, 1) = ';') then
Delete(result, 1, 1);
end;
end;
procedure EnvAddPath(Path: string);
var
RootKey: integer;
EnvironmentKey: string;
OrigPaths: string;
Paths: string;
NewPath: string;
begin
SetRegKey(RootKey, EnvironmentKey);
{ Retrieve current path (use empty string if entry not exists) }
if not RegQueryStringValue(RootKey, EnvironmentKey, 'Path', OrigPaths) then
OrigPaths := '';
Paths := AddSemiColons(OrigPaths, true, true);
NewPath := AddSemiColons(Path, true, true);
{ Skip if string already found in path }
if Pos(Uppercase(NewPath), Uppercase(Paths)) > 0 then
exit;
{ App string to the end of the path variable }
Paths := AddSemiColons(OrigPaths, false, true) + Path;
{ Overwrite (or create if missing) path environment variable }
if not RegWriteStringValue(RootKey, EnvironmentKey, 'Path', Paths) then
Log(Format('Error while adding the [%s] to PATH: [%s]', [Path, Paths]));
end;
procedure EnvRemovePath(Path: string);
var
Rootkey: integer;
EnvironmentKey: string;
OrigPaths: string;
Paths: string;
OldPath: string;
P: Integer;
begin
SetRegKey(RootKey, EnvironmentKey);
{ Skip if registry entry not exists }
if not RegQueryStringValue(RootKey, EnvironmentKey, 'Path', OrigPaths) then
exit;
Paths := AddSemiColons(OrigPaths, true, true);
OldPath := AddSemiColons(Path, true, true);
{ Skip if string not found in path }
P := Pos(Uppercase(OldPath), Uppercase(Paths));
if (P = 0) then
exit;
Delete(Paths, P, Length(OldPath) -1);
Paths := RemoveSemiColons(Paths, true, true); // Remove unwanted ;
{ Overwrite path environment variable }
if not RegWriteStringValue(RootKey, EnvironmentKey, 'Path', Paths) then
Log(Format('Error while removing the [%s] from PATH: [%s]', [Path, Paths]));
end;
function GetInstalledVersionInPath(const Path: string): AnsiString;
var
Version_file: string;
Expand Down Expand Up @@ -347,6 +465,11 @@ begin
(UpperCase(ExpandConstant('{#EnableAutoDownloadOBetz}')) = 'YES');
end;
function AddToPathSelected: boolean;
begin
result := (WizardIsTaskSelected(ExpandConstant('{#AddToPath}')));
end;
function ObetzSelected: boolean;
begin
result := (WizardIsTaskSelected(ExpandConstant('{#DownloadExifToolAutoOBETZ}')));
Expand Down Expand Up @@ -714,5 +837,17 @@ begin
if AltDbSelected then
result := DownloadAltDb;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep = ssPostInstall) and
(AddToPathSelected) then
EnvAddPath(ExpandConstant('{app}'));
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usPostUninstall then
EnvRemovePath(ExpandConstant('{app}'));
end;
Binary file modified Translation/ExifToolGUI.CHS
Binary file not shown.
Binary file modified Translation/ExifToolGUI.DEU
Binary file not shown.
Binary file modified Translation/ExifToolGUI.ENU
Binary file not shown.
Binary file modified Translation/ExifToolGUI.ESP
Binary file not shown.
Binary file modified Translation/ExifToolGUI.FRA
Binary file not shown.
Binary file modified Translation/ExifToolGUI.ITA
Binary file not shown.
Binary file modified Translation/ExifToolGUI.NLD
Binary file not shown.
Binary file modified Translation/ExifToolGUI.PTB
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.CHS
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.DEU
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.ENU
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.ESP
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.FRA
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.ITA
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.NLD
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.PTB
Binary file not shown.

0 comments on commit a442db3

Please sign in to comment.