volente
Новичок
Код:
var
InstallLocation: String;
function GetInstallString(): String;
var
InstPath: String;
InstallString: String;
begin
InstPath := ExpandConstant('Software\MetaFans\World of Wonder');
InstallString := '';
if not RegQueryStringValue(HKLM, InstPath, 'InstallLocation', InstallString) then
RegQueryStringValue(HKCU, InstPath, 'InstallLocation', InstallString);
Result := InstallString;
InstallLocation := InstallString;
end;
function InitializeSetup: Boolean;
var
V: Integer;
sUnInstallString: String;
Version: String;
begin
if RegValueExists(HKEY_LOCAL_MACHINE,'Software\MetaFans\World of Wonder', 'UninstallString') then begin
RegQueryStringValue(HKEY_LOCAL_MACHINE,'Software\MetaFans\World of Wonder', 'DisplayVersion', Version);
if Version =< ExpandConstant('{#Version}') then begin
Result := True;
GetInstallString();
end
else begin
MsgBox(ExpandConstant('{cm:old}'+Version+'.'+#13#10#13#10+'{cm:required}'+'{cm:terminated}'), mbInformation, MB_OK);
Result := False;
end;
end
else begin
MsgBox(ExpandConstant('{cm:required}'+'{cm:terminated}'), mbInformation, MB_OK);
Result := False;
end;
end;
Сообщите мне если нужен весь код.