SetupMajor := CreateDWord(
{#MAJOR},
{#MINOR});
SetupMinor := CreateDWord(
{#RELEASE},
{#BUILD});
Result := (SetupMajor > SavedMajor)
or ((SetupMajor = SavedMajor)
and (SetupMinor >= SavedMinor));
ResultAktuelleAppFound := (SetupMajor = SavedMajor)
or ((SetupMajor = SavedMajor)
and (SetupMinor = SavedMinor));
RegQueryStringValue(
HKLM,'
{#UNINSTKEY}','
UninstallString',DOSBoxCAE2000UninstallString);
DOSBoxCAE2000UninstallPath := (ExtractFileDir(DOSBoxCAE2000UninstallString) + '
\' + '
"');
DOSBoxCAE2000UninstallName := ('
"' + ExtractFileName(DOSBoxCAE2000UninstallString));
DOSBoxCAE2000UninstallStringRemovedQuotes := RemoveQuotes(DOSBoxCAE2000UninstallString);
DOSBoxCAE2000UninstallPathRemovedQuotes := RemoveQuotes(DOSBoxCAE2000UninstallPath);
DOSBoxCAE2000UninstallNameRemovedQuotes := RemoveQuotes(DOSBoxCAE2000UninstallName);
if not Result
then
begin
if RegQueryStringValue(
HKLM,'
{#UNINSTKEY}','
InstallLocation',DOSBoxCAE2000Path)
then
begin
result := DirExists(DOSBoxCAE2000Path);
end;
if not Result
then
begin
MsgBox(ExpandConstant('
{cm:DOSBoxPathNotFound}'),mbError,MB_OK);
ResultDOSBoxCAE2000PathCheck := false;
end;
if MsgBox(ExpandConstant('
{cm:NewerAppFound}'),mbError,MB_YESNO
or MB_DEFBUTTON2) = IDYES
then
begin
Exec(ExpandConstant(DOSBoxCAE2000UninstallStringRemovedQuotes),'
/SILENT','
',SW_SHOW,ewWaitUntilTerminated,ResultCode);
end else
ResultDOSBoxCAE2000DontDeinstall := true;
end;
if ResultAktuelleAppFound = true
then
begin
MsgBox(Format(ExpandConstant('
{cm:AktuelleAppFound}'),[DecodeVersion(SavedMajor,SavedMinor)]),mbConfirmation,MB_OK);
end;
end;