4
이전 프로그램을 패치하기 위해 설치 파일을 만들려고합니다. 설치 프로그램은 이전 프로그램이 설치되어 있는지 여부를 확인할 수 있어야합니다.레지스트리 키가 존재하는지 확인하고 설정을 끝내려면 어떻게합니까?
이 내 사용할 수없는 코드
[Code]
function GetHKLM() : Integer;
begin
if IsWin64 then
begin
Result := HKLM64;
end
else
begin
Result := HKEY_LOCAL_MACHINE;
end;
end;
function InitializeSetup(): Boolean;
var
V: string;
begin
if RegKeyExists(GetHKLM(), 'SOFTWARE\ABC\Option\Settings')
then
MsgBox('please install ABC first!!',mbError,MB_OK);
end;
내 조건이 RegKeyExists
- 이 창을 확인 32 비트 또는 64 비트 있어야합니다, 쇼 오류 메시지를 표시하고 설치 프로그램을 종료하십시오.
코드를 수정하는 방법?
미리 감사드립니다.
** 수정 프로그램 Wow6432Node
에 대한 업데이트 문제. regedit를 경로를 볼 때 당신은 그 어느 때보 다 다른 Wow6432Node
어디를 사용해서는 안 - 내 코드
[Code]
function InitializeSetup: Boolean;
begin
// allow the setup to continue initially
Result := True;
// if the registry key based on current OS bitness doesn't exist, then...
if IsWin64 then
begin
if not RegKeyExists(HKLM, 'SOFTWARE\Wow6432Node\ABC\Option\Settings') then
begin
// return False to prevent installation to continue
Result := False;
// and display a message box
MsgBox('please install ABC first!!', mbError, MB_OK);
end
else
if not RegKeyExists(HKLM, 'SOFTWARE\ABC\Option\Settings' then
begin
// return False to prevent installation to continue
Result := False;
// and display a message box
MsgBox('please install ABC first!!', mbError, MB_OK);
end
end;
end;
내가 아마 당신이 64 비트 응용 프로그램을 직접 설치하는 매우 드문 경우에 그것을 추가해야합니다, 당신은 대신'HKLM32'를 사용해야 할 수 있습니다 위의 'HKLM'입니다. 하지만 그렇지 않으면 64 비트에 대해 걱정할 필요가 없습니다. – Miral
적어도 ")"코드에서 누락 된 것 같습니다. – amalgamate
@amalgamate 고정. – Miral